summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2011-05-20 19:12:20 +0000
committerqingli <qingli@FreeBSD.org>2011-05-20 19:12:20 +0000
commita1bf1a258207345435ea10acd5842a3edd836a66 (patch)
tree25e7bd536a80b8bf826cad648267e4078b9e4f2e /sys/netinet/raw_ip.c
parent8b344f95a5795eba597f19d5c6b1516c99bb2fa9 (diff)
downloadFreeBSD-src-a1bf1a258207345435ea10acd5842a3edd836a66.zip
FreeBSD-src-a1bf1a258207345435ea10acd5842a3edd836a66.tar.gz
The statically configured (permanent) ARP entries are removed when an
interface is brought down, even though the interface address is still valid. This patch maintains the permanent ARP entries as long as the interface address (having the same prefix as that of the ARP entries) is valid. Reviewed by: delphij MFC after: 5 days
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index b196de2..be099a8 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_systm.h>
#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/ip_mroute.h>
@@ -721,7 +722,7 @@ rip_ctlinput(int cmd, struct sockaddr *sa, void *vip)
/*
* in_ifscrub kills the interface route.
*/
- in_ifscrub(ia->ia_ifp, ia);
+ in_ifscrub(ia->ia_ifp, ia, 0);
/*
* in_ifadown gets rid of all the rest of the
* routes. This is not quite the right thing
@@ -756,12 +757,18 @@ rip_ctlinput(int cmd, struct sockaddr *sa, void *vip)
|| (ifp->if_flags & IFF_POINTOPOINT))
flags |= RTF_HOST;
+ err = ifa_del_loopback_route((struct ifaddr *)ia, sa);
+ if (err == 0)
+ ia->ia_flags &= ~IFA_RTSELF;
+
err = rtinit(&ia->ia_ifa, RTM_ADD, flags);
if (err == 0)
ia->ia_flags |= IFA_ROUTE;
+
err = ifa_add_loopback_route((struct ifaddr *)ia, sa);
if (err == 0)
ia->ia_flags |= IFA_RTSELF;
+
ifa_free(&ia->ia_ifa);
break;
}
OpenPOWER on IntegriCloud