| version 1.25, 1995/11/21 01:07:34 |
version 1.26, 1996/01/15 21:11:55 |
|
|
| #ifndef IPSENDREDIRECTS |
#ifndef IPSENDREDIRECTS |
| #define IPSENDREDIRECTS 1 |
#define IPSENDREDIRECTS 1 |
| #endif |
#endif |
| |
#ifndef IPFORWSRCRT |
| |
#define IPFORWSRCRT 1 /* allow source-routed packets */ |
| |
#endif |
| int ipforwarding = IPFORWARDING; |
int ipforwarding = IPFORWARDING; |
| int ipsendredirects = IPSENDREDIRECTS; |
int ipsendredirects = IPSENDREDIRECTS; |
| int ip_defttl = IPDEFTTL; |
int ip_defttl = IPDEFTTL; |
| |
int ip_forwsrcrt = IPFORWSRCRT; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| int ipprintfs = 0; |
int ipprintfs = 0; |
| #endif |
#endif |
|
|
| } |
} |
| } |
} |
| if (forward) { |
if (forward) { |
| |
if (ip_forwsrcrt == 0) { |
| |
type = ICMP_UNREACH; |
| |
code = ICMP_UNREACH_SRCFAIL; |
| |
goto bad; |
| |
} |
| ip_forward(m, 1); |
ip_forward(m, 1); |
| return (1); |
return (1); |
| } |
} |
| Line 1123 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1132 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| void *newp; |
void *newp; |
| size_t newlen; |
size_t newlen; |
| { |
{ |
| |
int temp; |
| |
|
| /* All sysctl names at this level are terminal. */ |
/* All sysctl names at this level are terminal. */ |
| if (namelen != 1) |
if (namelen != 1) |
| return (ENOTDIR); |
return (ENOTDIR); |
| Line 1139 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1150 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| case IPCTL_DEFMTU: |
case IPCTL_DEFMTU: |
| return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); |
return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); |
| #endif |
#endif |
| |
case IPCTL_FORWSRCRT: |
| |
/* |
| |
* Don't allow this to change in a secure environment. |
| |
*/ |
| |
if (securelevel > 0) |
| |
return (EPERM); |
| |
return (sysctl_int(oldp, oldlenp, newp, newlen, |
| |
&ip_forwsrcrt)); |
| default: |
default: |
| return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
| } |
} |