summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-06-11 11:30:04 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-06-11 11:30:04 +0000
commite51920c000fc3bb33ac32431f93c1d14d8993e61 (patch)
tree453deac36d5a156fcd7b11c3eacf28e6bddf226a /sys/netinet
parent776ab6037aed51cacfd7c63b2214721185035329 (diff)
Always create a local route for every configured IPv4 address on the
machine and restore the original behavior of RTM_ADD and RTM_DELETE by always generating one message per locally configured address. Tested by krw@, jca@ and florian@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c8
-rw-r--r--sys/netinet/in.c5
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 8c8433d5c7a..a4a6d67c100 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.127 2014/05/07 08:14:59 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.128 2014/06/11 11:30:03 mpi Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -174,7 +174,8 @@ arp_rtrequest(int req, struct rtentry *rt)
if ((rt->rt_flags & RTF_HOST) == 0 && rt_mask(rt) &&
satosin(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
rt->rt_flags |= RTF_CLONING;
- if (rt->rt_flags & RTF_CLONING) {
+ if (rt->rt_flags & RTF_CLONING ||
+ ((rt->rt_flags & RTF_LLINFO) && !la)) {
/*
* Case 1: This route should come from a route to iface.
*/
@@ -189,7 +190,8 @@ arp_rtrequest(int req, struct rtentry *rt)
* from it do not need their expiration time set.
*/
rt->rt_expire = time_second;
- break;
+ if ((rt->rt_flags & RTF_CLONING) != 0)
+ break;
}
/* Announce a new entry if requested. */
if (rt->rt_flags & RTF_ANNOUNCE)
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 23796512c4d..bbf7db66c70 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.96 2014/04/25 09:44:38 mpi Exp $ */
+/* $OpenBSD: in.c,v 1.97 2014/06/11 11:30:03 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -702,6 +702,7 @@ out:
* carp(4).
*/
ifa_add(ifp, &ia->ia_ifa);
+ rt_ifa_addloop(&ia->ia_ifa);
if (error && newaddr)
in_purgeaddr(&ia->ia_ifa);
@@ -719,6 +720,8 @@ in_purgeaddr(struct ifaddr *ifa)
in_ifscrub(ifp, ia);
+ rt_ifa_delloop(&ia->ia_ifa);
+
ifa_del(ifp, &ia->ia_ifa);
TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
if (ia->ia_allhosts != NULL) {