diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-21 17:38:48 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-21 17:38:48 +0000 |
commit | 56ad5a3d5e2da4f2c312a20ace62e0e24ad77d9e (patch) | |
tree | c6363f567c44d91f1f8a1b03278cb8f68051ce8c /sys/netinet6/in6_pcb.c | |
parent | 51b320a56b1066f625fa565d54a28268409b94fe (diff) | |
download | FreeBSD-src-56ad5a3d5e2da4f2c312a20ace62e0e24ad77d9e.zip FreeBSD-src-56ad5a3d5e2da4f2c312a20ace62e0e24ad77d9e.tar.gz |
When notifying protocol components of an event on an in6pcb, use the
result of the notify() function to decide if we need to unlock the
in6pcb or not, rather than always unlocking. Otherwise, we may unlock
and already unlocked in6pcb.
Reported by: kuriyama, Gordon Bergling <gbergling at 0xfce3.net>
Tested by: kuriyama, Gordon Bergling <gbergling at 0xfce3.net>
Discussed with: mdodd
Diffstat (limited to 'sys/netinet6/in6_pcb.c')
-rw-r--r-- | sys/netinet6/in6_pcb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 7639919..9bcbeb8 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -705,9 +705,11 @@ in6_pcbnotify(pcbinfo, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify) } do_notify: - if (notify) - (*notify)(inp, errno); - INP_UNLOCK(inp); + if (notify) { + if ((*notify)(inp, errno)) + INP_UNLOCK(inp); + } else + INP_UNLOCK(inp); } INP_INFO_WUNLOCK(pcbinfo); splx(s); |