| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $ */ | | 1 | /* $NetBSD: ip_mroute.c,v 1.165 2022/03/15 21:39:59 andvar Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1992, 1993 | | 4 | * Copyright (c) 1992, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Stephen Deering of Stanford University. | | 8 | * Stephen Deering of Stanford University. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -83,27 +83,27 @@ | | | @@ -83,27 +83,27 @@ |
83 | * Modified by Charles M. Hannum, NetBSD, May 1995. | | 83 | * Modified by Charles M. Hannum, NetBSD, May 1995. |
84 | * Modified by Ahmed Helmy, SGI, June 1996 | | 84 | * Modified by Ahmed Helmy, SGI, June 1996 |
85 | * Modified by George Edmond Eddy (Rusty), ISI, February 1998 | | 85 | * Modified by George Edmond Eddy (Rusty), ISI, February 1998 |
86 | * Modified by Pavlin Radoslavov, USC/ISI, May 1998, August 1999, October 2000 | | 86 | * Modified by Pavlin Radoslavov, USC/ISI, May 1998, August 1999, October 2000 |
87 | * Modified by Hitoshi Asaeda, WIDE, August 2000 | | 87 | * Modified by Hitoshi Asaeda, WIDE, August 2000 |
88 | * Modified by Pavlin Radoslavov, ICSI, October 2002 | | 88 | * Modified by Pavlin Radoslavov, ICSI, October 2002 |
89 | * | | 89 | * |
90 | * MROUTING Revision: 1.2 | | 90 | * MROUTING Revision: 1.2 |
91 | * and PIM-SMv2 and PIM-DM support, advanced API support, | | 91 | * and PIM-SMv2 and PIM-DM support, advanced API support, |
92 | * bandwidth metering and signaling | | 92 | * bandwidth metering and signaling |
93 | */ | | 93 | */ |
94 | | | 94 | |
95 | #include <sys/cdefs.h> | | 95 | #include <sys/cdefs.h> |
96 | __KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $"); | | 96 | __KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.165 2022/03/15 21:39:59 andvar Exp $"); |
97 | | | 97 | |
98 | #ifdef _KERNEL_OPT | | 98 | #ifdef _KERNEL_OPT |
99 | #include "opt_inet.h" | | 99 | #include "opt_inet.h" |
100 | #include "opt_ipsec.h" | | 100 | #include "opt_ipsec.h" |
101 | #include "opt_pim.h" | | 101 | #include "opt_pim.h" |
102 | #endif | | 102 | #endif |
103 | | | 103 | |
104 | #ifdef PIM | | 104 | #ifdef PIM |
105 | #define _PIM_VT 1 | | 105 | #define _PIM_VT 1 |
106 | #endif | | 106 | #endif |
107 | | | 107 | |
108 | #include <sys/param.h> | | 108 | #include <sys/param.h> |
109 | #include <sys/systm.h> | | 109 | #include <sys/systm.h> |
| @@ -1836,27 +1836,27 @@ vif_input(struct mbuf *m, int off, int p | | | @@ -1836,27 +1836,27 @@ vif_input(struct mbuf *m, int off, int p |
1836 | */ | | 1836 | */ |
1837 | static int | | 1837 | static int |
1838 | vif_encapcheck(struct mbuf *m, int off, int proto, void *arg) | | 1838 | vif_encapcheck(struct mbuf *m, int off, int proto, void *arg) |
1839 | { | | 1839 | { |
1840 | struct vif *vifp; | | 1840 | struct vif *vifp; |
1841 | struct ip ip; | | 1841 | struct ip ip; |
1842 | | | 1842 | |
1843 | #ifdef DIAGNOSTIC | | 1843 | #ifdef DIAGNOSTIC |
1844 | if (!arg || proto != IPPROTO_IPV4) | | 1844 | if (!arg || proto != IPPROTO_IPV4) |
1845 | panic("unexpected arg in vif_encapcheck"); | | 1845 | panic("unexpected arg in vif_encapcheck"); |
1846 | #endif | | 1846 | #endif |
1847 | | | 1847 | |
1848 | /* | | 1848 | /* |
1849 | * Accept the packet only if the inner heaader is multicast | | 1849 | * Accept the packet only if the inner header is multicast |
1850 | * and the outer header matches a tunnel-mode vif. Order | | 1850 | * and the outer header matches a tunnel-mode vif. Order |
1851 | * checks in the hope that common non-matching packets will be | | 1851 | * checks in the hope that common non-matching packets will be |
1852 | * rejected quickly. Assume that unicast IPv4 traffic in a | | 1852 | * rejected quickly. Assume that unicast IPv4 traffic in a |
1853 | * parallel tunnel (e.g. gif(4)) is unlikely. | | 1853 | * parallel tunnel (e.g. gif(4)) is unlikely. |
1854 | */ | | 1854 | */ |
1855 | | | 1855 | |
1856 | /* Obtain the outer IP header and the vif pointer. */ | | 1856 | /* Obtain the outer IP header and the vif pointer. */ |
1857 | m_copydata(m, 0, sizeof(ip), (void *)&ip); | | 1857 | m_copydata(m, 0, sizeof(ip), (void *)&ip); |
1858 | vifp = (struct vif *)arg; | | 1858 | vifp = (struct vif *)arg; |
1859 | | | 1859 | |
1860 | /* | | 1860 | /* |
1861 | * The outer source must match the vif's remote peer address. | | 1861 | * The outer source must match the vif's remote peer address. |
1862 | * For a multicast router with several tunnels, this is the | | 1862 | * For a multicast router with several tunnels, this is the |