svn commit: r353522 - head/sys/net

Gleb Smirnoff glebius at FreeBSD.org
Mon Oct 14 21:18:37 UTC 2019


Author: glebius
Date: Mon Oct 14 21:18:37 2019
New Revision: 353522
URL: https://svnweb.freebsd.org/changeset/base/353522

Log:
  if_delmulti() is never called without ifp argument, assert this instead
  of doing a useless search through interfaces.

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Mon Oct 14 20:55:01 2019	(r353521)
+++ head/sys/net/if.c	Mon Oct 14 21:18:37 2019	(r353522)
@@ -3614,21 +3614,8 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
 {
 	struct ifmultiaddr *ifma;
 	int lastref;
-#ifdef INVARIANTS
-	struct ifnet *oifp;
 
-	NET_EPOCH_ASSERT();
-
-	CK_STAILQ_FOREACH(oifp, &V_ifnet, if_link)
-		if (ifp == oifp)
-			break;
-	if (ifp != oifp)
-		ifp = NULL;
-
-	KASSERT(ifp != NULL, ("%s: ifnet went away", __func__));
-#endif
-	if (ifp == NULL)
-		return (ENOENT);
+	KASSERT(ifp, ("%s: NULL ifp", __func__));
 
 	IF_ADDR_WLOCK(ifp);
 	lastref = 0;


More information about the svn-src-head mailing list