diff options
author | glebius <glebius@FreeBSD.org> | 2005-09-12 14:11:11 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-09-12 14:11:11 +0000 |
commit | 67f869b35c78233ce7694ce8717ed2ab1f6bcf6f (patch) | |
tree | 99a0c883d19e41e7e50533da39c5f4f1d28d9ae4 /sys/netgraph/ng_socket.c | |
parent | 9bf49882e6532cd409f8a136845e90d4694426dc (diff) | |
download | FreeBSD-src-67f869b35c78233ce7694ce8717ed2ab1f6bcf6f.zip FreeBSD-src-67f869b35c78233ce7694ce8717ed2ab1f6bcf6f.tar.gz |
When message can't fit into socket receive buffer return ENOBUFS
to userland program instead of letting it wait until end of days.
PR: kern/85907
Diffstat (limited to 'sys/netgraph/ng_socket.c')
-rw-r--r-- | sys/netgraph/ng_socket.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c index dd39259..2326aa3 100644 --- a/sys/netgraph/ng_socket.c +++ b/sys/netgraph/ng_socket.c @@ -814,6 +814,7 @@ ship_msg(struct ngpcb *pcbp, struct ng_mesg *msg, struct sockaddr_ng *addr) struct socket *const so = pcbp->ng_socket; struct mbuf *mdata; int msglen; + int error = 0; /* Copy the message itself into an mbuf chain */ msglen = sizeof(struct ng_mesg) + msg->header.arglen; @@ -833,10 +834,10 @@ ship_msg(struct ngpcb *pcbp, struct ng_mesg *msg, struct sockaddr_ng *addr) (struct sockaddr *) addr, mdata, NULL) == 0) { TRAP_ERROR; m_freem(mdata); - return (ENOBUFS); + error = so->so_error = ENOBUFS; } sorwakeup(so); - return (0); + return (error); } /*************************************************************** |