From 32e297c1ba03abf97f07df481ce3715f9e5f305a Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 3 Dec 2011 21:41:17 +0800 Subject: [PATCH] udp: Prepare for the asynchronized pru_send Save necessary netmsg information into stack variables --- sys/netinet/udp_usrreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index d8ea10fc1a..09ffe46565 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1238,6 +1238,7 @@ static void udp_send(netmsg_t msg) { struct socket *so = msg->send.base.nm_so; + struct mbuf *m = msg->send.nm_m; struct inpcb *inp; int error; @@ -1246,15 +1247,14 @@ udp_send(netmsg_t msg) inp = so->so_pcb; if (inp) { - error = udp_output(inp, - msg->send.nm_m, - msg->send.nm_addr, - msg->send.nm_td); + struct sockaddr *addr = msg->send.nm_addr; + struct thread *td = msg->send.nm_td; + + error = udp_output(inp, m, addr, td); } else { - m_freem(msg->send.nm_m); + m_freem(m); error = EINVAL; } - msg->send.nm_m = NULL; lwkt_replymsg(&msg->send.base.lmsg, error); } -- 2.41.0