| version 1.114, 2000/05/10 03:31:30 |
version 1.114.4.2, 2000/08/27 01:11:04 |
| Line 1665 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1665 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| case IPCTL_ANONPORTMIN: |
case IPCTL_ANONPORTMIN: |
| old = anonportmin; |
old = anonportmin; |
| error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmin); |
error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmin); |
| if (anonportmin >= anonportmax || anonportmin > 65535 |
if (anonportmin >= anonportmax || anonportmin < 0 |
| |
|| anonportmin > 65535 |
| #ifndef IPNOPRIVPORTS |
#ifndef IPNOPRIVPORTS |
| || anonportmin < IPPORT_RESERVED |
|| anonportmin < IPPORT_RESERVED |
| #endif |
#endif |
| Line 1677 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1678 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| case IPCTL_ANONPORTMAX: |
case IPCTL_ANONPORTMAX: |
| old = anonportmax; |
old = anonportmax; |
| error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmax); |
error = sysctl_int(oldp, oldlenp, newp, newlen, &anonportmax); |
| if (anonportmin >= anonportmax || anonportmax > 65535 |
if (anonportmin >= anonportmax || anonportmax < 0 |
| |
|| anonportmax > 65535 |
| #ifndef IPNOPRIVPORTS |
#ifndef IPNOPRIVPORTS |
| || anonportmax < IPPORT_RESERVED |
|| anonportmax < IPPORT_RESERVED |
| #endif |
#endif |
| Line 1715 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| Line 1717 ip_sysctl(name, namelen, oldp, oldlenp, |
|
| &ip_gif_ttl)); |
&ip_gif_ttl)); |
| #endif |
#endif |
| |
|
| |
#ifndef IPNOPRIVPORTS |
| |
case IPCTL_LOWPORTMIN: |
| |
old = lowportmin; |
| |
error = sysctl_int(oldp, oldlenp, newp, newlen, &lowportmin); |
| |
if (lowportmin >= lowportmax |
| |
|| lowportmin > IPPORT_RESERVEDMAX |
| |
|| lowportmin < IPPORT_RESERVEDMIN |
| |
) { |
| |
lowportmin = old; |
| |
return (EINVAL); |
| |
} |
| |
return (error); |
| |
case IPCTL_LOWPORTMAX: |
| |
old = lowportmax; |
| |
error = sysctl_int(oldp, oldlenp, newp, newlen, &lowportmax); |
| |
if (lowportmin >= lowportmax |
| |
|| lowportmax > IPPORT_RESERVEDMAX |
| |
|| lowportmax < IPPORT_RESERVEDMIN |
| |
) { |
| |
lowportmax = old; |
| |
return (EINVAL); |
| |
} |
| |
return (error); |
| |
#endif |
| |
|
| default: |
default: |
| return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
| } |
} |