Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Dec 2016 09:29:22 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309404 - head/sys/netgraph
Message-ID:  <201612020929.uB29TM9v030968@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Dec  2 09:29:22 2016
New Revision: 309404
URL: https://svnweb.freebsd.org/changeset/base/309404

Log:
  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
  MFC after:		2 weeks

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==============================================================================
--- head/sys/netgraph/ng_base.c	Fri Dec  2 09:26:51 2016	(r309403)
+++ head/sys/netgraph/ng_base.c	Fri Dec  2 09:29:22 2016	(r309404)
@@ -3825,7 +3825,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);
 }
 
 /*



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