From owner-svn-src-head@freebsd.org Sat Nov 14 13:34:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4343EA2DFCA; Sat, 14 Nov 2015 13:34:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1060B11ED; Sat, 14 Nov 2015 13:34:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAEDY48X017925; Sat, 14 Nov 2015 13:34:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEDY3AB017919; Sat, 14 Nov 2015 13:34:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201511141334.tAEDY3AB017919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 14 Nov 2015 13:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290819 - in head/sys: net netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 13:34:05 -0000 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: