summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-08-26 15:09:27 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-08-26 15:09:27 +0000
commit166ef3c214d019317916f1ea9985b06016dfaec4 (patch)
tree093669d2815efa831f3353b79e00c1650a61492d /sys/net
parent8d5ab534d4eaf1b45ac75c9317eeef66ad62d1dd (diff)
Revert the addition of broadcast addresses, it apparently also corrupts
the tree. Found by millert@.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index e1bf33efa4f..3718bce4e0d 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.180 2014/08/21 10:07:07 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.181 2014/08/26 15:09:26 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -791,8 +791,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
* sure that local routes are only modified by the
* kernel.
*/
- if ((rt->rt_flags & (RTF_LOCAL | RTF_BROADCAST)) &&
- prio != RTP_LOCAL)
+ if (rt->rt_flags & RTF_LOCAL && prio != RTP_LOCAL)
senderr(EINVAL);
if ((rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST],
@@ -1111,7 +1110,7 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct sockaddr *dst)
if ((flags & RTF_HOST) == 0)
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
- if (flags & (RTF_LOCAL|RTF_BROADCAST))
+ if (flags & RTF_LOCAL)
prio = RTP_LOCAL;
error = rtrequest1(RTM_ADD, &info, prio, &nrt, rtableid);
@@ -1129,12 +1128,6 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct sockaddr *dst)
if (ifa->ifa_rtrequest)
ifa->ifa_rtrequest(RTM_ADD, rt);
}
-
- /*
- * A local route is created for every address configured
- * on an interface, so use this information to notify
- * userland that a new address has been added.
- */
if (flags & RTF_LOCAL)
rt_newaddrmsg(RTM_ADD, ifa, error, nrt);
}
@@ -1185,7 +1178,7 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct sockaddr *dst)
if ((flags & RTF_HOST) == 0)
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
- if (flags & (RTF_LOCAL|RTF_BROADCAST))
+ if (flags & RTF_LOCAL)
prio = RTP_LOCAL;
error = rtrequest1(RTM_DELETE, &info, prio, &nrt, rtableid);
@@ -1236,16 +1229,9 @@ rt_ifa_addloop(struct ifaddr *ifa)
/* If there is no loopback entry, allocate one. */
rt = rtalloc1(ifa->ifa_addr, 0, ifa->ifa_ifp->if_rdomain);
if (rt == NULL || (rt->rt_flags & RTF_HOST) == 0 ||
- (rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0) {
+ (rt->rt_ifp->if_flags & IFF_LOOPBACK) == 0)
rt_ifa_add(ifa, RTF_UP| RTF_HOST | RTF_LLINFO | RTF_LOCAL,
ifa->ifa_addr);
-
- if ((ifa->ifa_ifp->if_flags & IFF_BROADCAST) &&
- ifa->ifa_broadaddr)
- rt_ifa_add(ifa, RTF_UP | RTF_HOST | RTF_LLINFO |
- RTF_BROADCAST, ifa->ifa_broadaddr);
-
- }
if (rt)
rt->rt_refcnt--;
}
@@ -1288,15 +1274,9 @@ rt_ifa_delloop(struct ifaddr *ifa)
*/
rt = rtalloc1(ifa->ifa_addr, 0, ifa->ifa_ifp->if_rdomain);
if (rt != NULL && (rt->rt_flags & RTF_HOST) != 0 &&
- (rt->rt_ifp->if_flags & IFF_LOOPBACK) != 0) {
+ (rt->rt_ifp->if_flags & IFF_LOOPBACK) != 0)
rt_ifa_del(ifa, RTF_HOST | RTF_LLINFO | RTF_LOCAL,
ifa->ifa_addr);
-
- if ((ifa->ifa_ifp->if_flags & IFF_BROADCAST) &&
- ifa->ifa_broadaddr)
- rt_ifa_del(ifa, RTF_HOST | RTF_LLINFO | RTF_BROADCAST,
- ifa->ifa_broadaddr);
- }
if (rt)
rt->rt_refcnt--;
}