Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2018 16:09:28 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337460 - in stable/11/sys: net netinet netinet6
Message-ID:  <201808081609.w78G9SnQ055998@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Aug  8 16:09:28 2018
New Revision: 337460
URL: https://svnweb.freebsd.org/changeset/base/337460

Log:
  MFC r336405:
    Move invoking of callout_stop(&lle->lle_timer) into llentry_free().
  
    This deduplicates the code a bit, and also implicitly adds missing
    callout_stop() to in[6]_lltable_delete_entry() functions.
  
    PR:		209682, 225927

Modified:
  stable/11/sys/net/if_llatbl.c
  stable/11/sys/netinet/in.c
  stable/11/sys/netinet6/in6.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/if_llatbl.c
==============================================================================
--- stable/11/sys/net/if_llatbl.c	Wed Aug  8 16:08:38 2018	(r337459)
+++ stable/11/sys/net/if_llatbl.c	Wed Aug  8 16:09:28 2018	(r337460)
@@ -429,6 +429,9 @@ llentry_free(struct llentry *lle)
 
 	pkts_dropped = lltable_drop_entry_queue(lle);
 
+	/* cancel timer */
+	if (callout_stop(&lle->lle_timer) > 0)
+		LLE_REMREF(lle);
 	LLE_FREE_LOCKED(lle);
 
 	return (pkts_dropped);
@@ -515,8 +518,6 @@ lltable_free(struct lltable *llt)
 	IF_AFDATA_WUNLOCK(llt->llt_ifp);
 
 	LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) {
-		if (callout_stop(&lle->lle_timer) > 0)
-			LLE_REMREF(lle);
 		llentry_free(lle);
 	}
 

Modified: stable/11/sys/netinet/in.c
==============================================================================
--- stable/11/sys/netinet/in.c	Wed Aug  8 16:08:38 2018	(r337459)
+++ stable/11/sys/netinet/in.c	Wed Aug  8 16:09:28 2018	(r337460)
@@ -1144,10 +1144,6 @@ in_lltable_free_entry(struct lltable *llt, struct llen
 		lltable_unlink_entry(llt, lle);
 	}
 
-	/* cancel timer */
-	if (callout_stop(&lle->lle_timer) > 0)
-		LLE_REMREF(lle);
-
 	/* Drop hold queue */
 	pkts_dropped = llentry_free(lle);
 	ARPSTAT_ADD(dropped, pkts_dropped);

Modified: stable/11/sys/netinet6/in6.c
==============================================================================
--- stable/11/sys/netinet6/in6.c	Wed Aug  8 16:08:38 2018	(r337459)
+++ stable/11/sys/netinet6/in6.c	Wed Aug  8 16:09:28 2018	(r337460)
@@ -2104,9 +2104,6 @@ in6_lltable_free_entry(struct lltable *llt, struct lle
 		lltable_unlink_entry(llt, lle);
 	}
 
-	if (callout_stop(&lle->lle_timer) > 0)
-		LLE_REMREF(lle);
-
 	llentry_free(lle);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808081609.w78G9SnQ055998>