sockin.c revision 1.56 1 /* $NetBSD: sockin.c,v 1.56 2014/08/05 07:55:32 rtr Exp $ */
2
3 /*
4 * Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28 #include <sys/cdefs.h>
29 __KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.56 2014/08/05 07:55:32 rtr Exp $");
30
31 #include <sys/param.h>
32 #include <sys/condvar.h>
33 #include <sys/domain.h>
34 #include <sys/kmem.h>
35 #include <sys/kthread.h>
36 #include <sys/mbuf.h>
37 #include <sys/mutex.h>
38 #include <sys/once.h>
39 #include <sys/poll.h>
40 #include <sys/protosw.h>
41 #include <sys/queue.h>
42 #include <sys/socket.h>
43 #include <sys/socketvar.h>
44 #include <sys/time.h>
45
46 #include <net/bpf.h>
47 #include <net/if.h>
48 #include <net/radix.h>
49
50 #include <netinet/in.h>
51 #include <netinet/in_systm.h>
52 #include <netinet/ip.h>
53
54 #include <rump/rumpuser.h>
55
56 #include "rump_private.h"
57 #include "sockin_user.h"
58
59 /*
60 * An inet communication domain which uses the socket interface.
61 * Supports IPv4 & IPv6 UDP/TCP.
62 */
63
64 DOMAIN_DEFINE(sockindomain);
65 DOMAIN_DEFINE(sockin6domain);
66
67 static int sockin_do_init(void);
68 static void sockin_init(void);
69 static int sockin_attach(struct socket *, int);
70 static void sockin_detach(struct socket *);
71 static int sockin_accept(struct socket *, struct mbuf *);
72 static int sockin_bind(struct socket *, struct mbuf *, struct lwp *);
73 static int sockin_listen(struct socket *, struct lwp *);
74 static int sockin_connect(struct socket *, struct mbuf *, struct lwp *);
75 static int sockin_disconnect(struct socket *);
76 static int sockin_shutdown(struct socket *);
77 static int sockin_abort(struct socket *);
78 static int sockin_ioctl(struct socket *, u_long, void *, struct ifnet *);
79 static int sockin_stat(struct socket *, struct stat *);
80 static int sockin_peeraddr(struct socket *, struct mbuf *);
81 static int sockin_sockaddr(struct socket *, struct mbuf *);
82 static int sockin_recvoob(struct socket *, struct mbuf *, int);
83 static int sockin_send(struct socket *, struct mbuf *, struct mbuf *,
84 struct mbuf *, struct lwp *);
85 static int sockin_sendoob(struct socket *, struct mbuf *, struct mbuf *);
86 static int sockin_usrreq(struct socket *, int, struct mbuf *,
87 struct mbuf *, struct mbuf *, struct lwp *);
88 static int sockin_ctloutput(int op, struct socket *, struct sockopt *);
89
90 static const struct pr_usrreqs sockin_usrreqs = {
91 .pr_attach = sockin_attach,
92 .pr_detach = sockin_detach,
93 .pr_accept = sockin_accept,
94 .pr_bind = sockin_bind,
95 .pr_listen = sockin_listen,
96 .pr_connect = sockin_connect,
97 .pr_disconnect = sockin_disconnect,
98 .pr_shutdown = sockin_shutdown,
99 .pr_abort = sockin_abort,
100 .pr_ioctl = sockin_ioctl,
101 .pr_stat = sockin_stat,
102 .pr_peeraddr = sockin_peeraddr,
103 .pr_sockaddr = sockin_sockaddr,
104 .pr_recvoob = sockin_recvoob,
105 .pr_send = sockin_send,
106 .pr_sendoob = sockin_sendoob,
107 .pr_generic = sockin_usrreq,
108 };
109
110 const struct protosw sockinsw[] = {
111 {
112 .pr_type = SOCK_DGRAM,
113 .pr_domain = &sockindomain,
114 .pr_protocol = IPPROTO_UDP,
115 .pr_flags = PR_ATOMIC|PR_ADDR,
116 .pr_usrreqs = &sockin_usrreqs,
117 .pr_ctloutput = sockin_ctloutput,
118 },
119 {
120 .pr_type = SOCK_STREAM,
121 .pr_domain = &sockindomain,
122 .pr_protocol = IPPROTO_TCP,
123 .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
124 .pr_usrreqs = &sockin_usrreqs,
125 .pr_ctloutput = sockin_ctloutput,
126 }};
127 const struct protosw sockin6sw[] = {
128 {
129 .pr_type = SOCK_DGRAM,
130 .pr_domain = &sockin6domain,
131 .pr_protocol = IPPROTO_UDP,
132 .pr_flags = PR_ATOMIC|PR_ADDR,
133 .pr_usrreqs = &sockin_usrreqs,
134 .pr_ctloutput = sockin_ctloutput,
135 },
136 {
137 .pr_type = SOCK_STREAM,
138 .pr_domain = &sockin6domain,
139 .pr_protocol = IPPROTO_TCP,
140 .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
141 .pr_usrreqs = &sockin_usrreqs,
142 .pr_ctloutput = sockin_ctloutput,
143 }};
144
145 struct domain sockindomain = {
146 .dom_family = PF_INET,
147 .dom_name = "socket_inet",
148 .dom_init = sockin_init,
149 .dom_externalize = NULL,
150 .dom_dispose = NULL,
151 .dom_protosw = sockinsw,
152 .dom_protoswNPROTOSW = &sockinsw[__arraycount(sockinsw)],
153 .dom_rtattach = rt_inithead,
154 .dom_rtoffset = 32,
155 .dom_maxrtkey = sizeof(struct sockaddr_in),
156 .dom_ifattach = NULL,
157 .dom_ifdetach = NULL,
158 .dom_ifqueues = { NULL },
159 .dom_link = { NULL },
160 .dom_mowner = MOWNER_INIT("",""),
161 .dom_rtcache = { NULL },
162 .dom_sockaddr_cmp = NULL
163 };
164 struct domain sockin6domain = {
165 .dom_family = PF_INET6,
166 .dom_name = "socket_inet6",
167 .dom_init = sockin_init,
168 .dom_externalize = NULL,
169 .dom_dispose = NULL,
170 .dom_protosw = sockin6sw,
171 .dom_protoswNPROTOSW = &sockin6sw[__arraycount(sockin6sw)],
172 .dom_rtattach = rt_inithead,
173 .dom_rtoffset = 32,
174 .dom_maxrtkey = sizeof(struct sockaddr_in6),
175 .dom_ifattach = NULL,
176 .dom_ifdetach = NULL,
177 .dom_ifqueues = { NULL },
178 .dom_link = { NULL },
179 .dom_mowner = MOWNER_INIT("",""),
180 .dom_rtcache = { NULL },
181 .dom_sockaddr_cmp = NULL
182 };
183
184 #define SO2S(so) ((intptr_t)(so->so_internal))
185 #define SOCKIN_SBSIZE 65536
186
187 struct sockin_unit {
188 struct socket *su_so;
189
190 LIST_ENTRY(sockin_unit) su_entries;
191 };
192 static LIST_HEAD(, sockin_unit) su_ent = LIST_HEAD_INITIALIZER(su_ent);
193 static kmutex_t su_mtx;
194 static bool rebuild;
195 static int nsock;
196
197 /* XXX: for the bpf hack */
198 static struct ifnet sockin_if;
199 int ifpromisc(struct ifnet *ifp, int pswitch) { return 0; }
200
201 static int
202 registersock(struct socket *so, int news)
203 {
204 struct sockin_unit *su;
205
206 su = kmem_alloc(sizeof(*su), KM_NOSLEEP);
207 if (!su)
208 return ENOMEM;
209
210 so->so_internal = (void *)(intptr_t)news;
211 su->su_so = so;
212
213 mutex_enter(&su_mtx);
214 LIST_INSERT_HEAD(&su_ent, su, su_entries);
215 nsock++;
216 rebuild = true;
217 mutex_exit(&su_mtx);
218
219 return 0;
220 }
221
222 static void
223 removesock(struct socket *so)
224 {
225 struct sockin_unit *su_iter;
226
227 mutex_enter(&su_mtx);
228 LIST_FOREACH(su_iter, &su_ent, su_entries) {
229 if (su_iter->su_so == so)
230 break;
231 }
232 if (!su_iter)
233 panic("no such socket");
234
235 LIST_REMOVE(su_iter, su_entries);
236 nsock--;
237 rebuild = true;
238 mutex_exit(&su_mtx);
239
240 rumpuser_close(SO2S(su_iter->su_so));
241 kmem_free(su_iter, sizeof(*su_iter));
242 }
243
244 static void
245 sockin_process(struct socket *so)
246 {
247 struct sockaddr_in6 from;
248 struct iovec io;
249 struct msghdr rmsg;
250 struct mbuf *m;
251 size_t n, plen;
252 int error;
253
254 m = m_gethdr(M_WAIT, MT_DATA);
255 if (so->so_proto->pr_type == SOCK_DGRAM) {
256 plen = IP_MAXPACKET;
257 MEXTMALLOC(m, plen, M_DONTWAIT);
258 } else {
259 plen = MCLBYTES;
260 MCLGET(m, M_DONTWAIT);
261 }
262 if ((m->m_flags & M_EXT) == 0) {
263 m_freem(m);
264 return;
265 }
266
267 memset(&rmsg, 0, sizeof(rmsg));
268 io.iov_base = mtod(m, void *);
269 io.iov_len = plen;
270 rmsg.msg_iov = &io;
271 rmsg.msg_iovlen = 1;
272 rmsg.msg_name = (struct sockaddr *)&from;
273 rmsg.msg_namelen = sizeof(from);
274
275 error = rumpcomp_sockin_recvmsg(SO2S(so), &rmsg, 0, &n);
276 if (error || n == 0) {
277 m_freem(m);
278
279 /* Treat a TCP socket a goner */
280 if (error != EAGAIN && so->so_proto->pr_type == SOCK_STREAM) {
281 mutex_enter(softnet_lock);
282 soisdisconnected(so);
283 mutex_exit(softnet_lock);
284 removesock(so);
285 }
286 return;
287 }
288 m->m_len = m->m_pkthdr.len = n;
289
290 bpf_mtap_af(&sockin_if, AF_UNSPEC, m);
291
292 mutex_enter(softnet_lock);
293 if (so->so_proto->pr_type == SOCK_DGRAM) {
294 if (!sbappendaddr(&so->so_rcv, rmsg.msg_name, m, NULL)) {
295 m_freem(m);
296 }
297 } else {
298 sbappendstream(&so->so_rcv, m);
299 }
300
301 sorwakeup(so);
302 mutex_exit(softnet_lock);
303 }
304
305 static void
306 sockin_waccept(struct socket *so)
307 {
308 struct socket *nso;
309 struct sockaddr_in6 sin;
310 int news, error, slen;
311
312 slen = sizeof(sin);
313 error = rumpcomp_sockin_accept(SO2S(so), (struct sockaddr *)&sin,
314 &slen, &news);
315 if (error)
316 return;
317
318 mutex_enter(softnet_lock);
319 nso = sonewconn(so, true);
320 if (nso == NULL)
321 goto errout;
322 if (registersock(nso, news) != 0)
323 goto errout;
324 mutex_exit(softnet_lock);
325 return;
326
327 errout:
328 rumpuser_close(news);
329 if (nso)
330 soclose(nso);
331 mutex_exit(softnet_lock);
332 }
333
334 #define POLLTIMEOUT 100 /* check for new entries every 100ms */
335
336 /* XXX: doesn't handle socket (kernel) locking properly? */
337 static void
338 sockinworker(void *arg)
339 {
340 struct pollfd *pfds = NULL, *npfds;
341 struct sockin_unit *su_iter;
342 struct socket *so;
343 int cursock = 0, i, rv, error;
344
345 /*
346 * Loop reading requests. Check for new sockets periodically
347 * (could be smarter, but I'm lazy).
348 */
349 for (;;) {
350 if (rebuild) {
351 npfds = NULL;
352 mutex_enter(&su_mtx);
353 if (nsock)
354 npfds = kmem_alloc(nsock * sizeof(*npfds),
355 KM_NOSLEEP);
356 if (npfds || nsock == 0) {
357 if (pfds)
358 kmem_free(pfds, cursock*sizeof(*pfds));
359 pfds = npfds;
360 cursock = nsock;
361 rebuild = false;
362
363 i = 0;
364 LIST_FOREACH(su_iter, &su_ent, su_entries) {
365 pfds[i].fd = SO2S(su_iter->su_so);
366 pfds[i].events = POLLIN;
367 pfds[i].revents = 0;
368 i++;
369 }
370 KASSERT(i == nsock);
371 }
372 mutex_exit(&su_mtx);
373 }
374
375 /* find affected sockets & process */
376 error = rumpcomp_sockin_poll(pfds, cursock, POLLTIMEOUT, &rv);
377 for (i = 0; i < cursock && rv > 0 && error == 0; i++) {
378 if (pfds[i].revents & POLLIN) {
379 mutex_enter(&su_mtx);
380 LIST_FOREACH(su_iter, &su_ent, su_entries) {
381 if (SO2S(su_iter->su_so)==pfds[i].fd) {
382 so = su_iter->su_so;
383 mutex_exit(&su_mtx);
384 if(so->so_options&SO_ACCEPTCONN)
385 sockin_waccept(so);
386 else
387 sockin_process(so);
388 mutex_enter(&su_mtx);
389 break;
390 }
391 }
392 /* if we can't find it, just wing it */
393 KASSERT(rebuild || su_iter);
394 mutex_exit(&su_mtx);
395 pfds[i].revents = 0;
396 rv--;
397 i = -1;
398 continue;
399 }
400
401 /* something else? ignore */
402 if (pfds[i].revents) {
403 pfds[i].revents = 0;
404 rv--;
405 }
406 }
407 KASSERT(rv <= 0);
408 }
409
410 }
411
412 static int
413 sockin_do_init(void)
414 {
415 int rv;
416
417 if (rump_threads) {
418 if ((rv = kthread_create(PRI_NONE, 0, NULL, sockinworker,
419 NULL, NULL, "sockwork")) != 0)
420 panic("sockin_init: could not create worker thread\n");
421 } else {
422 printf("sockin_init: no threads => no worker thread\n");
423 }
424 mutex_init(&su_mtx, MUTEX_DEFAULT, IPL_NONE);
425 strlcpy(sockin_if.if_xname, "sockin0", sizeof(sockin_if.if_xname));
426 bpf_attach(&sockin_if, DLT_NULL, 0);
427 return 0;
428 }
429
430 static void
431 sockin_init(void)
432 {
433 static ONCE_DECL(init);
434
435 RUN_ONCE(&init, sockin_do_init);
436 }
437
438 static int
439 sockin_attach(struct socket *so, int proto)
440 {
441 const int type = so->so_proto->pr_type;
442 int error, news, family;
443
444 sosetlock(so);
445 if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
446 error = soreserve(so, SOCKIN_SBSIZE, SOCKIN_SBSIZE);
447 if (error)
448 return error;
449 }
450
451 family = so->so_proto->pr_domain->dom_family;
452 KASSERT(family == PF_INET || family == PF_INET6);
453 error = rumpcomp_sockin_socket(family, type, 0, &news);
454 if (error)
455 return error;
456
457 /* For UDP sockets, make sure we can send/recv maximum. */
458 if (type == SOCK_DGRAM) {
459 int sbsize = SOCKIN_SBSIZE;
460 error = rumpcomp_sockin_setsockopt(news,
461 SOL_SOCKET, SO_SNDBUF,
462 &sbsize, sizeof(sbsize));
463 sbsize = SOCKIN_SBSIZE;
464 error = rumpcomp_sockin_setsockopt(news,
465 SOL_SOCKET, SO_RCVBUF,
466 &sbsize, sizeof(sbsize));
467 }
468
469 if ((error = registersock(so, news)) != 0)
470 rumpuser_close(news);
471
472 return error;
473 }
474
475 static void
476 sockin_detach(struct socket *so)
477 {
478 panic("sockin_detach: IMPLEMENT ME\n");
479 }
480
481 static int
482 sockin_accept(struct socket *so, struct mbuf *nam)
483 {
484 KASSERT(solocked(so));
485
486 /* we do all the work in the worker thread */
487 return 0;
488 }
489
490 static int
491 sockin_bind(struct socket *so, struct mbuf *nam, struct lwp *l)
492 {
493 KASSERT(solocked(so));
494 KASSERT(nam != NULL);
495
496 return rumpcomp_sockin_bind(SO2S(so),
497 mtod(nam, const struct sockaddr *),
498 nam->m_len);
499 }
500
501 static int
502 sockin_listen(struct socket *so, struct lwp *l)
503 {
504 KASSERT(solocked(so));
505
506 return rumpcomp_sockin_listen(SO2S(so), so->so_qlimit);
507 }
508
509 static int
510 sockin_connect(struct socket *so, struct mbuf *nam, struct lwp *l)
511 {
512 int error = 0;
513
514 KASSERT(solocked(so));
515 KASSERT(nam != NULL);
516
517 error = rumpcomp_sockin_connect(SO2S(so),
518 mtod(nam, struct sockaddr *), nam->m_len);
519 if (error == 0)
520 soisconnected(so);
521
522 return error;
523 }
524
525 static int
526 sockin_disconnect(struct socket *so)
527 {
528 KASSERT(solocked(so));
529
530 panic("sockin_disconnect: IMPLEMENT ME, disconnect not supported");
531 }
532
533 static int
534 sockin_shutdown(struct socket *so)
535 {
536 KASSERT(solocked(so));
537
538 removesock(so);
539 return 0;
540 }
541
542 static int
543 sockin_abort(struct socket *so)
544 {
545 KASSERT(solocked(so));
546
547 panic("sockin_abort: IMPLEMENT ME, abort not supported");
548 }
549
550 static int
551 sockin_ioctl(struct socket *so, u_long cmd, void *nam, struct ifnet *ifp)
552 {
553 return ENOTTY;
554 }
555
556 static int
557 sockin_stat(struct socket *so, struct stat *ub)
558 {
559 KASSERT(solocked(so));
560
561 return 0;
562 }
563
564 static int
565 sockin_peeraddr(struct socket *so, struct mbuf *nam)
566 {
567 KASSERT(solocked(so));
568
569 int error = 0;
570 int slen = nam->m_len;
571
572 error = rumpcomp_sockin_getname(SO2S(so),
573 mtod(nam, struct sockaddr *), &slen, RUMPCOMP_SOCKIN_PEERNAME);
574 if (error == 0)
575 nam->m_len = slen;
576 return error;
577 }
578
579 static int
580 sockin_sockaddr(struct socket *so, struct mbuf *nam)
581 {
582 KASSERT(solocked(so));
583
584 int error = 0;
585 int slen = nam->m_len;
586
587 error = rumpcomp_sockin_getname(SO2S(so),
588 mtod(nam, struct sockaddr *), &slen, RUMPCOMP_SOCKIN_SOCKNAME);
589 if (error == 0)
590 nam->m_len = slen;
591 return error;
592 }
593
594 static int
595 sockin_recvoob(struct socket *so, struct mbuf *m, int flags)
596 {
597 KASSERT(solocked(so));
598
599 panic("sockin_recvoob: IMPLEMENT ME, recvoob not supported");
600 }
601
602 static int
603 sockin_send(struct socket *so, struct mbuf *m, struct mbuf *nam,
604 struct mbuf *control, struct lwp *l)
605 {
606 struct sockaddr *saddr;
607 struct msghdr mhdr;
608 size_t iov_max, i;
609 struct iovec iov_buf[32], *iov;
610 struct mbuf *m2;
611 size_t tot, n;
612 int error = 0;
613 int s;
614
615 bpf_mtap_af(&sockin_if, AF_UNSPEC, m);
616
617 memset(&mhdr, 0, sizeof(mhdr));
618
619 iov_max = 0;
620 for (m2 = m; m2 != NULL; m2 = m2->m_next) {
621 iov_max++;
622 }
623
624 if (iov_max <= __arraycount(iov_buf)) {
625 iov = iov_buf;
626 } else {
627 iov = kmem_alloc(sizeof(struct iovec) * iov_max,
628 KM_SLEEP);
629 }
630
631 tot = 0;
632 for (i = 0, m2 = m; m2 != NULL; m2 = m2->m_next, i++) {
633 iov[i].iov_base = m2->m_data;
634 iov[i].iov_len = m2->m_len;
635 tot += m2->m_len;
636 }
637 mhdr.msg_iov = iov;
638 mhdr.msg_iovlen = i;
639 s = SO2S(so);
640
641 if (nam != NULL) {
642 saddr = mtod(nam, struct sockaddr *);
643 mhdr.msg_name = saddr;
644 mhdr.msg_namelen = saddr->sa_len;
645 }
646
647 rumpcomp_sockin_sendmsg(s, &mhdr, 0, &n);
648
649 if (iov != iov_buf)
650 kmem_free(iov, sizeof(struct iovec) * iov_max);
651
652 m_freem(m);
653 m_freem(control);
654
655 /* this assumes too many things to list.. buthey, testing */
656 if (!rump_threads)
657 sockin_process(so);
658
659 return error;
660 }
661
662 static int
663 sockin_sendoob(struct socket *so, struct mbuf *m, struct mbuf *control)
664 {
665 KASSERT(solocked(so));
666
667 panic("sockin_sendoob: IMPLEMENT ME, sendoob not supported");
668 }
669
670 static int
671 sockin_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
672 struct mbuf *control, struct lwp *l)
673 {
674 int error = 0;
675
676 KASSERT(req != PRU_ACCEPT);
677 KASSERT(req != PRU_BIND);
678 KASSERT(req != PRU_LISTEN);
679 KASSERT(req != PRU_CONNECT);
680 KASSERT(req != PRU_DISCONNECT);
681 KASSERT(req != PRU_SHUTDOWN);
682 KASSERT(req != PRU_ABORT);
683 KASSERT(req != PRU_CONTROL);
684 KASSERT(req != PRU_SENSE);
685 KASSERT(req != PRU_PEERADDR);
686 KASSERT(req != PRU_SOCKADDR);
687 KASSERT(req != PRU_RCVOOB);
688 KASSERT(req != PRU_SEND);
689 KASSERT(req != PRU_SENDOOB);
690
691 switch (req) {
692 default:
693 panic("sockin_usrreq: IMPLEMENT ME, req %d not supported", req);
694 }
695
696 return error;
697 }
698
699 static int
700 sockin_ctloutput(int op, struct socket *so, struct sockopt *sopt)
701 {
702
703 return rumpcomp_sockin_setsockopt(SO2S(so), sopt->sopt_level,
704 sopt->sopt_name, sopt->sopt_data, sopt->sopt_size);
705 }
706
707 int sockin_unavailable(void);
708 int
709 sockin_unavailable(void)
710 {
711
712 panic("interface not available in with sockin");
713 }
714 __strong_alias(rtrequest,sockin_unavailable);
715 __strong_alias(ifunit,sockin_unavailable);
716 __strong_alias(ifreq_setaddr,sockin_unavailable);
717