Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266898
b: refs/heads/master
c: 6cc7a76
h: refs/heads/master
v: v3
  • Loading branch information
Maciej Żenczykowski authored and David S. Miller committed Oct 20, 2011
1 parent 2e09127 commit b558489
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05bdd2f14351176d368e8ddc67993690a2d1bfb6
refs/heads/master: 6cc7a765c2987f03ba278dac03c7cc759ee198e7
3 changes: 2 additions & 1 deletion trunk/include/linux/capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct cpu_vfs_cap_data {
/* Allow modification of routing tables */
/* Allow setting arbitrary process / process group ownership on
sockets */
/* Allow binding to any address for transparent proxying */
/* Allow binding to any address for transparent proxying (also via NET_RAW) */
/* Allow setting TOS (type of service) */
/* Allow setting promiscuous mode */
/* Allow clearing driver statistics */
Expand All @@ -210,6 +210,7 @@ struct cpu_vfs_cap_data {

/* Allow use of RAW sockets */
/* Allow use of PACKET sockets */
/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */

#define CAP_NET_RAW 13

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ip_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
break;

case IP_TRANSPARENT:
if (!capable(CAP_NET_ADMIN)) {
if (!!val && !capable(CAP_NET_RAW) && !capable(CAP_NET_ADMIN)) {
err = -EPERM;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
break;

case IPV6_TRANSPARENT:
if (!capable(CAP_NET_ADMIN)) {
if (valbool && !capable(CAP_NET_ADMIN) && !capable(CAP_NET_RAW)) {
retv = -EPERM;
break;
}
Expand Down

0 comments on commit b558489

Please sign in to comment.