Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150592
b: refs/heads/master
c: f771bef
h: refs/heads/master
v: v3
  • Loading branch information
Nivedita Singhvi authored and David S. Miller committed Jun 2, 2009
1 parent 5b34939 commit 498255a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 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: 4d52cfbef6266092d535237ba5a4b981458ab171
refs/heads/master: f771bef98004d9d141b085d987a77d06669d4f4f
1 change: 1 addition & 0 deletions trunk/include/linux/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct in_addr {
#define MCAST_JOIN_SOURCE_GROUP 46
#define MCAST_LEAVE_SOURCE_GROUP 47
#define MCAST_MSFILTER 48
#define IP_MULTICAST_ALL 49

#define MCAST_EXCLUDE 0
#define MCAST_INCLUDE 1
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/net/inet_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ struct inet_sock {
freebind:1,
hdrincl:1,
mc_loop:1,
transparent:1;
transparent:1,
mc_all:1;
int mc_index;
__be32 mc_addr;
struct ip_mc_socklist *mc_list;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
inet->uc_ttl = -1;
inet->mc_loop = 1;
inet->mc_ttl = 1;
inet->mc_all = 1;
inet->mc_index = 0;
inet->mc_list = NULL;

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ int ip_mc_sf_allow(struct sock *sk, __be32 loc_addr, __be32 rmt_addr, int dif)
break;
}
if (!pmc)
return 1;
return inet->mc_all;
psl = pmc->sflist;
if (!psl)
return pmc->sfmode == MCAST_EXCLUDE;
Expand Down
11 changes: 11 additions & 0 deletions trunk/net/ipv4/ip_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
(1<<IP_ROUTER_ALERT) | (1<<IP_FREEBIND) |
(1<<IP_PASSSEC) | (1<<IP_TRANSPARENT))) ||
optname == IP_MULTICAST_TTL ||
optname == IP_MULTICAST_ALL ||
optname == IP_MULTICAST_LOOP ||
optname == IP_RECVORIGDSTADDR) {
if (optlen >= sizeof(int)) {
Expand Down Expand Up @@ -898,6 +899,13 @@ static int do_ip_setsockopt(struct sock *sk, int level,
kfree(gsf);
break;
}
case IP_MULTICAST_ALL:
if (optlen < 1)
goto e_inval;
if (val != 0 && val != 1)
goto e_inval;
inet->mc_all = val;
break;
case IP_ROUTER_ALERT:
err = ip_ra_control(sk, val ? 1 : 0, NULL);
break;
Expand Down Expand Up @@ -1151,6 +1159,9 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
release_sock(sk);
return err;
}
case IP_MULTICAST_ALL:
val = inet->mc_all;
break;
case IP_PKTOPTIONS:
{
struct msghdr msg;
Expand Down

0 comments on commit 498255a

Please sign in to comment.