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);
 }
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to