diff options
author | Anton Arapov <aarapov@redhat.com> | 2007-10-19 01:00:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-10-19 01:00:17 -0400 |
commit | a25de534f89c515c82d3553c42d3bb02c2d1a7da (patch) | |
tree | d09a5ed1f8a9fa5254c9ebf5cb49bf95e636a3e8 /drivers/infiniband | |
parent | be702d5e38e2e7e554604b223794f87c12fa6811 (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 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 93644f82592c..d08fb30768bc 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -2797,11 +2797,12 @@ static void cma_remove_one(struct ib_device *device) | |||
2797 | 2797 | ||
2798 | static int cma_init(void) | 2798 | static int cma_init(void) |
2799 | { | 2799 | { |
2800 | int ret, low, high; | 2800 | int ret, low, high, remaining; |
2801 | 2801 | ||
2802 | get_random_bytes(&next_port, sizeof next_port); | 2802 | get_random_bytes(&next_port, sizeof next_port); |
2803 | inet_get_local_port_range(&low, &high); | 2803 | inet_get_local_port_range(&low, &high); |
2804 | next_port = ((unsigned int) next_port % (high - low)) + low; | 2804 | remaining = (high - low) + 1; |
2805 | next_port = ((unsigned int) next_port % remaining) + low; | ||
2805 | 2806 | ||
2806 | cma_wq = create_singlethread_workqueue("rdma_cm"); | 2807 | cma_wq = create_singlethread_workqueue("rdma_cm"); |
2807 | if (!cma_wq) | 2808 | if (!cma_wq) |