Date: Sat, 14 Nov 2015 13:34:03 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290819 - in head/sys: net netgraph Message-ID: <201511141334.tAEDY3AB017919@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: melifaro Date: Sat Nov 14 13:34:03 2015 New Revision: 290819 URL: https://svnweb.freebsd.org/changeset/base/290819 Log: Move iflladdr_event eventhandler invocation to if_setlladdr. Suggested by: glebius Modified: head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if.c Sat Nov 14 13:34:03 2015 (r290819) @@ -2512,8 +2512,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); error = if_setlladdr(ifp, ifr->ifr_addr.sa_data, ifr->ifr_addr.sa_len); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, ifp); break; case SIOCAIFGROUP: @@ -3377,6 +3375,7 @@ if_setlladdr(struct ifnet *ifp, const u_ (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); } } + EVENTHANDLER_INVOKE(iflladdr_event, ifp); return (0); } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if_lagg.c Sat Nov 14 13:34:03 2015 (r290819) @@ -690,7 +690,6 @@ lagg_port_setlladdr(void *arg, int pendi struct lagg_softc *sc = (struct lagg_softc *)arg; struct lagg_llq *llq, *head; struct ifnet *ifp; - int error; /* Grab a local reference of the queue and remove it from the softc */ LAGG_WLOCK(sc); @@ -706,7 +705,6 @@ lagg_port_setlladdr(void *arg, int pendi ifp = llq->llq_ifp; CURVNET_SET(ifp->if_vnet); - error = 0; /* * Set the link layer address on the laggport interface. @@ -714,11 +712,8 @@ lagg_port_setlladdr(void *arg, int pendi * may result in arp transmission / lltable updates. */ if (llq->llq_type == LAGG_LLQTYPE_PHYS) - error = if_setlladdr(ifp, llq->llq_lladdr, + if_setlladdr(ifp, llq->llq_lladdr, ETHER_ADDR_LEN); - if (error) - printf("%s: setlladdr failed on %s\n", __func__, - ifp->if_xname); else EVENTHANDLER_INVOKE(iflladdr_event, ifp); CURVNET_RESTORE(); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/net/if_vlan.c Sat Nov 14 13:34:03 2015 (r290819) @@ -523,7 +523,7 @@ vlan_iflladdr(void *arg __unused, struct #ifndef VLAN_ARRAY struct ifvlan *next; #endif - int error, i; + int i; /* * Check if it's a trunk interface first of all @@ -544,11 +544,8 @@ vlan_iflladdr(void *arg __unused, struct LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { #endif /* VLAN_ARRAY */ VLAN_UNLOCK(); - error = if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), + if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ifp->if_addrlen); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, - ifv->ifv_ifp); VLAN_LOCK(); } VLAN_UNLOCK(); Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/netgraph/ng_eiface.c Sat Nov 14 13:34:03 2015 (r290819) @@ -489,8 +489,6 @@ ng_eiface_rcvmsg(node_p node, item_p ite } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Sat Nov 14 06:18:50 2015 (r290818) +++ head/sys/netgraph/ng_ether.c Sat Nov 14 13:34:03 2015 (r290819) @@ -534,8 +534,6 @@ ng_ether_rcvmsg(node_p node, item_p item } error = if_setlladdr(priv->ifp, (u_char *)msg->data, ETHER_ADDR_LEN); - if (error == 0) - EVENTHANDLER_INVOKE(iflladdr_event, priv->ifp); break; } case NGM_ETHER_GET_PROMISC:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511141334.tAEDY3AB017919>