if_gif.c revision 1.7 1 1.7 itojun /* $NetBSD: if_gif.c,v 1.7 2000/01/17 06:29:07 itojun Exp $ */
2 1.3 itojun
3 1.2 itojun /*
4 1.2 itojun * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 1.2 itojun * All rights reserved.
6 1.2 itojun *
7 1.2 itojun * Redistribution and use in source and binary forms, with or without
8 1.2 itojun * modification, are permitted provided that the following conditions
9 1.2 itojun * are met:
10 1.2 itojun * 1. Redistributions of source code must retain the above copyright
11 1.2 itojun * notice, this list of conditions and the following disclaimer.
12 1.2 itojun * 2. Redistributions in binary form must reproduce the above copyright
13 1.2 itojun * notice, this list of conditions and the following disclaimer in the
14 1.2 itojun * documentation and/or other materials provided with the distribution.
15 1.2 itojun * 3. Neither the name of the project nor the names of its contributors
16 1.2 itojun * may be used to endorse or promote products derived from this software
17 1.2 itojun * without specific prior written permission.
18 1.2 itojun *
19 1.2 itojun * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 1.2 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.2 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.2 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 1.2 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.2 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.2 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.2 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.2 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.2 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.2 itojun * SUCH DAMAGE.
30 1.2 itojun */
31 1.2 itojun
32 1.2 itojun /*
33 1.2 itojun * gif.c
34 1.2 itojun */
35 1.2 itojun
36 1.2 itojun #include "opt_inet.h"
37 1.2 itojun
38 1.2 itojun #include <sys/param.h>
39 1.2 itojun #include <sys/systm.h>
40 1.2 itojun #include <sys/kernel.h>
41 1.2 itojun #include <sys/mbuf.h>
42 1.2 itojun #include <sys/socket.h>
43 1.2 itojun #include <sys/sockio.h>
44 1.2 itojun #include <sys/errno.h>
45 1.2 itojun #include <sys/ioctl.h>
46 1.2 itojun #include <sys/time.h>
47 1.2 itojun #include <sys/syslog.h>
48 1.2 itojun #include <machine/cpu.h>
49 1.2 itojun
50 1.2 itojun #include <net/if.h>
51 1.2 itojun #include <net/if_types.h>
52 1.2 itojun #include <net/netisr.h>
53 1.2 itojun #include <net/route.h>
54 1.2 itojun #include <net/bpf.h>
55 1.2 itojun
56 1.2 itojun #ifdef INET
57 1.2 itojun #include <netinet/in.h>
58 1.2 itojun #include <netinet/in_systm.h>
59 1.2 itojun #include <netinet/in_var.h>
60 1.2 itojun #include <netinet/ip.h>
61 1.2 itojun #include <netinet/in_gif.h>
62 1.2 itojun #endif /* INET */
63 1.2 itojun
64 1.2 itojun #ifdef INET6
65 1.2 itojun #ifndef INET
66 1.2 itojun #include <netinet/in.h>
67 1.2 itojun #endif
68 1.2 itojun #include <netinet6/in6_var.h>
69 1.2 itojun #include <netinet/ip6.h>
70 1.2 itojun #include <netinet6/ip6_var.h>
71 1.2 itojun #include <netinet6/in6_gif.h>
72 1.2 itojun #endif /* INET6 */
73 1.2 itojun
74 1.2 itojun #include <net/if_gif.h>
75 1.2 itojun
76 1.2 itojun #include "gif.h"
77 1.2 itojun #include "bpfilter.h"
78 1.2 itojun
79 1.4 itojun #include <net/net_osdep.h>
80 1.4 itojun
81 1.2 itojun #if NGIF > 0
82 1.2 itojun
83 1.4 itojun void gifattach __P((int));
84 1.2 itojun
85 1.2 itojun /*
86 1.2 itojun * gif global variable definitions
87 1.2 itojun */
88 1.2 itojun int ngif = NGIF; /* number of interfaces */
89 1.2 itojun struct gif_softc *gif = 0;
90 1.2 itojun
91 1.2 itojun void
92 1.2 itojun gifattach(dummy)
93 1.4 itojun int dummy;
94 1.2 itojun {
95 1.2 itojun register struct gif_softc *sc;
96 1.2 itojun register int i;
97 1.2 itojun
98 1.2 itojun gif = sc = malloc (ngif * sizeof(struct gif_softc), M_DEVBUF, M_WAIT);
99 1.2 itojun bzero(sc, ngif * sizeof(struct gif_softc));
100 1.2 itojun for (i = 0; i < ngif; sc++, i++) {
101 1.2 itojun sprintf(sc->gif_if.if_xname, "gif%d", i);
102 1.2 itojun sc->gif_if.if_mtu = GIF_MTU;
103 1.2 itojun sc->gif_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
104 1.2 itojun sc->gif_if.if_ioctl = gif_ioctl;
105 1.2 itojun sc->gif_if.if_output = gif_output;
106 1.2 itojun sc->gif_if.if_type = IFT_GIF;
107 1.2 itojun if_attach(&sc->gif_if);
108 1.2 itojun #if NBPFILTER > 0
109 1.2 itojun bpfattach(&sc->gif_if.if_bpf, &sc->gif_if, DLT_NULL, sizeof(u_int));
110 1.2 itojun #endif
111 1.2 itojun }
112 1.2 itojun }
113 1.2 itojun
114 1.2 itojun int
115 1.2 itojun gif_output(ifp, m, dst, rt)
116 1.2 itojun struct ifnet *ifp;
117 1.2 itojun struct mbuf *m;
118 1.2 itojun struct sockaddr *dst;
119 1.2 itojun struct rtentry *rt; /* added in net2 */
120 1.2 itojun {
121 1.2 itojun register struct gif_softc *sc = (struct gif_softc*)ifp;
122 1.2 itojun int error = 0;
123 1.2 itojun static int called = 0; /* XXX: MUTEX */
124 1.2 itojun int calllimit = 10; /* XXX: adhoc */
125 1.2 itojun
126 1.2 itojun /*
127 1.2 itojun * gif may cause infinite recursion calls when misconfigured.
128 1.2 itojun * We'll prevent this by introducing upper limit.
129 1.2 itojun * XXX: this mechanism may introduce another problem about
130 1.2 itojun * mutual exclusion of the variable CALLED, especially if we
131 1.2 itojun * use kernel thread.
132 1.2 itojun */
133 1.2 itojun if (++called >= calllimit) {
134 1.2 itojun log(LOG_NOTICE,
135 1.2 itojun "gif_output: recursively called too many times(%d)\n",
136 1.2 itojun called);
137 1.2 itojun m_freem(m);
138 1.2 itojun error = EIO; /* is there better errno? */
139 1.2 itojun goto end;
140 1.2 itojun }
141 1.2 itojun
142 1.2 itojun ifp->if_lastchange = time;
143 1.2 itojun m->m_flags &= ~(M_BCAST|M_MCAST);
144 1.2 itojun if (!(ifp->if_flags & IFF_UP) ||
145 1.2 itojun #if 0
146 1.2 itojun sc->gif_flags & GIFF_INUSE ||
147 1.2 itojun #endif
148 1.2 itojun sc->gif_psrc == NULL || sc->gif_pdst == NULL) {
149 1.2 itojun m_freem(m);
150 1.2 itojun error = ENETDOWN;
151 1.2 itojun goto end;
152 1.2 itojun }
153 1.2 itojun
154 1.2 itojun #if NBPFILTER > 0
155 1.2 itojun if (ifp->if_bpf) {
156 1.2 itojun /*
157 1.2 itojun * We need to prepend the address family as
158 1.2 itojun * a four byte field. Cons up a dummy header
159 1.2 itojun * to pacify bpf. This is safe because bpf
160 1.2 itojun * will only read from the mbuf (i.e., it won't
161 1.2 itojun * try to free it or keep a pointer a to it).
162 1.2 itojun */
163 1.2 itojun struct mbuf m0;
164 1.2 itojun u_int af = dst->sa_family;
165 1.2 itojun
166 1.2 itojun m0.m_next = m;
167 1.2 itojun m0.m_len = 4;
168 1.2 itojun m0.m_data = (char *)⁡
169 1.2 itojun
170 1.2 itojun bpf_mtap(ifp->if_bpf, &m0);
171 1.2 itojun }
172 1.2 itojun #endif
173 1.2 itojun ifp->if_opackets++;
174 1.2 itojun ifp->if_obytes += m->m_pkthdr.len;
175 1.2 itojun #if 0
176 1.2 itojun s = splnet();
177 1.2 itojun sc->gif_flags |= GIFF_INUSE;
178 1.2 itojun #endif
179 1.2 itojun
180 1.2 itojun switch (sc->gif_psrc->sa_family) {
181 1.2 itojun #ifdef INET
182 1.2 itojun case AF_INET:
183 1.2 itojun error = in_gif_output(ifp, dst->sa_family, m, rt);
184 1.2 itojun break;
185 1.2 itojun #endif
186 1.2 itojun #ifdef INET6
187 1.2 itojun case AF_INET6:
188 1.2 itojun error = in6_gif_output(ifp, dst->sa_family, m, rt);
189 1.2 itojun break;
190 1.2 itojun #endif
191 1.2 itojun default:
192 1.2 itojun m_freem(m);
193 1.2 itojun error = ENETDOWN;
194 1.2 itojun }
195 1.2 itojun #if 0
196 1.2 itojun sc->gif_flags &= ~GIFF_INUSE;
197 1.2 itojun splx(s);
198 1.2 itojun #endif
199 1.2 itojun
200 1.2 itojun end:
201 1.2 itojun called = 0; /* reset recursion counter */
202 1.2 itojun if (error) ifp->if_oerrors++;
203 1.2 itojun return error;
204 1.2 itojun }
205 1.2 itojun
206 1.2 itojun void
207 1.2 itojun gif_input(m, af, gifp)
208 1.2 itojun struct mbuf *m;
209 1.2 itojun int af;
210 1.2 itojun struct ifnet *gifp;
211 1.2 itojun {
212 1.2 itojun int s, isr;
213 1.2 itojun register struct ifqueue *ifq = 0;
214 1.2 itojun
215 1.2 itojun if (gifp == NULL) {
216 1.2 itojun /* just in case */
217 1.2 itojun m_freem(m);
218 1.2 itojun return;
219 1.2 itojun }
220 1.2 itojun
221 1.2 itojun if (m->m_pkthdr.rcvif)
222 1.2 itojun m->m_pkthdr.rcvif = gifp;
223 1.2 itojun
224 1.2 itojun #if NBPFILTER > 0
225 1.2 itojun if (gifp->if_bpf) {
226 1.2 itojun /*
227 1.2 itojun * We need to prepend the address family as
228 1.2 itojun * a four byte field. Cons up a dummy header
229 1.2 itojun * to pacify bpf. This is safe because bpf
230 1.2 itojun * will only read from the mbuf (i.e., it won't
231 1.2 itojun * try to free it or keep a pointer a to it).
232 1.2 itojun */
233 1.2 itojun struct mbuf m0;
234 1.2 itojun u_int af = AF_INET6;
235 1.2 itojun
236 1.2 itojun m0.m_next = m;
237 1.2 itojun m0.m_len = 4;
238 1.2 itojun m0.m_data = (char *)⁡
239 1.2 itojun
240 1.2 itojun bpf_mtap(gifp->if_bpf, &m0);
241 1.2 itojun }
242 1.2 itojun #endif /*NBPFILTER > 0*/
243 1.2 itojun
244 1.2 itojun /*
245 1.2 itojun * Put the packet to the network layer input queue according to the
246 1.2 itojun * specified address family.
247 1.2 itojun * Note: older versions of gif_input directly called network layer
248 1.2 itojun * input functions, e.g. ip6_input, here. We changed the policy to
249 1.2 itojun * prevent too many recursive calls of such input functions, which
250 1.2 itojun * might cause kernel panic. But the change may introduce another
251 1.2 itojun * problem; if the input queue is full, packets are discarded.
252 1.2 itojun * We believed it rarely occurs and changed the policy. If we find
253 1.2 itojun * it occurs more times than we thought, we may change the policy
254 1.2 itojun * again.
255 1.2 itojun */
256 1.2 itojun switch (af) {
257 1.2 itojun #ifdef INET
258 1.2 itojun case AF_INET:
259 1.2 itojun ifq = &ipintrq;
260 1.2 itojun isr = NETISR_IP;
261 1.2 itojun break;
262 1.2 itojun #endif
263 1.2 itojun #ifdef INET6
264 1.2 itojun case AF_INET6:
265 1.2 itojun ifq = &ip6intrq;
266 1.2 itojun isr = NETISR_IPV6;
267 1.2 itojun break;
268 1.2 itojun #endif
269 1.2 itojun default:
270 1.2 itojun m_freem(m);
271 1.2 itojun return;
272 1.2 itojun }
273 1.2 itojun
274 1.2 itojun s = splimp();
275 1.2 itojun if (IF_QFULL(ifq)) {
276 1.2 itojun IF_DROP(ifq); /* update statistics */
277 1.2 itojun m_freem(m);
278 1.2 itojun splx(s);
279 1.2 itojun return;
280 1.2 itojun }
281 1.2 itojun IF_ENQUEUE(ifq, m);
282 1.2 itojun /* we need schednetisr since the address family may change */
283 1.2 itojun schednetisr(isr);
284 1.2 itojun gifp->if_ipackets++;
285 1.2 itojun gifp->if_ibytes += m->m_pkthdr.len;
286 1.2 itojun splx(s);
287 1.2 itojun
288 1.2 itojun return;
289 1.2 itojun }
290 1.2 itojun
291 1.2 itojun
292 1.2 itojun int
293 1.2 itojun gif_ioctl(ifp, cmd, data)
294 1.2 itojun struct ifnet *ifp;
295 1.2 itojun u_long cmd;
296 1.2 itojun caddr_t data;
297 1.2 itojun {
298 1.2 itojun struct gif_softc *sc = (struct gif_softc*)ifp;
299 1.2 itojun struct ifreq *ifr = (struct ifreq*)data;
300 1.2 itojun int error = 0, size;
301 1.2 itojun struct sockaddr *sa, *dst, *src;
302 1.2 itojun
303 1.2 itojun switch (cmd) {
304 1.2 itojun case SIOCSIFADDR:
305 1.2 itojun break;
306 1.2 itojun
307 1.2 itojun case SIOCSIFDSTADDR:
308 1.2 itojun break;
309 1.2 itojun
310 1.2 itojun case SIOCADDMULTI:
311 1.2 itojun case SIOCDELMULTI:
312 1.2 itojun switch (ifr->ifr_addr.sa_family) {
313 1.2 itojun #ifdef INET
314 1.2 itojun case AF_INET: /* IP supports Multicast */
315 1.2 itojun break;
316 1.2 itojun #endif /* INET */
317 1.2 itojun #ifdef INET6
318 1.2 itojun case AF_INET6: /* IP6 supports Multicast */
319 1.2 itojun break;
320 1.2 itojun #endif /* INET6 */
321 1.2 itojun default: /* Other protocols doesn't support Multicast */
322 1.2 itojun error = EAFNOSUPPORT;
323 1.2 itojun break;
324 1.2 itojun }
325 1.2 itojun break;
326 1.2 itojun
327 1.2 itojun #ifdef SIOCSIFMTU /* xxx */
328 1.2 itojun case SIOCGIFMTU:
329 1.2 itojun break;
330 1.2 itojun case SIOCSIFMTU:
331 1.2 itojun {
332 1.2 itojun u_long mtu;
333 1.2 itojun mtu = ifr->ifr_mtu;
334 1.2 itojun if (mtu < GIF_MTU_MIN || mtu > GIF_MTU_MAX) {
335 1.2 itojun return (EINVAL);
336 1.2 itojun }
337 1.2 itojun ifp->if_mtu = mtu;
338 1.2 itojun }
339 1.2 itojun break;
340 1.2 itojun #endif /* SIOCSIFMTU */
341 1.2 itojun
342 1.2 itojun case SIOCSIFPHYADDR:
343 1.2 itojun #ifdef INET6
344 1.2 itojun case SIOCSIFPHYADDR_IN6:
345 1.2 itojun #endif /* INET6 */
346 1.2 itojun switch (ifr->ifr_addr.sa_family) {
347 1.2 itojun #ifdef INET
348 1.2 itojun case AF_INET:
349 1.2 itojun src = (struct sockaddr *)
350 1.2 itojun &(((struct in_aliasreq *)data)->ifra_addr);
351 1.2 itojun dst = (struct sockaddr *)
352 1.2 itojun &(((struct in_aliasreq *)data)->ifra_dstaddr);
353 1.2 itojun
354 1.2 itojun /* only one gif can have dst = INADDR_ANY */
355 1.2 itojun #define satosaddr(sa) (((struct sockaddr_in *)(sa))->sin_addr.s_addr)
356 1.2 itojun
357 1.2 itojun if (satosaddr(dst) == INADDR_ANY) {
358 1.2 itojun int i;
359 1.2 itojun struct gif_softc *sc2;
360 1.2 itojun
361 1.2 itojun for (i = 0, sc2 = gif; i < ngif; i++, sc2++) {
362 1.2 itojun if (sc2 == sc) continue;
363 1.2 itojun if (sc2->gif_pdst &&
364 1.2 itojun satosaddr(sc2->gif_pdst)
365 1.2 itojun == INADDR_ANY) {
366 1.2 itojun error = EADDRNOTAVAIL;
367 1.2 itojun goto bad;
368 1.2 itojun }
369 1.2 itojun }
370 1.2 itojun }
371 1.2 itojun size = sizeof(struct sockaddr_in);
372 1.2 itojun break;
373 1.2 itojun #endif /* INET */
374 1.2 itojun #ifdef INET6
375 1.2 itojun case AF_INET6:
376 1.2 itojun src = (struct sockaddr *)
377 1.2 itojun &(((struct in6_aliasreq *)data)->ifra_addr);
378 1.2 itojun dst = (struct sockaddr *)
379 1.2 itojun &(((struct in6_aliasreq *)data)->ifra_dstaddr);
380 1.2 itojun
381 1.2 itojun /* only one gif can have dst = in6addr_any */
382 1.2 itojun #define satoin6(sa) (&((struct sockaddr_in6 *)(sa))->sin6_addr)
383 1.2 itojun
384 1.2 itojun if (IN6_IS_ADDR_UNSPECIFIED(satoin6(dst))) {
385 1.2 itojun int i;
386 1.2 itojun struct gif_softc *sc2;
387 1.2 itojun
388 1.2 itojun for (i = 0, sc2 = gif; i < ngif; i++, sc2++) {
389 1.2 itojun if (sc2 == sc) continue;
390 1.2 itojun if (sc2->gif_pdst &&
391 1.2 itojun IN6_IS_ADDR_UNSPECIFIED(
392 1.2 itojun satoin6(sc2->gif_pdst)
393 1.2 itojun )) {
394 1.2 itojun error = EADDRNOTAVAIL;
395 1.2 itojun goto bad;
396 1.2 itojun }
397 1.2 itojun }
398 1.2 itojun }
399 1.2 itojun size = sizeof(struct sockaddr_in6);
400 1.2 itojun break;
401 1.2 itojun #endif /* INET6 */
402 1.2 itojun default:
403 1.2 itojun error = EPROTOTYPE;
404 1.2 itojun goto bad;
405 1.2 itojun break;
406 1.2 itojun }
407 1.2 itojun if (sc->gif_psrc != NULL)
408 1.2 itojun free((caddr_t)sc->gif_psrc, M_IFADDR);
409 1.2 itojun if (sc->gif_pdst != NULL)
410 1.2 itojun free((caddr_t)sc->gif_pdst, M_IFADDR);
411 1.2 itojun
412 1.2 itojun sa = (struct sockaddr *)malloc(size, M_IFADDR, M_WAITOK);
413 1.2 itojun bzero((caddr_t)sa, size);
414 1.2 itojun bcopy((caddr_t)src, (caddr_t)sa, size);
415 1.2 itojun sc->gif_psrc = sa;
416 1.2 itojun
417 1.2 itojun sa = (struct sockaddr *)malloc(size, M_IFADDR, M_WAITOK);
418 1.2 itojun bzero((caddr_t)sa, size);
419 1.2 itojun bcopy((caddr_t)dst, (caddr_t)sa, size);
420 1.2 itojun sc->gif_pdst = sa;
421 1.2 itojun
422 1.7 itojun ifp->if_flags |= IFF_UP;
423 1.2 itojun if_up(ifp); /* send up RTM_IFINFO */
424 1.2 itojun
425 1.2 itojun break;
426 1.2 itojun
427 1.2 itojun case SIOCGIFPSRCADDR:
428 1.2 itojun #ifdef INET6
429 1.2 itojun case SIOCGIFPSRCADDR_IN6:
430 1.2 itojun #endif /* INET6 */
431 1.2 itojun if (sc->gif_psrc == NULL) {
432 1.2 itojun error = EADDRNOTAVAIL;
433 1.2 itojun goto bad;
434 1.2 itojun }
435 1.2 itojun src = sc->gif_psrc;
436 1.2 itojun switch (sc->gif_psrc->sa_family) {
437 1.2 itojun #ifdef INET
438 1.2 itojun case AF_INET:
439 1.2 itojun dst = &ifr->ifr_addr;
440 1.2 itojun size = sizeof(struct sockaddr_in);
441 1.2 itojun break;
442 1.2 itojun #endif /* INET */
443 1.2 itojun #ifdef INET6
444 1.2 itojun case AF_INET6:
445 1.2 itojun dst = (struct sockaddr *)
446 1.2 itojun &(((struct in6_ifreq *)data)->ifr_addr);
447 1.2 itojun size = sizeof(struct sockaddr_in6);
448 1.2 itojun break;
449 1.2 itojun #endif /* INET6 */
450 1.2 itojun default:
451 1.2 itojun error = EADDRNOTAVAIL;
452 1.2 itojun goto bad;
453 1.2 itojun }
454 1.2 itojun bcopy((caddr_t)src, (caddr_t)dst, size);
455 1.2 itojun break;
456 1.2 itojun
457 1.2 itojun case SIOCGIFPDSTADDR:
458 1.2 itojun #ifdef INET6
459 1.2 itojun case SIOCGIFPDSTADDR_IN6:
460 1.2 itojun #endif /* INET6 */
461 1.2 itojun if (sc->gif_pdst == NULL) {
462 1.2 itojun error = EADDRNOTAVAIL;
463 1.2 itojun goto bad;
464 1.2 itojun }
465 1.2 itojun src = sc->gif_pdst;
466 1.2 itojun switch (sc->gif_pdst->sa_family) {
467 1.2 itojun #ifdef INET
468 1.2 itojun case AF_INET:
469 1.2 itojun dst = &ifr->ifr_addr;
470 1.2 itojun size = sizeof(struct sockaddr_in);
471 1.2 itojun break;
472 1.2 itojun #endif /* INET */
473 1.2 itojun #ifdef INET6
474 1.2 itojun case AF_INET6:
475 1.2 itojun dst = (struct sockaddr *)
476 1.2 itojun &(((struct in6_ifreq *)data)->ifr_addr);
477 1.2 itojun size = sizeof(struct sockaddr_in6);
478 1.2 itojun break;
479 1.2 itojun #endif /* INET6 */
480 1.2 itojun default:
481 1.2 itojun error = EADDRNOTAVAIL;
482 1.2 itojun goto bad;
483 1.2 itojun }
484 1.2 itojun bcopy((caddr_t)src, (caddr_t)dst, size);
485 1.2 itojun break;
486 1.2 itojun
487 1.2 itojun case SIOCSIFFLAGS:
488 1.2 itojun break;
489 1.2 itojun
490 1.2 itojun default:
491 1.2 itojun error = EINVAL;
492 1.2 itojun break;
493 1.2 itojun }
494 1.2 itojun bad:
495 1.2 itojun return error;
496 1.2 itojun }
497 1.2 itojun #endif /*NGIF > 0*/
498