| version 1.46, 1997/02/19 08:30:04 |
version 1.47, 1997/02/25 08:35:42 |
|
|
| #define IPSENDREDIRECTS 1 |
#define IPSENDREDIRECTS 1 |
| #endif |
#endif |
| #ifndef IPFORWSRCRT |
#ifndef IPFORWSRCRT |
| #define IPFORWSRCRT 1 /* allow source-routed packets */ |
#define IPFORWSRCRT 1 /* forward source-routed packets */ |
| |
#endif |
| |
#ifndef IPALLOWSRCRT |
| |
#define IPALLOWSRCRT 0 /* reject all source-routed packets */ |
| #endif |
#endif |
| /* |
/* |
| * Note: DIRECTED_BROADCAST is handled this way so that previous |
* Note: DIRECTED_BROADCAST is handled this way so that previous |
| Line 96 int ipsendredirects = IPSENDREDIRECTS; |
|
| Line 99 int ipsendredirects = IPSENDREDIRECTS; |
|
| int ip_defttl = IPDEFTTL; |
int ip_defttl = IPDEFTTL; |
| int ip_forwsrcrt = IPFORWSRCRT; |
int ip_forwsrcrt = IPFORWSRCRT; |
| int ip_directedbcast = IPDIRECTEDBCAST; |
int ip_directedbcast = IPDIRECTEDBCAST; |
| |
int ip_allowsrcrt = IPALLOWSRCRT; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| int ipprintfs = 0; |
int ipprintfs = 0; |
| #endif |
#endif |
|
|
| */ |
*/ |
| case IPOPT_LSRR: |
case IPOPT_LSRR: |
| case IPOPT_SSRR: |
case IPOPT_SSRR: |
| |
if (ip_allowsrcrt == 0) { |
| |
type = ICMP_UNREACH; |
| |
code = ICMP_UNREACH_NET_PROHIB; |
| |
goto bad; |
| |
} |
| if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) { |
if ((off = cp[IPOPT_OFFSET]) < IPOPT_MINOFF) { |
| code = &cp[IPOPT_OFFSET] - (u_char *)ip; |
code = &cp[IPOPT_OFFSET] - (u_char *)ip; |
| goto bad; |
goto bad; |
| Line 1248 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1257 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); |
return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu)); |
| #endif |
#endif |
| case IPCTL_FORWSRCRT: |
case IPCTL_FORWSRCRT: |
| /* |
/* Don't allow this to change in a secure environment. */ |
| * Don't allow this to change in a secure environment. |
|
| */ |
|
| if (securelevel > 0) |
if (securelevel > 0) |
| return (sysctl_rdint(oldp, oldlenp, newp, |
return (sysctl_rdint(oldp, oldlenp, newp, |
| ip_forwsrcrt)); |
ip_forwsrcrt)); |
| Line 1260 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1267 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| case IPCTL_DIRECTEDBCAST: |
case IPCTL_DIRECTEDBCAST: |
| return (sysctl_int(oldp, oldlenp, newp, newlen, |
return (sysctl_int(oldp, oldlenp, newp, newlen, |
| &ip_directedbcast)); |
&ip_directedbcast)); |
| |
case IPCTL_ALLOWSRCRT: |
| |
return (sysctl_int(oldp, oldlenp, newp, newlen, |
| |
&ip_allowsrcrt)); |
| default: |
default: |
| return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
| } |
} |