aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/phonet/af_phonet.c2
-rw-r--r--net/phonet/socket.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index c6fffd9..7737ad3 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -68,7 +68,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
struct phonet_protocol *pnp;
int err;
- if (!capable(CAP_SYS_ADMIN))
+ if (!capable(CAP_SYS_ADMIN) && !capable(CAP_NET_ADMIN))
return -EPERM;
if (protocol == 0) {
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index ab07711..b24bf54 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -506,7 +506,7 @@ int pn_sock_get_port(struct sock *sk, unsigned short sport)
phonet_get_local_port_range(&pmin, &pmax);
for (port = pmin; port <= pmax; port++) {
- port_cur++;
+ port_cur += PN_HASHSIZE;
if (port_cur < pmin || port_cur > pmax)
port_cur = pmin;