diff options
author | qingli <qingli@FreeBSD.org> | 2010-05-25 20:42:35 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2010-05-25 20:42:35 +0000 |
commit | f6ab4a681092467819a08db78ce8d607027932f3 (patch) | |
tree | 77dc5f4f28833bfa251750d8664af39e70979adf /sys/net/rtsock.c | |
parent | fd1b90e890d4acaa91139d5635282fcd1406eeec (diff) | |
download | FreeBSD-src-f6ab4a681092467819a08db78ce8d607027932f3.zip FreeBSD-src-f6ab4a681092467819a08db78ce8d607027932f3.tar.gz |
This patch fixes the problem where proxy ARP entries cannot be added
over the if_ng interface.
MFC after: 3 days
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index de65482..009d211 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -55,6 +55,7 @@ #include <net/if.h> #include <net/if_dl.h> #include <net/if_llatbl.h> +#include <net/if_types.h> #include <net/netisr.h> #include <net/raw_cb.h> #include <net/route.h> @@ -673,12 +674,22 @@ route_output(struct mbuf *m, struct socket *so) * another search to retrieve the prefix route of * the local end point of the PPP link. */ - if ((rtm->rtm_flags & RTF_ANNOUNCE) && - (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { + if (rtm->rtm_flags & RTF_ANNOUNCE) { struct sockaddr laddr; - rt_maskedcopy(rt->rt_ifa->ifa_addr, - &laddr, - rt->rt_ifa->ifa_netmask); + + if (rt->rt_ifp != NULL && + rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { + struct ifaddr *ifa; + + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); + if (ifa != NULL) + rt_maskedcopy(ifa->ifa_addr, + &laddr, + ifa->ifa_netmask); + } else + rt_maskedcopy(rt->rt_ifa->ifa_addr, + &laddr, + rt->rt_ifa->ifa_netmask); /* * refactor rt and no lock operation necessary */ |