aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 13:26:21 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:55 -0400
commit3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch)
tree09edb35f32ebcfb1b4dad904425128a110ef16ee /net/ipv4/igmp.c
parentc346dca10840a874240c78efe3f39acf4312a1f2 (diff)
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set() and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set(). Without CONFIG_NET_NS, no namespace other than &init_net exists. Let's explicitly define them to help compiler optimizations. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 682f632bfb77..6250f4239b61 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1762,7 +1762,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
1762 if (!ipv4_is_multicast(addr)) 1762 if (!ipv4_is_multicast(addr))
1763 return -EINVAL; 1763 return -EINVAL;
1764 1764
1765 if (sk->sk_net != &init_net) 1765 if (sock_net(sk) != &init_net)
1766 return -EPROTONOSUPPORT; 1766 return -EPROTONOSUPPORT;
1767 1767
1768 rtnl_lock(); 1768 rtnl_lock();
@@ -1833,7 +1833,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
1833 u32 ifindex; 1833 u32 ifindex;
1834 int ret = -EADDRNOTAVAIL; 1834 int ret = -EADDRNOTAVAIL;
1835 1835
1836 if (sk->sk_net != &init_net) 1836 if (sock_net(sk) != &init_net)
1837 return -EPROTONOSUPPORT; 1837 return -EPROTONOSUPPORT;
1838 1838
1839 rtnl_lock(); 1839 rtnl_lock();
@@ -1881,7 +1881,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
1881 if (!ipv4_is_multicast(addr)) 1881 if (!ipv4_is_multicast(addr))
1882 return -EINVAL; 1882 return -EINVAL;
1883 1883
1884 if (sk->sk_net != &init_net) 1884 if (sock_net(sk) != &init_net)
1885 return -EPROTONOSUPPORT; 1885 return -EPROTONOSUPPORT;
1886 1886
1887 rtnl_lock(); 1887 rtnl_lock();
@@ -2017,7 +2017,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
2017 msf->imsf_fmode != MCAST_EXCLUDE) 2017 msf->imsf_fmode != MCAST_EXCLUDE)
2018 return -EINVAL; 2018 return -EINVAL;
2019 2019
2020 if (sk->sk_net != &init_net) 2020 if (sock_net(sk) != &init_net)
2021 return -EPROTONOSUPPORT; 2021 return -EPROTONOSUPPORT;
2022 2022
2023 rtnl_lock(); 2023 rtnl_lock();
@@ -2100,7 +2100,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
2100 if (!ipv4_is_multicast(addr)) 2100 if (!ipv4_is_multicast(addr))
2101 return -EINVAL; 2101 return -EINVAL;
2102 2102
2103 if (sk->sk_net != &init_net) 2103 if (sock_net(sk) != &init_net)
2104 return -EPROTONOSUPPORT; 2104 return -EPROTONOSUPPORT;
2105 2105
2106 rtnl_lock(); 2106 rtnl_lock();
@@ -2165,7 +2165,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
2165 if (!ipv4_is_multicast(addr)) 2165 if (!ipv4_is_multicast(addr))
2166 return -EINVAL; 2166 return -EINVAL;
2167 2167
2168 if (sk->sk_net != &init_net) 2168 if (sock_net(sk) != &init_net)
2169 return -EPROTONOSUPPORT; 2169 return -EPROTONOSUPPORT;
2170 2170
2171 rtnl_lock(); 2171 rtnl_lock();
@@ -2252,7 +2252,7 @@ void ip_mc_drop_socket(struct sock *sk)
2252 if (inet->mc_list == NULL) 2252 if (inet->mc_list == NULL)
2253 return; 2253 return;
2254 2254
2255 if (sk->sk_net != &init_net) 2255 if (sock_net(sk) != &init_net)
2256 return; 2256 return;
2257 2257
2258 rtnl_lock(); 2258 rtnl_lock();