| version 1.44.4.1, 1997/03/12 21:24:42 |
version 1.45, 1997/02/18 20:49:35 |
|
|
| #define IPSENDREDIRECTS 1 |
#define IPSENDREDIRECTS 1 |
| #endif |
#endif |
| #ifndef IPFORWSRCRT |
#ifndef IPFORWSRCRT |
| #define IPFORWSRCRT 1 /* forward source-routed packets */ |
#define IPFORWSRCRT 1 /* allow source-routed packets */ |
| #endif |
|
| #ifndef IPALLOWSRCRT |
|
| #define IPALLOWSRCRT 1 /* allow 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 99 int ipsendredirects = IPSENDREDIRECTS; |
|
| Line 96 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 1257 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1248 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 (EPERM); |
| ip_forwsrcrt)); |
return (sysctl_int(oldp, oldlenp, newp, newlen, |
| else |
&ip_forwsrcrt)); |
| return (sysctl_int(oldp, oldlenp, newp, newlen, |
|
| &ip_forwsrcrt)); |
|
| 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); |
| } |
} |