[rtems commit] libnetworking: Disconnect after mbuf shortage

Gedare Bloom gedare at rtems.org
Fri Jan 12 21:01:25 UTC 2018


Module:    rtems
Branch:    4.10
Commit:    45f9cd01f5a4e09e6c7e2223ef464bd615924b44
Changeset: http://git.rtems.org/rtems/commit/?id=45f9cd01f5a4e09e6c7e2223ef464bd615924b44

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 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cpukit/libnetworking/netinet/udp_usrreq.c b/cpukit/libnetworking/netinet/udp_usrreq.c
index f09531d..ddd3f3c 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