|
Lines 107-113
Link Here
|
| 107 |
&VNET_NAME(ipforwarding), 0, |
107 |
&VNET_NAME(ipforwarding), 0, |
| 108 |
"Enable IP forwarding between interfaces"); |
108 |
"Enable IP forwarding between interfaces"); |
| 109 |
|
109 |
|
| 110 |
static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ |
110 |
static VNET_DEFINE(int, ipsendredirects) = 0; /* XXX */ |
| 111 |
#define V_ipsendredirects VNET(ipsendredirects) |
111 |
#define V_ipsendredirects VNET(ipsendredirects) |
| 112 |
SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, |
112 |
SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, |
| 113 |
&VNET_NAME(ipsendredirects), 0, |
113 |
&VNET_NAME(ipsendredirects), 0, |
|
Lines 567-578
Link Here
|
| 567 |
IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) |
567 |
IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) |
| 568 |
#endif |
568 |
#endif |
| 569 |
) { |
569 |
) { |
| 570 |
if ((m = ip_tryforward(m)) == NULL) |
570 |
/* If sending ICMP redirects is enabled, then don't use ip_tryforward() |
| 571 |
return; |
571 |
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221137 |
| 572 |
if (m->m_flags & M_FASTFWD_OURS) { |
572 |
*/ |
| 573 |
m->m_flags &= ~M_FASTFWD_OURS; |
573 |
if (V_ipsendredirects != 1) { |
| 574 |
ip = mtod(m, struct ip *); |
574 |
if ((m = ip_tryforward(m)) == NULL) |
| 575 |
goto ours; |
575 |
return; |
|
|
576 |
if (m->m_flags & M_FASTFWD_OURS) { |
| 577 |
m->m_flags &= ~M_FASTFWD_OURS; |
| 578 |
ip = mtod(m, struct ip *); |
| 579 |
goto ours; |
| 580 |
} |
| 576 |
} |
581 |
} |
| 577 |
} |
582 |
} |
| 578 |
|
583 |
|