Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214547
b: refs/heads/master
c: 7417fa8
h: refs/heads/master
i:
  214545: c3c84fa
  214543: bda5a27
v: v3
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Sep 16, 2010
1 parent 9be23cd commit 9244c5b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e3d16ce5e82648d7f4dfd28b6cf8fe2e9a9efc3
refs/heads/master: 7417fa83c1a8b75a03bd9b9b358999f38e771eab
2 changes: 2 additions & 0 deletions trunk/include/linux/phonet.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

/* ioctls */
#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)

/* Phonet protocol header */
struct phonethdr {
Expand Down
13 changes: 13 additions & 0 deletions trunk/net/phonet/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ static int pn_ioctl(struct sock *sk, int cmd, unsigned long arg)
answ = skb ? skb->len : 0;
release_sock(sk);
return put_user(answ, (int __user *)arg);

case SIOCPNADDRESOURCE:
case SIOCPNDELRESOURCE: {
u32 res;
if (get_user(res, (u32 __user *)arg))
return -EFAULT;
if (res >= 256)
return -EINVAL;
if (cmd == SIOCPNADDRESOURCE)
return pn_sock_bind_res(sk, res);
else
return pn_sock_unbind_res(sk, res);
}
}

return -ENOIOCTLCMD;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/phonet/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ void pn_sock_unhash(struct sock *sk)
spin_lock_bh(&pnsocks.lock);
sk_del_node_init(sk);
spin_unlock_bh(&pnsocks.lock);
pn_sock_unbind_all_res(sk);
}
EXPORT_SYMBOL(pn_sock_unhash);

Expand Down

0 comments on commit 9244c5b

Please sign in to comment.