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>
This commit is contained in:

committed by
David S. Miller

parent
5f77076d75
commit
87ab4e20b4
@@ -273,8 +273,9 @@ int pn_sock_get_port(struct sock *sk, unsigned short sport)
|
||||
|
||||
if (!sport) {
|
||||
/* search free port */
|
||||
int port, pmin = 0x40, pmax = 0x7f;
|
||||
int port, pmin, pmax;
|
||||
|
||||
phonet_get_local_port_range(&pmin, &pmax);
|
||||
for (port = pmin; port <= pmax; port++) {
|
||||
port_cur++;
|
||||
if (port_cur < pmin || port_cur > pmax)
|
||||
|
Reference in New Issue
Block a user