OSDN Git Service

sunrpc: Fix reserved port range calculation
authorFrank Sorenson <sorenson@redhat.com>
Fri, 8 Jul 2016 21:35:23 +0000 (16:35 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 19 Jul 2016 20:23:26 +0000 (16:23 -0400)
commit5d71899a26630654d65e143c63c3c6f12d9aa287
treec33b7e75e2569c4c4ea7af2881d678cbfa379e06
parent34ae685cb3ac965c0c733c866412f3b66ddd64e7
sunrpc: Fix reserved port range calculation

The range calculation for choosing the random reserved port will panic
with divide-by-zero when min_resvport == max_resvport, a range of one
port, not zero.

Fix the reserved port range calculation by adding one to the difference.

Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/xprtsock.c