summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-06-14 08:35:21 +0000
committerhsu <hsu@FreeBSD.org>2002-06-14 08:35:21 +0000
commitabda76de0b81d58e1eb0e275c4e384fe97cca491 (patch)
tree4544f6f0f46695f374bc2a22ee6af0eecc9a671f /sys/netinet/udp_usrreq.c
parent0c8a9db6f99a60d7dd69784a1c0e0f6d254fdcc3 (diff)
downloadFreeBSD-src-abda76de0b81d58e1eb0e275c4e384fe97cca491.zip
FreeBSD-src-abda76de0b81d58e1eb0e275c4e384fe97cca491.tar.gz
Notify functions can destroy the pcb, so they have to return an
indication of whether this happenned so the calling function knows whether or not to unlock the pcb. Submitted by: Jennifer Yang (yangjihui@yahoo.com) Bug reported by: Sid Carter (sidcarter@symonds.net)
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index dd73d77..df18c9a 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -514,7 +514,7 @@ udp_append(last, ip, n, off)
* Notify a udp user of an asynchronous error;
* just wake up so that he can collect error status.
*/
-void
+struct inpcb *
udp_notify(inp, errno)
register struct inpcb *inp;
int errno;
@@ -522,6 +522,7 @@ udp_notify(inp, errno)
inp->inp_socket->so_error = errno;
sorwakeup(inp->inp_socket);
sowwakeup(inp->inp_socket);
+ return inp;
}
void
@@ -532,7 +533,7 @@ udp_ctlinput(cmd, sa, vip)
{
struct ip *ip = vip;
struct udphdr *uh;
- void (*notify)(struct inpcb *, int) = udp_notify;
+ struct inpcb *(*notify)(struct inpcb *, int) = udp_notify;
struct in_addr faddr;
struct inpcb *inp;
int s;
OpenPOWER on IntegriCloud