* Remove the remains of the obsolete timeout()/untimeout() interface.
[dragonfly.git] / sys / kern / uipc_msg.c
blobaab2fe07747d8cc670eee8473b47fc5e448baa09
1 /*
2 * Copyright (c) 2003, 2004 Jeffrey M. Hsu. All rights reserved.
3 * Copyright (c) 2003, 2004 The DragonFly Project. All rights reserved.
4 *
5 * This code is derived from software contributed to The DragonFly Project
6 * by Jeffrey M. Hsu.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of The DragonFly Project nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific, prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
33 * $DragonFly: src/sys/kern/uipc_msg.c,v 1.19 2007/07/04 23:36:26 dillon Exp $
36 #include <sys/param.h>
37 #include <sys/systm.h>
38 #include <sys/msgport.h>
39 #include <sys/protosw.h>
40 #include <sys/socket.h>
41 #include <sys/socketvar.h>
42 #include <sys/socketops.h>
43 #include <sys/thread.h>
44 #include <sys/thread2.h>
45 #include <sys/msgport2.h>
46 #include <net/netmsg2.h>
48 #include <net/netisr.h>
49 #include <net/netmsg.h>
51 int
52 so_pru_abort(struct socket *so)
54 int error;
55 struct netmsg_pru_abort msg;
56 lwkt_port_t port;
58 port = so->so_proto->pr_mport(so, NULL, PRU_ABORT);
59 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
60 netmsg_pru_abort);
61 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_abort;
62 msg.nm_so = so;
63 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
64 return (error);
67 int
68 so_pru_accept(struct socket *so, struct sockaddr **nam)
70 /* Block (memory allocation) in process context. XXX JH */
71 return ((*so->so_proto->pr_usrreqs->pru_accept)(so, nam));
73 #ifdef notdef
74 int error;
75 struct netmsg_pru_accept msg;
76 lwkt_port_t port;
78 port = so->so_proto->pr_mport(so, NULL, PRU_ACCEPT);
79 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
80 netmsg_pru_accept);
81 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_accept;
82 msg.nm_so = so;
83 msg.nm_nam = nam;
84 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
85 return (error);
86 #endif
89 int
90 so_pru_attach(struct socket *so, int proto, struct pru_attach_info *ai)
92 int error;
93 struct netmsg_pru_attach msg;
94 lwkt_port_t port;
96 port = so->so_proto->pr_mport(NULL, NULL, PRU_ATTACH);
97 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
98 netmsg_pru_attach);
99 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_attach;
100 msg.nm_so = so;
101 msg.nm_proto = proto;
102 msg.nm_ai = ai;
103 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
104 return (error);
108 so_pru_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
110 int error;
111 struct netmsg_pru_bind msg;
112 lwkt_port_t port;
114 /* Send mesg to thread for new address. */
115 port = so->so_proto->pr_mport(NULL, nam, PRU_BIND);
116 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
117 netmsg_pru_bind);
118 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_bind;
119 msg.nm_so = so;
120 msg.nm_nam = nam;
121 msg.nm_td = td; /* used only for prison_ip() XXX JH */
122 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
123 return (error);
127 so_pru_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
129 int error;
130 struct netmsg_pru_connect msg;
131 lwkt_port_t port;
133 port = so->so_proto->pr_mport(so, nam, PRU_CONNECT);
134 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
135 netmsg_pru_connect);
136 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_connect;
137 msg.nm_so = so;
138 msg.nm_nam = nam;
139 msg.nm_td = td;
140 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
141 return (error);
145 so_pru_connect2(struct socket *so1, struct socket *so2)
147 int error;
148 struct netmsg_pru_connect2 msg;
149 lwkt_port_t port;
151 port = so1->so_proto->pr_mport(so1, NULL, PRU_CONNECT2);
152 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
153 netmsg_pru_connect2);
154 msg.nm_prufn = so1->so_proto->pr_usrreqs->pru_connect2;
155 msg.nm_so1 = so1;
156 msg.nm_so2 = so2;
157 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
158 return (error);
162 so_pru_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
164 return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd, data, ifp,
165 curthread));
166 #ifdef gag /* does copyin and copyout deep inside stack XXX JH */
167 int error;
168 struct netmsg_pru_control msg;
169 lwkt_port_t port;
171 port = so->so_proto->pr_mport(so, NULL, PRU_CONTROL);
172 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
173 netmsg_pru_control);
174 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_control;
175 msg.nm_so = so;
176 msg.nm_cmd = cmd;
177 msg.nm_data = data;
178 msg.nm_ifp = ifp;
179 msg.nm_td = td;
180 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
181 return (error);
182 #endif
186 so_pru_detach(struct socket *so)
188 int error;
189 struct netmsg_pru_detach msg;
190 lwkt_port_t port;
192 port = so->so_proto->pr_mport(so, NULL, PRU_DETACH);
193 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
194 netmsg_pru_detach);
195 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_detach;
196 msg.nm_so = so;
197 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
198 return (error);
202 so_pru_disconnect(struct socket *so)
204 int error;
205 struct netmsg_pru_disconnect msg;
206 lwkt_port_t port;
208 port = so->so_proto->pr_mport(so, NULL, PRU_DISCONNECT);
209 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
210 netmsg_pru_disconnect);
211 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_disconnect;
212 msg.nm_so = so;
213 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
214 return (error);
218 so_pru_listen(struct socket *so, struct thread *td)
220 int error;
221 struct netmsg_pru_listen msg;
222 lwkt_port_t port;
224 port = so->so_proto->pr_mport(so, NULL, PRU_LISTEN);
225 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
226 netmsg_pru_listen);
227 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_listen;
228 msg.nm_so = so;
229 msg.nm_td = td; /* used only for prison_ip() XXX JH */
230 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
231 return (error);
235 so_pru_peeraddr(struct socket *so, struct sockaddr **nam)
237 int error;
238 struct netmsg_pru_peeraddr msg;
239 lwkt_port_t port;
241 port = so->so_proto->pr_mport(so, NULL, PRU_PEERADDR);
242 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
243 netmsg_pru_peeraddr);
244 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_peeraddr;
245 msg.nm_so = so;
246 msg.nm_nam = nam;
247 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
248 return (error);
252 so_pru_rcvd(struct socket *so, int flags)
254 int error;
255 struct netmsg_pru_rcvd msg;
256 lwkt_port_t port;
258 port = so->so_proto->pr_mport(so, NULL, PRU_RCVD);
259 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
260 netmsg_pru_rcvd);
261 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_rcvd;
262 msg.nm_so = so;
263 msg.nm_flags = flags;
264 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
265 return (error);
269 so_pru_rcvoob(struct socket *so, struct mbuf *m, int flags)
271 int error;
272 struct netmsg_pru_rcvoob msg;
273 lwkt_port_t port;
275 port = so->so_proto->pr_mport(so, NULL, PRU_RCVOOB);
276 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
277 netmsg_pru_rcvoob);
278 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_rcvoob;
279 msg.nm_so = so;
280 msg.nm_m = m;
281 msg.nm_flags = flags;
282 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
283 return (error);
287 so_pru_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
288 struct mbuf *control, struct thread *td)
290 int error;
291 struct netmsg_pru_send msg;
292 lwkt_port_t port;
294 port = so->so_proto->pr_mport(so, NULL, PRU_SEND);
295 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
296 netmsg_pru_send);
297 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_send;
298 msg.nm_so = so;
299 msg.nm_flags = flags;
300 msg.nm_m = m;
301 msg.nm_addr = addr;
302 msg.nm_control = control;
303 msg.nm_td = td;
304 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
305 return (error);
309 so_pru_sense(struct socket *so, struct stat *sb)
311 int error;
312 struct netmsg_pru_sense msg;
313 lwkt_port_t port;
315 port = so->so_proto->pr_mport(so, NULL, PRU_SENSE);
316 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
317 netmsg_pru_sense);
318 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_sense;
319 msg.nm_so = so;
320 msg.nm_stat = sb;
321 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
322 return (error);
326 so_pru_shutdown(struct socket *so)
328 int error;
329 struct netmsg_pru_shutdown msg;
330 lwkt_port_t port;
332 port = so->so_proto->pr_mport(so, NULL, PRU_SHUTDOWN);
333 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
334 netmsg_pru_shutdown);
335 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_shutdown;
336 msg.nm_so = so;
337 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
338 return (error);
342 so_pru_sockaddr(struct socket *so, struct sockaddr **nam)
344 int error;
345 struct netmsg_pru_sockaddr msg;
346 lwkt_port_t port;
348 port = so->so_proto->pr_mport(so, NULL, PRU_SOCKADDR);
349 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
350 netmsg_pru_sockaddr);
351 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_sockaddr;
352 msg.nm_so = so;
353 msg.nm_nam = nam;
354 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
355 return (error);
359 so_pru_sopoll(struct socket *so, int events, struct ucred *cred)
361 int error;
362 struct netmsg_pru_sopoll msg;
363 lwkt_port_t port;
365 port = so->so_proto->pr_mport(so, NULL, PRU_SOPOLL);
366 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
367 netmsg_pru_sopoll);
368 msg.nm_prufn = so->so_proto->pr_usrreqs->pru_sopoll;
369 msg.nm_so = so;
370 msg.nm_events = events;
371 msg.nm_cred = cred;
372 msg.nm_td = curthread;
373 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
374 return (error);
378 so_pr_ctloutput(struct socket *so, struct sockopt *sopt)
380 return ((*so->so_proto->pr_ctloutput)(so, sopt));
381 #ifdef gag /* does copyin and copyout deep inside stack XXX JH */
382 struct netmsg_pr_ctloutput msg;
383 lwkt_port_t port;
384 int error;
386 port = so->so_proto->pr_mport(so, NULL);
387 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
388 netmsg_pru_ctloutput);
389 msg.nm_prfn = so->so_proto->pr_ctloutput;
390 msg.nm_so = so;
391 msg.nm_sopt = sopt;
392 error = lwkt_domsg(port, &msg.nm_netmsg.nm_lmsg, 0);
393 return (error);
394 #endif
398 * If we convert all the protosw pr_ functions for all the protocols
399 * to take a message directly, this layer can go away. For the moment
400 * our dispatcher ignores the return value, but since we are handling
401 * the replymsg ourselves we return EASYNC by convention.
403 void
404 netmsg_pru_abort(netmsg_t msg)
406 struct netmsg_pru_abort *nm = (void *)msg;
408 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so));
411 #ifdef notused
412 void
413 netmsg_pru_accept(netmsg_t msg)
415 struct netmsg_pru_accept *nm = (void *)msg;
417 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_nam));
419 #endif
421 void
422 netmsg_pru_attach(netmsg_t msg)
424 struct netmsg_pru_attach *nm = (void *)msg;
426 lwkt_replymsg(&msg->nm_lmsg,
427 nm->nm_prufn(nm->nm_so, nm->nm_proto, nm->nm_ai));
430 void
431 netmsg_pru_bind(netmsg_t msg)
433 struct netmsg_pru_bind *nm = (void *)msg;
435 lwkt_replymsg(&msg->nm_lmsg,
436 nm->nm_prufn(nm->nm_so, nm->nm_nam, nm->nm_td));
439 void
440 netmsg_pru_connect(netmsg_t msg)
442 struct netmsg_pru_connect *nm = (void *)msg;
444 lwkt_replymsg(&msg->nm_lmsg,
445 nm->nm_prufn(nm->nm_so, nm->nm_nam, nm->nm_td));
448 void
449 netmsg_pru_connect2(netmsg_t msg)
451 struct netmsg_pru_connect2 *nm = (void *)msg;
453 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so1, nm->nm_so2));
456 void
457 netmsg_pru_control(netmsg_t msg)
459 struct netmsg_pru_control *nm = (void *)msg;
460 int error;
462 error = nm->nm_prufn(nm->nm_so, nm->nm_cmd, nm->nm_data,
463 nm->nm_ifp, nm->nm_td);
464 lwkt_replymsg(&msg->nm_lmsg, error);
467 void
468 netmsg_pru_detach(netmsg_t msg)
470 struct netmsg_pru_detach *nm = (void *)msg;
472 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so));
475 void
476 netmsg_pru_disconnect(netmsg_t msg)
478 struct netmsg_pru_disconnect *nm = (void *)msg;
480 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so));
483 void
484 netmsg_pru_listen(netmsg_t msg)
486 struct netmsg_pru_listen *nm = (void *)msg;
488 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_td));
491 void
492 netmsg_pru_peeraddr(netmsg_t msg)
494 struct netmsg_pru_peeraddr *nm = (void *)msg;
496 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_nam));
499 void
500 netmsg_pru_rcvd(netmsg_t msg)
502 struct netmsg_pru_rcvd *nm = (void *)msg;
504 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_flags));
507 void
508 netmsg_pru_rcvoob(netmsg_t msg)
510 struct netmsg_pru_rcvoob *nm = (void *)msg;
512 lwkt_replymsg(&msg->nm_lmsg,
513 nm->nm_prufn(nm->nm_so, nm->nm_m, nm->nm_flags));
516 void
517 netmsg_pru_send(netmsg_t msg)
519 struct netmsg_pru_send *nm = (void *)msg;
520 int error;
522 error = nm->nm_prufn(nm->nm_so, nm->nm_flags, nm->nm_m,
523 nm->nm_addr, nm->nm_control, nm->nm_td);
524 lwkt_replymsg(&msg->nm_lmsg, error);
527 void
528 netmsg_pru_sense(netmsg_t msg)
530 struct netmsg_pru_sense *nm = (void *)msg;
532 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_stat));
535 void
536 netmsg_pru_shutdown(netmsg_t msg)
538 struct netmsg_pru_shutdown *nm = (void *)msg;
540 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so));
543 void
544 netmsg_pru_sockaddr(netmsg_t msg)
546 struct netmsg_pru_sockaddr *nm = (void *)msg;
548 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prufn(nm->nm_so, nm->nm_nam));
551 void
552 netmsg_pru_sopoll(netmsg_t msg)
554 struct netmsg_pru_sopoll *nm = (void *)msg;
555 int error;
557 error = nm->nm_prufn(nm->nm_so, nm->nm_events, nm->nm_cred, nm->nm_td);
558 lwkt_replymsg(&msg->nm_lmsg, error);
561 void
562 netmsg_pr_ctloutput(netmsg_t msg)
564 struct netmsg_pr_ctloutput *nm = (void *)msg;
566 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prfn(nm->nm_so, nm->nm_sopt));
569 void
570 netmsg_pr_timeout(netmsg_t msg)
572 struct netmsg_pr_timeout *nm = (void *)msg;
574 lwkt_replymsg(&msg->nm_lmsg, nm->nm_prfn());
578 * Handle a predicate event request. This function is only called once
579 * when the predicate message queueing request is received.
581 void
582 netmsg_so_notify(netmsg_t netmsg)
584 struct netmsg_so_notify *msg = (void *)netmsg;
585 struct signalsockbuf *ssb;
587 ssb = (msg->nm_etype & NM_REVENT) ?
588 &msg->nm_so->so_rcv :
589 &msg->nm_so->so_snd;
592 * Reply immediately if the event has occured, otherwise queue the
593 * request.
595 if (msg->nm_predicate(&msg->nm_netmsg)) {
596 lwkt_replymsg(&msg->nm_netmsg.nm_lmsg,
597 msg->nm_netmsg.nm_lmsg.ms_error);
598 } else {
599 TAILQ_INSERT_TAIL(&ssb->ssb_sel.si_mlist, msg, nm_list);
600 ssb->ssb_flags |= SSB_MEVENT;
605 * Called by doio when trying to abort a netmsg_so_notify message.
606 * Unlike the other functions this one is dispatched directly by
607 * the LWKT subsystem, so it takes a lwkt_msg_t as an argument.
609 * The original message, lmsg, is under the control of the caller and
610 * will not be destroyed until we return so we can safely reference it
611 * in our synchronous abort request.
613 * This part of the abort request occurs on the originating cpu which
614 * means we may race the message flags and the original message may
615 * not even have been processed by the target cpu yet.
617 void
618 netmsg_so_notify_doabort(lwkt_msg_t lmsg)
620 struct netmsg_so_notify_abort msg;
622 if ((lmsg->ms_flags & (MSGF_DONE | MSGF_REPLY)) == 0) {
623 netmsg_init(&msg.nm_netmsg, &curthread->td_msgport, 0,
624 netmsg_so_notify_abort);
625 msg.nm_notifymsg = (void *)lmsg;
626 lwkt_domsg(lmsg->ms_target_port, &msg.nm_netmsg.nm_lmsg, 0);
631 * Predicate requests can be aborted. This function is only called once
632 * and will interlock against processing/reply races (since such races
633 * occur on the same thread that controls the port where the abort is
634 * requeued).
636 * This part of the abort request occurs on the target cpu. The message
637 * flags must be tested again in case the test that we did on the
638 * originating cpu raced. Since messages are handled in sequence, the
639 * original message will have already been handled by the loop and either
640 * replied to or queued.
642 * We really only need to interlock with MSGF_REPLY (a bit that is set on
643 * our cpu when we reply). Note that MSGF_DONE is not set until the
644 * reply reaches the originating cpu. Test both bits anyway.
646 void
647 netmsg_so_notify_abort(netmsg_t netmsg)
649 struct netmsg_so_notify_abort *abrtmsg = (void *)netmsg;
650 struct netmsg_so_notify *msg = abrtmsg->nm_notifymsg;
651 struct signalsockbuf *ssb;
654 * The original notify message is not destroyed until after the
655 * abort request is returned, so we can check its state.
657 if ((msg->nm_netmsg.nm_lmsg.ms_flags & (MSGF_DONE | MSGF_REPLY)) == 0) {
658 ssb = (msg->nm_etype & NM_REVENT) ?
659 &msg->nm_so->so_rcv :
660 &msg->nm_so->so_snd;
661 TAILQ_REMOVE(&ssb->ssb_sel.si_mlist, msg, nm_list);
662 lwkt_replymsg(&msg->nm_netmsg.nm_lmsg, EINTR);
666 * Reply to the abort message
668 lwkt_replymsg(&abrtmsg->nm_netmsg.nm_lmsg, 0);