diff options
-rw-r--r-- | sys/net/if_mpe.c | 10 | ||||
-rw-r--r-- | sys/net/if_mpw.c | 10 | ||||
-rw-r--r-- | sys/net/route.c | 4 | ||||
-rw-r--r-- | sys/netinet/in.c | 9 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 12 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 4 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 4 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 8 |
8 files changed, 29 insertions, 32 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 689b3543712..1a4a6328477 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.46 2015/06/30 13:54:42 mpi Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.47 2015/09/12 20:50:17 mpi Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -124,7 +124,7 @@ mpe_clone_destroy(struct ifnet *ifp) if (mpeif->sc_smpls.smpls_label) { s = splsoftnet(); - rt_ifa_del(&mpeif->sc_ifa, RTF_MPLS | RTF_UP, + rt_ifa_del(&mpeif->sc_ifa, RTF_MPLS, smplstosa(&mpeif->sc_smpls)); splx(s); } @@ -323,12 +323,12 @@ mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) s = splsoftnet(); if (ifm->sc_smpls.smpls_label) { /* remove old MPLS route */ - rt_ifa_del(&ifm->sc_ifa, RTF_MPLS | RTF_UP, + rt_ifa_del(&ifm->sc_ifa, RTF_MPLS, smplstosa(&ifm->sc_smpls)); } /* add new MPLS route */ ifm->sc_smpls.smpls_label = shim.shim_label; - error = rt_ifa_add(&ifm->sc_ifa, RTF_MPLS | RTF_UP, + error = rt_ifa_add(&ifm->sc_ifa, RTF_MPLS, smplstosa(&ifm->sc_smpls)); splx(s); if (error) { @@ -342,7 +342,7 @@ mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (ifr->ifr_rdomainid != ifp->if_rdomain) { if (ifm->sc_smpls.smpls_label) { s = splsoftnet(); - rt_ifa_add(&ifm->sc_ifa, RTF_MPLS | RTF_UP, + rt_ifa_add(&ifm->sc_ifa, RTF_MPLS, smplstosa(&ifm->sc_smpls)); splx(s); } diff --git a/sys/net/if_mpw.c b/sys/net/if_mpw.c index d8c5e1b4004..8626a1736e4 100644 --- a/sys/net/if_mpw.c +++ b/sys/net/if_mpw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpw.c,v 1.5 2015/09/10 16:41:30 mikeb Exp $ */ +/* $OpenBSD: if_mpw.c,v 1.6 2015/09/12 20:50:17 mpi Exp $ */ /* * Copyright (c) 2015 Rafael Zalamena <rzalamena@openbsd.org> @@ -128,7 +128,7 @@ mpw_clone_destroy(struct ifnet *ifp) if (sc->sc_smpls.smpls_label) { s = splsoftnet(); - rt_ifa_del(&sc->sc_ifa, RTF_MPLS | RTF_UP, + rt_ifa_del(&sc->sc_ifa, RTF_MPLS, smplstosa(&sc->sc_smpls)); splx(s); } @@ -189,7 +189,7 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) sin = (struct sockaddr_in *) &imr.imr_nexthop; if (sin->sin_addr.s_addr == 0) { s = splsoftnet(); - if (rt_ifa_del(&sc->sc_ifa, RTF_MPLS | RTF_UP, + if (rt_ifa_del(&sc->sc_ifa, RTF_MPLS, smplstosa(&sc->sc_smpls)) == 0) sc->sc_smpls.smpls_label = 0; splx(s); @@ -220,11 +220,11 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (sc->sc_smpls.smpls_label != imr.imr_lshim.shim_label) { s = splsoftnet(); if (sc->sc_smpls.smpls_label) - rt_ifa_del(&sc->sc_ifa, RTF_MPLS | RTF_UP, + rt_ifa_del(&sc->sc_ifa, RTF_MPLS, smplstosa(&sc->sc_smpls)); sc->sc_smpls.smpls_label = imr.imr_lshim.shim_label; - error = rt_ifa_add(&sc->sc_ifa, RTF_MPLS | RTF_UP, + error = rt_ifa_add(&sc->sc_ifa, RTF_MPLS, smplstosa(&sc->sc_smpls)); splx(s); if (error != 0) { diff --git a/sys/net/route.c b/sys/net/route.c index 7a3cd332ccc..ff26860af9d 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.238 2015/09/12 09:22:29 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.239 2015/09/12 20:50:17 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1316,7 +1316,7 @@ rt_ifa_addlocal(struct ifaddr *ifa) /* If there is no loopback entry, allocate one. */ rt = rtalloc(ifa->ifa_addr, 0, ifa->ifa_ifp->if_rdomain); if (rt == NULL || !ISSET(rt->rt_flags, flags)) - error = rt_ifa_add(ifa, RTF_UP | flags, ifa->ifa_addr); + error = rt_ifa_add(ifa, flags, ifa->ifa_addr); if (rt) rtfree(rt); diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 77f1c4f682d..084951ef8bd 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.122 2015/09/09 20:12:36 dlg Exp $ */ +/* $OpenBSD: in.c,v 1.123 2015/09/12 20:50:17 mpi Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -713,7 +713,7 @@ in_purgeaddr(struct ifaddr *ifa) int in_addhost(struct in_ifaddr *ia, struct sockaddr_in *dst) { - return rt_ifa_add(&ia->ia_ifa, RTF_UP|RTF_HOST, sintosa(dst)); + return rt_ifa_add(&ia->ia_ifa, RTF_HOST, sintosa(dst)); } int @@ -731,13 +731,12 @@ in_insert_prefix(struct in_ifaddr *ia) struct ifaddr *ifa = &ia->ia_ifa; int error; - error = rt_ifa_add(ifa, RTF_UP | RTF_CLONING | RTF_CONNECTED, - ifa->ifa_addr); + error = rt_ifa_add(ifa, RTF_CLONING | RTF_CONNECTED, ifa->ifa_addr); if (error) return (error); if (ia->ia_broadaddr.sin_addr.s_addr != 0) - error = rt_ifa_add(ifa, RTF_UP | RTF_HOST | RTF_BROADCAST, + error = rt_ifa_add(ifa, RTF_HOST | RTF_BROADCAST, ifa->ifa_broadaddr); return (error); diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index e4f3e66df0f..08d150409a4 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.174 2015/09/10 16:39:39 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.175 2015/09/12 20:50:17 mpi Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -501,8 +501,8 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) } s = splsoftnet(); - error = rt_ifa_add(&ia6->ia_ifa, - RTF_UP|RTF_CLONING|RTF_CONNECTED, ia6->ia_ifa.ifa_addr); + error = rt_ifa_add(&ia6->ia_ifa, RTF_CLONING | RTF_CONNECTED, + ia6->ia_ifa.ifa_addr); if (error) { in6_purgeaddr(&ia6->ia_ifa); splx(s); @@ -807,7 +807,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask); info.rti_info[RTAX_IFA] = sin6tosa(&ia6->ia_addr); /* XXX: we need RTF_CLONING to fake nd6_rtrequest */ - info.rti_flags = RTF_UP | RTF_CLONING; + info.rti_flags = RTF_CLONING; error = rtrequest1(RTM_ADD, &info, RTP_CONNECTED, NULL, ifp->if_rdomain); if (error) @@ -863,7 +863,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, info.rti_info[RTAX_GATEWAY] = sin6tosa(&ia6->ia_addr); info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask); info.rti_info[RTAX_IFA] = sin6tosa(&ia6->ia_addr); - info.rti_flags = RTF_UP | RTF_CLONING; + info.rti_flags = RTF_CLONING; error = rtrequest1(RTM_ADD, &info, RTP_CONNECTED, NULL, ifp->if_rdomain); if (error) @@ -1255,7 +1255,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia6, int newhost) if ((ifp->if_flags & IFF_POINTOPOINT) && plen == 128 && ia6->ia_dstaddr.sin6_family == AF_INET6) { ifa = &ia6->ia_ifa; - error = rt_ifa_add(ifa, RTF_UP | RTF_HOST, ifa->ifa_dstaddr); + error = rt_ifa_add(ifa, RTF_HOST, ifa->ifa_dstaddr); if (error != 0) return (error); ia6->ia_flags |= IFA_ROUTE; diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 9ab969bec81..461e2a381b7 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.95 2015/09/03 16:42:01 mpi Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.96 2015/09/12 20:50:17 mpi Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -356,7 +356,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid) } s = splsoftnet(); - error = rt_ifa_add(&ia6->ia_ifa, RTF_UP|RTF_CLONING|RTF_CONNECTED, + error = rt_ifa_add(&ia6->ia_ifa, RTF_CLONING | RTF_CONNECTED, ia6->ia_ifa.ifa_addr); if (error) { in6_purgeaddr(&ia6->ia_ifa); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index b37a5cc09df..2842448b384 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.151 2015/09/12 20:26:07 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.152 2015/09/12 20:50:17 mpi Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -667,7 +667,7 @@ nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp, * called in rtrequest1 via ifa->ifa_rtrequest. */ bzero(&info, sizeof(info)); - info.rti_flags = RTF_UP | RTF_HOST | RTF_LLINFO; + info.rti_flags = RTF_HOST | RTF_LLINFO; info.rti_info[RTAX_DST] = sin6tosa(&sin6); info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)ifp->if_sadl; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 7b863667483..e95970d3ea1 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.123 2015/09/11 08:17:06 claudio Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.124 2015/09/12 20:50:17 mpi Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -1723,7 +1723,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) struct nd_prefix *opr; struct rtentry *rt; char addr[INET6_ADDRSTRLEN]; - u_long rtflags; + u_long rtflags = 0; int error; /* sanity check */ @@ -1788,9 +1788,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) mask6.sin6_addr = pr->ndpr_mask; if (nd6_need_cache(ifp)) - rtflags = (RTF_UP | RTF_CLONING | RTF_CONNECTED); - else - rtflags = RTF_UP; + rtflags = RTF_CLONING | RTF_CONNECTED; bzero(&info, sizeof(info)); info.rti_flags = rtflags; |