From 60e40e7b3002402b1eb0a0b52eaa42d74490bd83 Mon Sep 17 00:00:00 2001 From: mpi Date: Sun, 25 Oct 2015 12:05:40 +0000 Subject: [PATCH] arp_ifinit() is no longer required. --- sys/net/if.c | 7 +------ sys/net/if_pair.c | 4 +--- sys/net/if_trunk.c | 8 ++------ sys/net/if_tun.c | 13 +------------ sys/net/if_vether.c | 5 +---- sys/net/if_vlan.c | 8 +++----- sys/net/if_vxlan.c | 5 +---- 7 files changed, 10 insertions(+), 40 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 019b6d7d419..e4691689f8b 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.395 2015/10/25 11:58:11 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.396 2015/10/25 12:05:40 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -2529,11 +2529,6 @@ ifnewlladdr(struct ifnet *ifp) ifrq.ifr_flags = ifp->if_flags; (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifrq); - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { - if (ifa->ifa_addr != NULL && - ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit((struct arpcom *)ifp, ifa); - } #ifdef INET6 /* * Update the link-local address. Don't do it if we're diff --git a/sys/net/if_pair.c b/sys/net/if_pair.c index 10bfc1f88af..2c0df41aece 100644 --- a/sys/net/if_pair.c +++ b/sys/net/if_pair.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pair.c,v 1.2 2015/10/24 11:01:39 reyk Exp $ */ +/* $OpenBSD: if_pair.c,v 1.3 2015/10/25 12:05:40 mpi Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -209,8 +209,6 @@ pairioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(&sc->sc_ac, ifa); /* FALLTHROUGH */ case SIOCSIFFLAGS: diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 2c2d82d64ed..ee77fde80db 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.121 2015/10/08 13:58:07 mikeb Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.122 2015/10/25 12:05:40 mpi Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter @@ -619,7 +619,6 @@ trunk_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct trunk_reqall *ra = (struct trunk_reqall *)data; struct trunk_reqport *rp = (struct trunk_reqport *)data, rpbuf; struct ifreq *ifr = (struct ifreq *)data; - struct ifaddr *ifa = (struct ifaddr *)data; struct trunk_port *tp; struct ifnet *tpif; int s, i, error = 0; @@ -737,10 +736,7 @@ trunk_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(&tr->tr_ac, ifa); - error = ENETRESET; - break; + /* FALLTHROUGH */ case SIOCSIFFLAGS: error = ENETRESET; break; diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 84041b75d64..6f0dff68a9d 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.158 2015/10/25 11:58:11 mpi Exp $ */ +/* $OpenBSD: if_tun.c,v 1.159 2015/10/25 12:05:40 mpi Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -490,7 +490,6 @@ tun_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct tun_softc *tp = (struct tun_softc *)(ifp->if_softc); struct ifreq *ifr = (struct ifreq *)data; - struct ifaddr *ifa = (struct ifaddr *)data; int error = 0, s; s = splnet(); @@ -498,16 +497,6 @@ tun_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFADDR: tun_init(tp); - TUNDEBUG(("%s: address set\n", ifp->if_xname)); - if (tp->tun_flags & TUN_LAYER2) { - switch (ifa->ifa_addr->sa_family) { - case AF_INET: - arp_ifinit(&tp->arpcom, ifa); - break; - default: - break; - } - } break; case SIOCSIFDSTADDR: tun_init(tp); diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c index 5854e04c839..27873d97f95 100644 --- a/sys/net/if_vether.c +++ b/sys/net/if_vether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vether.c,v 1.24 2015/05/23 08:31:05 mpi Exp $ */ +/* $OpenBSD: if_vether.c,v 1.25 2015/10/25 12:05:40 mpi Exp $ */ /* * Copyright (c) 2009 Theo de Raadt @@ -143,15 +143,12 @@ int vetherioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct vether_softc *sc = (struct vether_softc *)ifp->if_softc; - struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; int error = 0, link_state; switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(&sc->sc_ac, ifa); /* FALLTHROUGH */ case SIOCSIFFLAGS: diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index d9f1772d619..e088976bae3 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.145 2015/10/05 19:05:09 uebayasi Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.146 2015/10/25 12:05:40 mpi Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -595,11 +595,9 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFADDR: - if (ifv->ifv_p != NULL) { + if (ifv->ifv_p != NULL) ifp->if_flags |= IFF_UP; - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(&ifv->ifv_ac, ifa); - } else + else error = EINVAL; break; diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index d1ff2791d08..2669dceef8c 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.32 2015/10/23 01:19:04 dlg Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.33 2015/10/25 12:05:40 mpi Exp $ */ /* * Copyright (c) 2013 Reyk Floeter @@ -328,7 +328,6 @@ int vxlanioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc; - struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; struct if_laddrreq *lifr = (struct if_laddrreq *)data; int error = 0, s; @@ -336,8 +335,6 @@ vxlanioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(&sc->sc_ac, ifa); /* FALLTHROUGH */ case SIOCSIFFLAGS: -- 2.20.1