Date: Fri, 28 Jan 2022 18:31:26 GMT From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 964b8f8b993d - main - ifnet: garbage collect unused function ifaddr_byindex(). Message-ID: <202201281831.20SIVQZT099120@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=964b8f8b993d48f66a3d3b46a4cd67c1f6d1e326 commit 964b8f8b993d48f66a3d3b46a4cd67c1f6d1e326 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-01-28 17:51:52 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-01-28 17:51:52 +0000 ifnet: garbage collect unused function ifaddr_byindex(). Last use was removed in 5adea417d49. --- sys/net/if.c | 14 -------------- sys/net/if_var.h | 9 +-------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index e8d65e64518a..f43c1597c413 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -412,20 +412,6 @@ ifnet_byindexgen(uint16_t idx, uint16_t gen) return (NULL); } -struct ifaddr * -ifaddr_byindex(u_short idx) -{ - struct ifnet *ifp; - struct ifaddr *ifa = NULL; - - NET_EPOCH_ASSERT(); - - ifp = ifnet_byindex(idx); - if (ifp != NULL && (ifa = ifp->if_addr) != NULL) - ifa_ref(ifa); - return (ifa); -} - /* * Network interface utility routines. * diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 21b3687f62c1..e054c613e9e6 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -373,7 +373,7 @@ struct ifnet { * addresses which store the link-level address and the name * of the interface. * However, access to the AF_LINK address through this - * field is deprecated. Use if_addr or ifaddr_byindex() instead. + * field is deprecated. Use if_addr instead. */ struct ifaddrhead if_addrhead; /* linked list of addresses per if */ struct ifmultihead if_multiaddrs; /* multicast addresses configured */ @@ -651,13 +651,6 @@ struct ifnet *ifnet_byindex_ref(u_int); */ struct ifnet *ifnet_byindexgen(uint16_t idx, uint16_t gen); -/* - * Given the index, ifaddr_byindex() returns the one and only - * link-level ifaddr for the interface. You are not supposed to use - * it to traverse the list of addresses associated to the interface. - */ -struct ifaddr *ifaddr_byindex(u_short idx); - VNET_DECLARE(struct ifnethead, ifnet); VNET_DECLARE(struct ifgrouphead, ifg_head); VNET_DECLARE(struct ifnet *, loif); /* first loopback interface */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201281831.20SIVQZT099120>