Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2016 09:45:23 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r310249 - stable/10/sys/netgraph
Message-ID:  <201612190945.uBJ9jNZ5086587@repo.freebsd.org>

index | next in thread | raw e-mail

Author: hselasky
Date: Mon Dec 19 09:45:23 2016
New Revision: 310249
URL: https://svnweb.freebsd.org/changeset/base/310249

Log:
  MFC r309404:
  Fix return value from ng_uncallout().
  
  callout_stop() recently started returning -1 when the callout is already
  stopped, which is not handled by the netgraph code. Properly filter
  the return value. Netgraph callers only want to know if the callout
  was cancelled and not draining or already stopped.
  
  Discussed with:		julian, glebius

Modified:
  stable/10/sys/netgraph/ng_base.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netgraph/ng_base.c
==============================================================================
--- stable/10/sys/netgraph/ng_base.c	Mon Dec 19 09:44:14 2016	(r310248)
+++ stable/10/sys/netgraph/ng_base.c	Mon Dec 19 09:45:23 2016	(r310249)
@@ -3823,7 +3823,11 @@ ng_uncallout(struct callout *c, node_p n
 	}
 	c->c_arg = NULL;
 
-	return (rval);
+	/*
+	 * Callers only want to know if the callout was cancelled and
+	 * not draining or stopped.
+	 */
+	return (rval > 0);
 }
 
 /*


help

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