[rtems commit] libnetworking: Disconnect after mbuf shortage

Sebastian Huber sebh at rtems.org
Mon Nov 5 09:58:23 UTC 2012


Module:    rtems
Branch:    master
Commit:    8cbd90c51c8fba6ed9ef0e6006334435fdbf97f5
Changeset: http://git.rtems.org/rtems/commit/?id=8cbd90c51c8fba6ed9ef0e6006334435fdbf97f5

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov  2 14:45:50 2012 +0100

libnetworking: Disconnect after mbuf shortage

The missing disconnect left the socket in an unusable state.  Each send
request resulted in an EISCONN error.

---

 cpukit/libnetworking/netinet/udp_usrreq.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cpukit/libnetworking/netinet/udp_usrreq.c b/cpukit/libnetworking/netinet/udp_usrreq.c
index 8b56c28..e34f6c4 100644
--- a/cpukit/libnetworking/netinet/udp_usrreq.c
+++ b/cpukit/libnetworking/netinet/udp_usrreq.c
@@ -399,8 +399,11 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct mbuf *addr,
 	M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT);
 	if (m == 0) {
 		error = ENOBUFS;
-		if (addr)
+		if (addr) {
+			in_pcbdisconnect(inp);
+			inp->inp_laddr = laddr;
 			splx(s);
+		}
 		goto release;
 	}
 




More information about the vc mailing list