From owner-svn-src-head@freebsd.org Mon Oct 21 18:17:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC46015E8BF; Mon, 21 Oct 2019 18:17:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46xlGS5wc9z3Cbn; Mon, 21 Oct 2019 18:17:04 +0000 (UTC) (envelope-from glebius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF78227D45; Mon, 21 Oct 2019 18:17:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9LIH4DK073413; Mon, 21 Oct 2019 18:17:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9LIH34m073408; Mon, 21 Oct 2019 18:17:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910211817.x9LIH34m073408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 21 Oct 2019 18:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353868 - in head: . sys/net sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: . sys/net sys/sys X-SVN-Commit-Revision: 353868 X-SVN-Commit-Repository: base 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.29 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: Mon, 21 Oct 2019 18:17:05 -0000 Author: glebius Date: Mon Oct 21 18:17:03 2019 New Revision: 353868 URL: https://svnweb.freebsd.org/changeset/base/353868 Log: Remove obsoleted KPIs that were used to access interface address lists. Modified: head/UPDATING head/sys/net/if.c head/sys/net/if_var.h head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 21 18:13:37 2019 (r353867) +++ head/UPDATING Mon Oct 21 18:17:03 2019 (r353868) @@ -27,6 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20191021: + KPIs for network drivers to access interface addresses have changed. + Users need to recompile NIC driver modules together with kernel. + +20191021: The net.link.tap.user_open sysctl no longer prevents user opening of already created /dev/tapNN devices. Access is still controlled by node permissions, just like tun devices. The net.link.tap.user_open Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Oct 21 18:13:37 2019 (r353867) +++ head/sys/net/if.c Mon Oct 21 18:17:03 2019 (r353868) @@ -1768,40 +1768,6 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) } /* - * Wrapper functions for struct ifnet address list locking macros. These are - * used by kernel modules to avoid encoding programming interface or binary - * interface assumptions that may be violated when kernel-internal locking - * approaches change. - */ -void -if_addr_rlock(struct ifnet *ifp) -{ - - epoch_enter_preempt(net_epoch_preempt, curthread->td_et); -} - -void -if_addr_runlock(struct ifnet *ifp) -{ - - epoch_exit_preempt(net_epoch_preempt, curthread->td_et); -} - -void -if_maddr_rlock(if_t ifp) -{ - - epoch_enter_preempt(net_epoch_preempt, curthread->td_et); -} - -void -if_maddr_runlock(if_t ifp) -{ - - epoch_exit_preempt(net_epoch_preempt, curthread->td_et); -} - -/* * Initialization, destruction and refcounting functions for ifaddrs. */ struct ifaddr * @@ -4403,77 +4369,6 @@ if_input(if_t ifp, struct mbuf* sendmp) (*((struct ifnet *)ifp)->if_input)((struct ifnet *)ifp, sendmp); return (0); -} - -/* XXX */ -#ifndef ETH_ADDR_LEN -#define ETH_ADDR_LEN 6 -#endif - -int -if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max) -{ - struct ifmultiaddr *ifma; - uint8_t *lmta = (uint8_t *)mta; - int mcnt = 0; - - CK_STAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - if (mcnt == max) - break; - - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - &lmta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); - mcnt++; - } - *cnt = mcnt; - - return (0); -} - -int -if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max) -{ - int error; - - if_maddr_rlock(ifp); - error = if_setupmultiaddr(ifp, mta, cnt, max); - if_maddr_runlock(ifp); - return (error); -} - -int -if_multiaddr_count(if_t ifp, int max) -{ - struct ifmultiaddr *ifma; - int count; - - count = 0; - if_maddr_rlock(ifp); - CK_STAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - count++; - if (count == max) - break; - } - if_maddr_runlock(ifp); - return (count); -} - -int -if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg) -{ - struct ifmultiaddr *ifma; - int cnt = 0; - - if_maddr_rlock(ifp); - CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) - cnt += filter(arg, ifma, cnt); - if_maddr_runlock(ifp); - return (cnt); } struct mbuf * Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Oct 21 18:13:37 2019 (r353867) +++ head/sys/net/if_var.h Mon Oct 21 18:17:03 2019 (r353868) @@ -449,16 +449,6 @@ struct ifnet { #define NET_EPOCH_WAIT() epoch_wait_preempt(net_epoch_preempt) #define NET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) -/* - * Function variations on locking macros intended to be used by loadable - * kernel modules in order to divorce them from the internals of address list - * locking. - */ -void if_addr_rlock(struct ifnet *ifp); /* if_addrhead */ -void if_addr_runlock(struct ifnet *ifp); /* if_addrhead */ -void if_maddr_rlock(if_t ifp); /* if_multiaddrs */ -void if_maddr_runlock(if_t ifp); /* if_multiaddrs */ - #ifdef _KERNEL /* interface link layer address change event */ typedef void (*iflladdr_event_handler_t)(void *, struct ifnet *); @@ -773,12 +763,6 @@ u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); u_int if_lladdr_count(if_t); u_int if_llmaddr_count(if_t); -int if_multiaddr_count(if_t ifp, int max); - -/* Obsoleted multicast management functions. */ -int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max); -int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); -int if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg); int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 21 18:13:37 2019 (r353867) +++ head/sys/sys/param.h Mon Oct 21 18:17:03 2019 (r353868) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300053 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300054 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,