aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/socket.c
diff options
context:
space:
mode:
authorRemi Denis-Courmont <remi.denis-courmont@nokia.com>2008-09-22 23:08:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-22 23:08:39 -0400
commit87ab4e20b445c6d2d2727ab4f96fa17f7259511e (patch)
tree42ee249e27e293b94f9f0c5a72dc6ef58fee5d38 /net/phonet/socket.c
parent5f77076d75d35c9f5619e1f9d7e7428a627f65e6 (diff)
Phonet: proc interface for port range
Phonet endpoints are bound to individual ports. This provides a /proc/sys/net/phonet (or sysctl) interface for selecting the range of automatically allocated ports (much like the ip_local_port_range with IPv4). Signed-off-by: Remi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet/socket.c')
-rw-r--r--net/phonet/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 99a4945d565d..dfd4061646db 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -273,8 +273,9 @@ int pn_sock_get_port(struct sock *sk, unsigned short sport)
273 273
274 if (!sport) { 274 if (!sport) {
275 /* search free port */ 275 /* search free port */
276 int port, pmin = 0x40, pmax = 0x7f; 276 int port, pmin, pmax;
277 277
278 phonet_get_local_port_range(&pmin, &pmax);
278 for (port = pmin; port <= pmax; port++) { 279 for (port = pmin; port <= pmax; port++) {
279 port_cur++; 280 port_cur++;
280 if (port_cur < pmin || port_cur > pmax) 281 if (port_cur < pmin || port_cur > pmax)