| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: in_gif.c,v 1.71 2016/01/22 23:27:12 riastradh Exp $ */ | | 1 | /* $NetBSD: in_gif.c,v 1.72 2016/01/23 02:58:13 christos Exp $ */ |
2 | /* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */ | | 2 | /* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | | 5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE | | 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE |
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | * SUCH DAMAGE. | | 30 | * SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.71 2016/01/22 23:27:12 riastradh Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.72 2016/01/23 02:58:13 christos Exp $"); |
35 | | | 35 | |
36 | #ifdef _KERNEL_OPT | | 36 | #ifdef _KERNEL_OPT |
37 | #include "opt_inet.h" | | 37 | #include "opt_inet.h" |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
41 | #include <sys/systm.h> | | 41 | #include <sys/systm.h> |
42 | #include <sys/socket.h> | | 42 | #include <sys/socket.h> |
43 | #include <sys/sockio.h> | | 43 | #include <sys/sockio.h> |
44 | #include <sys/mbuf.h> | | 44 | #include <sys/mbuf.h> |
45 | #include <sys/errno.h> | | 45 | #include <sys/errno.h> |
46 | #include <sys/ioctl.h> | | 46 | #include <sys/ioctl.h> |
47 | #include <sys/syslog.h> | | 47 | #include <sys/syslog.h> |
| @@ -381,33 +381,35 @@ in_gif_attach(struct gif_softc *sc) | | | @@ -381,33 +381,35 @@ in_gif_attach(struct gif_softc *sc) |
381 | return EINVAL; | | 381 | return EINVAL; |
382 | sc->encap_cookie4 = encap_attach(AF_INET, -1, sc->gif_psrc, | | 382 | sc->encap_cookie4 = encap_attach(AF_INET, -1, sc->gif_psrc, |
383 | (struct sockaddr *)&mask4, sc->gif_pdst, (struct sockaddr *)&mask4, | | 383 | (struct sockaddr *)&mask4, sc->gif_pdst, (struct sockaddr *)&mask4, |
384 | (const struct protosw *)&in_gif_protosw, sc); | | 384 | (const struct protosw *)&in_gif_protosw, sc); |
385 | #else | | 385 | #else |
386 | sc->encap_cookie4 = encap_attach_func(AF_INET, -1, gif_encapcheck, | | 386 | sc->encap_cookie4 = encap_attach_func(AF_INET, -1, gif_encapcheck, |
387 | &in_gif_protosw, sc); | | 387 | &in_gif_protosw, sc); |
388 | #endif | | 388 | #endif |
389 | if (sc->encap_cookie4 == NULL) | | 389 | if (sc->encap_cookie4 == NULL) |
390 | return EEXIST; | | 390 | return EEXIST; |
391 | return 0; | | 391 | return 0; |
392 | } | | 392 | } |
393 | | | 393 | |
| | | 394 | #ifdef notdef |
394 | int | | 395 | int |
395 | in_gif_pause(struct gif_softc *sc) | | 396 | in_gif_pause(struct gif_softc *sc) |
396 | { | | 397 | { |
397 | int error; | | 398 | int error; |
398 | | | 399 | |
399 | error = encap_detach(sc->encap_cookie4); | | 400 | error = encap_detach(sc->encap_cookie4); |
400 | if (error == 0) | | 401 | if (error == 0) |
401 | sc->encap_cookie4 = NULL; | | 402 | sc->encap_cookie4 = NULL; |
402 | | | 403 | |
403 | return error; | | 404 | return error; |
404 | } | | 405 | } |
| | | 406 | #endif |
405 | | | 407 | |
406 | int | | 408 | int |
407 | in_gif_detach(struct gif_softc *sc) | | 409 | in_gif_detach(struct gif_softc *sc) |
408 | { | | 410 | { |
409 | | | 411 | |
410 | rtcache_free(&sc->gif_ro); | | 412 | rtcache_free(&sc->gif_ro); |
411 | | | 413 | |
412 | return 0; | | 414 | return 0; |
413 | } | | 415 | } |