Back out r186308:

in case of AF_LINK, which the kernel still returns for an RTAX_GATEWAY
as an empty sockaddr_dl in the classic tun<n> case.
Copying the address into the message payload, but not the RTA_GATEWAY
flag results in rt_xaddrs() in the kernel tripping over that and parsing
the next attribute set with a flag, i.e. RTA_NETMASK, with the gateway
address, resulting in bogus route entry.

MFC after:	3 days
This commit is contained in:
Bjoern A. Zeeb 2009-04-20 11:22:51 +00:00
parent 2cbf101b17
commit 16f37cbd72

View File

@ -910,10 +910,8 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst,
p += memcpy_roundup(p, dst, dst->sa_len);
}
if (gw != NULL && (gw->sa_family != AF_LINK))
rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
p += memcpy_roundup(p, gw, gw->sa_len);
if (mask) {
rtmes.m_rtm.rtm_addrs |= RTA_NETMASK;
p += memcpy_roundup(p, mask, mask->sa_len);