From: mpi Date: Thu, 22 Oct 2015 17:48:34 +0000 (+0000) Subject: Kill link_rtrequest(), introduce in 1990 to "fix" the result X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=03def9c584e190fdb486a576dda797f7305f3ef3;p=openbsd Kill link_rtrequest(), introduce in 1990 to "fix" the result of rt_getifa() when adding link level route from outside the kernel. ok claudio@ --- diff --git a/sys/net/if.c b/sys/net/if.c index 332303834b2..91e41f762d8 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.392 2015/10/22 16:44:54 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.393 2015/10/22 17:48:34 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1273,30 +1273,6 @@ ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp) return (ifa_maybe); } -/* - * Default action when installing a route with a Link Level gateway. - * Lookup an appropriate real ifa to point to. - * This should be moved to /sys/net/link.c eventually. - */ -void -link_rtrequest(int cmd, struct rtentry *rt) -{ - struct ifaddr *ifa; - struct sockaddr *dst; - struct ifnet *ifp; - - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) || - ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0)) - return; - if ((ifa = ifaof_ifpforaddr(dst, ifp)) != NULL) { - ifa->ifa_refcnt++; - ifafree(rt->rt_ifa); - rt->rt_ifa = ifa; - if (ifa->ifa_rtrequest && ifa->ifa_rtrequest != link_rtrequest) - ifa->ifa_rtrequest(cmd, rt); - } -} - /* * Default action when installing a local route on a point-to-point * interface. diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 4c1e308fb28..ca3ecbb75ae 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.61 2015/10/22 15:37:47 bluhm Exp $ */ +/* $OpenBSD: if_enc.c,v 1.62 2015/10/22 17:48:34 mpi Exp $ */ /* * Copyright (c) 2010 Reyk Floeter @@ -104,7 +104,6 @@ enc_clone_create(struct if_clone *ifc, int unit) */ if_alloc_sadl(ifp); sc->sc_ifa.ifa_ifp = ifp; - sc->sc_ifa.ifa_rtrequest = link_rtrequest; sc->sc_ifa.ifa_addr = sdltosa(ifp->if_sadl); sc->sc_ifa.ifa_netmask = NULL; diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 53da65c4373..a88d6e1b748 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.48 2015/10/22 15:37:47 bluhm Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.49 2015/10/22 17:48:34 mpi Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -105,7 +105,6 @@ mpe_clone_create(struct if_clone *ifc, int unit) #endif mpeif->sc_ifa.ifa_ifp = ifp; - mpeif->sc_ifa.ifa_rtrequest = link_rtrequest; mpeif->sc_ifa.ifa_addr = sdltosa(ifp->if_sadl); mpeif->sc_smpls.smpls_len = sizeof(mpeif->sc_smpls); mpeif->sc_smpls.smpls_family = AF_MPLS; diff --git a/sys/net/if_mpw.c b/sys/net/if_mpw.c index 197bb54f9f0..84c94fe6b72 100644 --- a/sys/net/if_mpw.c +++ b/sys/net/if_mpw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpw.c,v 1.7 2015/10/22 15:37:47 bluhm Exp $ */ +/* $OpenBSD: if_mpw.c,v 1.8 2015/10/22 17:48:34 mpi Exp $ */ /* * Copyright (c) 2015 Rafael Zalamena @@ -105,7 +105,6 @@ mpw_clone_create(struct if_clone *ifc, int unit) if_alloc_sadl(ifp); sc->sc_ifa.ifa_ifp = ifp; - sc->sc_ifa.ifa_rtrequest = link_rtrequest; sc->sc_ifa.ifa_addr = sdltosa(ifp->if_sadl); sc->sc_smpls.smpls_len = sizeof(sc->sc_smpls); sc->sc_smpls.smpls_family = AF_MPLS; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index a58be229d48..b2e542f85dd 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.48 2015/10/12 13:17:58 dlg Exp $ */ +/* $OpenBSD: if_var.h,v 1.49 2015/10/22 17:48:34 mpi Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -422,7 +422,6 @@ struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, u_int); struct ifaddr *ifa_ifwithnet(struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); void ifafree(struct ifaddr *); -void link_rtrequest(int, struct rtentry *); void p2p_rtrequest(int, struct rtentry *); void if_clone_attach(struct if_clone *);