aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/sysctl_net_ipv4.c
diff options
context:
space:
mode:
authorAnton Arapov <aarapov@redhat.com>2007-10-19 01:00:17 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-19 01:00:17 -0400
commita25de534f89c515c82d3553c42d3bb02c2d1a7da (patch)
treed09a5ed1f8a9fa5254c9ebf5cb49bf95e636a3e8 /net/ipv4/sysctl_net_ipv4.c
parentbe702d5e38e2e7e554604b223794f87c12fa6811 (diff)
[INET]: Justification for local port range robustness.
There is a justifying patch for Stephen's patches. Stephen's patches disallows using a port range of one single port and brakes the meaning of the 'remaining' variable, in some places it has different meaning. My patch gives back the sense of 'remaining' variable. It should mean how many ports are remaining and nothing else. Also my patch allows using a single port. I sure we must be able to use mentioned port range, this does not restricted by documentation and does not brake current behavior. usefull links: Patches posted by Stephen Hemminger http://marc.info/?l=linux-netdev&m=119206106218187&w=2 http://marc.info/?l=linux-netdev&m=119206109918235&w=2 Andrew Morton's comment http://marc.info/?l=linux-kernel&m=119248225007737&w=2 1. Allows using a port range of one single port. 2. Gives back sense of 'remaining' variable. Signed-off-by: Anton Arapov <aarapov@redhat.com> Acked-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/sysctl_net_ipv4.c')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index c78acc1a7f11..ffddd2b45352 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -122,7 +122,7 @@ static int ipv4_local_port_range(ctl_table *table, int write, struct file *filp,
122 ret = proc_dointvec_minmax(&tmp, write, filp, buffer, lenp, ppos); 122 ret = proc_dointvec_minmax(&tmp, write, filp, buffer, lenp, ppos);
123 123
124 if (write && ret == 0) { 124 if (write && ret == 0) {
125 if (range[1] <= range[0]) 125 if (range[1] < range[0])
126 ret = -EINVAL; 126 ret = -EINVAL;
127 else 127 else
128 set_local_port_range(range); 128 set_local_port_range(range);
@@ -150,7 +150,7 @@ static int ipv4_sysctl_local_port_range(ctl_table *table, int __user *name,
150 150
151 ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen); 151 ret = sysctl_intvec(&tmp, name, nlen, oldval, oldlenp, newval, newlen);
152 if (ret == 0 && newval && newlen) { 152 if (ret == 0 && newval && newlen) {
153 if (range[1] <= range[0]) 153 if (range[1] < range[0])
154 ret = -EINVAL; 154 ret = -EINVAL;
155 else 155 else
156 set_local_port_range(range); 156 set_local_port_range(range);