diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-09-04 12:04:45 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-09-04 12:04:45 -0400 |
commit | fe47784ba5cbb6b713c013e046859946789b45e4 (patch) | |
tree | 6384958d55e29be0d2eb8ae78fa437c10636d8d6 /net/ipv4 | |
parent | 83b8e28b14d63db928cb39e5c5ed2a548246bd71 (diff) | |
parent | af2e1f276ff08f17192411ea3b71c13a758dfe12 (diff) |
Merge branch 'x86/cpu' into x86/xsave
Conflicts:
arch/x86/kernel/cpu/feature_names.c
include/asm-x86/cpufeature.h
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/icmp.c | 22 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 71 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_app.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_conn.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 27 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_dh.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_est.c | 116 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lblc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lblcr.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_nq.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_rr.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sched.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sed.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sh.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sync.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_wlc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_wrr.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_addrtype.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_proto_common.c | 8 | ||||
-rw-r--r-- | net/ipv4/route.c | 76 | ||||
-rw-r--r-- | net/ipv4/udp.c | 6 |
23 files changed, 192 insertions, 172 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 860558633b2c..55c355e63234 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -204,18 +204,22 @@ static struct sock *icmp_sk(struct net *net) | |||
204 | return net->ipv4.icmp_sk[smp_processor_id()]; | 204 | return net->ipv4.icmp_sk[smp_processor_id()]; |
205 | } | 205 | } |
206 | 206 | ||
207 | static inline int icmp_xmit_lock(struct sock *sk) | 207 | static inline struct sock *icmp_xmit_lock(struct net *net) |
208 | { | 208 | { |
209 | struct sock *sk; | ||
210 | |||
209 | local_bh_disable(); | 211 | local_bh_disable(); |
210 | 212 | ||
213 | sk = icmp_sk(net); | ||
214 | |||
211 | if (unlikely(!spin_trylock(&sk->sk_lock.slock))) { | 215 | if (unlikely(!spin_trylock(&sk->sk_lock.slock))) { |
212 | /* This can happen if the output path signals a | 216 | /* This can happen if the output path signals a |
213 | * dst_link_failure() for an outgoing ICMP packet. | 217 | * dst_link_failure() for an outgoing ICMP packet. |
214 | */ | 218 | */ |
215 | local_bh_enable(); | 219 | local_bh_enable(); |
216 | return 1; | 220 | return NULL; |
217 | } | 221 | } |
218 | return 0; | 222 | return sk; |
219 | } | 223 | } |
220 | 224 | ||
221 | static inline void icmp_xmit_unlock(struct sock *sk) | 225 | static inline void icmp_xmit_unlock(struct sock *sk) |
@@ -354,15 +358,17 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) | |||
354 | struct ipcm_cookie ipc; | 358 | struct ipcm_cookie ipc; |
355 | struct rtable *rt = skb->rtable; | 359 | struct rtable *rt = skb->rtable; |
356 | struct net *net = dev_net(rt->u.dst.dev); | 360 | struct net *net = dev_net(rt->u.dst.dev); |
357 | struct sock *sk = icmp_sk(net); | 361 | struct sock *sk; |
358 | struct inet_sock *inet = inet_sk(sk); | 362 | struct inet_sock *inet; |
359 | __be32 daddr; | 363 | __be32 daddr; |
360 | 364 | ||
361 | if (ip_options_echo(&icmp_param->replyopts, skb)) | 365 | if (ip_options_echo(&icmp_param->replyopts, skb)) |
362 | return; | 366 | return; |
363 | 367 | ||
364 | if (icmp_xmit_lock(sk)) | 368 | sk = icmp_xmit_lock(net); |
369 | if (sk == NULL) | ||
365 | return; | 370 | return; |
371 | inet = inet_sk(sk); | ||
366 | 372 | ||
367 | icmp_param->data.icmph.checksum = 0; | 373 | icmp_param->data.icmph.checksum = 0; |
368 | 374 | ||
@@ -419,7 +425,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) | |||
419 | if (!rt) | 425 | if (!rt) |
420 | goto out; | 426 | goto out; |
421 | net = dev_net(rt->u.dst.dev); | 427 | net = dev_net(rt->u.dst.dev); |
422 | sk = icmp_sk(net); | ||
423 | 428 | ||
424 | /* | 429 | /* |
425 | * Find the original header. It is expected to be valid, of course. | 430 | * Find the original header. It is expected to be valid, of course. |
@@ -483,7 +488,8 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) | |||
483 | } | 488 | } |
484 | } | 489 | } |
485 | 490 | ||
486 | if (icmp_xmit_lock(sk)) | 491 | sk = icmp_xmit_lock(net); |
492 | if (sk == NULL) | ||
487 | return; | 493 | return; |
488 | 494 | ||
489 | /* | 495 | /* |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 6203ece53606..f70fac612596 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -289,6 +289,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
289 | struct rtable *rt; | 289 | struct rtable *rt; |
290 | struct iphdr *pip; | 290 | struct iphdr *pip; |
291 | struct igmpv3_report *pig; | 291 | struct igmpv3_report *pig; |
292 | struct net *net = dev_net(dev); | ||
292 | 293 | ||
293 | skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), GFP_ATOMIC); | 294 | skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), GFP_ATOMIC); |
294 | if (skb == NULL) | 295 | if (skb == NULL) |
@@ -299,7 +300,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
299 | .nl_u = { .ip4_u = { | 300 | .nl_u = { .ip4_u = { |
300 | .daddr = IGMPV3_ALL_MCR } }, | 301 | .daddr = IGMPV3_ALL_MCR } }, |
301 | .proto = IPPROTO_IGMP }; | 302 | .proto = IPPROTO_IGMP }; |
302 | if (ip_route_output_key(&init_net, &rt, &fl)) { | 303 | if (ip_route_output_key(net, &rt, &fl)) { |
303 | kfree_skb(skb); | 304 | kfree_skb(skb); |
304 | return NULL; | 305 | return NULL; |
305 | } | 306 | } |
@@ -629,6 +630,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
629 | struct igmphdr *ih; | 630 | struct igmphdr *ih; |
630 | struct rtable *rt; | 631 | struct rtable *rt; |
631 | struct net_device *dev = in_dev->dev; | 632 | struct net_device *dev = in_dev->dev; |
633 | struct net *net = dev_net(dev); | ||
632 | __be32 group = pmc ? pmc->multiaddr : 0; | 634 | __be32 group = pmc ? pmc->multiaddr : 0; |
633 | __be32 dst; | 635 | __be32 dst; |
634 | 636 | ||
@@ -643,7 +645,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
643 | struct flowi fl = { .oif = dev->ifindex, | 645 | struct flowi fl = { .oif = dev->ifindex, |
644 | .nl_u = { .ip4_u = { .daddr = dst } }, | 646 | .nl_u = { .ip4_u = { .daddr = dst } }, |
645 | .proto = IPPROTO_IGMP }; | 647 | .proto = IPPROTO_IGMP }; |
646 | if (ip_route_output_key(&init_net, &rt, &fl)) | 648 | if (ip_route_output_key(net, &rt, &fl)) |
647 | return -1; | 649 | return -1; |
648 | } | 650 | } |
649 | if (rt->rt_src == 0) { | 651 | if (rt->rt_src == 0) { |
@@ -1196,9 +1198,6 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) | |||
1196 | 1198 | ||
1197 | ASSERT_RTNL(); | 1199 | ASSERT_RTNL(); |
1198 | 1200 | ||
1199 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1200 | return; | ||
1201 | |||
1202 | for (im=in_dev->mc_list; im; im=im->next) { | 1201 | for (im=in_dev->mc_list; im; im=im->next) { |
1203 | if (im->multiaddr == addr) { | 1202 | if (im->multiaddr == addr) { |
1204 | im->users++; | 1203 | im->users++; |
@@ -1278,9 +1277,6 @@ void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) | |||
1278 | 1277 | ||
1279 | ASSERT_RTNL(); | 1278 | ASSERT_RTNL(); |
1280 | 1279 | ||
1281 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1282 | return; | ||
1283 | |||
1284 | for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) { | 1280 | for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) { |
1285 | if (i->multiaddr==addr) { | 1281 | if (i->multiaddr==addr) { |
1286 | if (--i->users == 0) { | 1282 | if (--i->users == 0) { |
@@ -1308,9 +1304,6 @@ void ip_mc_down(struct in_device *in_dev) | |||
1308 | 1304 | ||
1309 | ASSERT_RTNL(); | 1305 | ASSERT_RTNL(); |
1310 | 1306 | ||
1311 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1312 | return; | ||
1313 | |||
1314 | for (i=in_dev->mc_list; i; i=i->next) | 1307 | for (i=in_dev->mc_list; i; i=i->next) |
1315 | igmp_group_dropped(i); | 1308 | igmp_group_dropped(i); |
1316 | 1309 | ||
@@ -1331,9 +1324,6 @@ void ip_mc_init_dev(struct in_device *in_dev) | |||
1331 | { | 1324 | { |
1332 | ASSERT_RTNL(); | 1325 | ASSERT_RTNL(); |
1333 | 1326 | ||
1334 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1335 | return; | ||
1336 | |||
1337 | in_dev->mc_tomb = NULL; | 1327 | in_dev->mc_tomb = NULL; |
1338 | #ifdef CONFIG_IP_MULTICAST | 1328 | #ifdef CONFIG_IP_MULTICAST |
1339 | in_dev->mr_gq_running = 0; | 1329 | in_dev->mr_gq_running = 0; |
@@ -1357,9 +1347,6 @@ void ip_mc_up(struct in_device *in_dev) | |||
1357 | 1347 | ||
1358 | ASSERT_RTNL(); | 1348 | ASSERT_RTNL(); |
1359 | 1349 | ||
1360 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1361 | return; | ||
1362 | |||
1363 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); | 1350 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); |
1364 | 1351 | ||
1365 | for (i=in_dev->mc_list; i; i=i->next) | 1352 | for (i=in_dev->mc_list; i; i=i->next) |
@@ -1376,9 +1363,6 @@ void ip_mc_destroy_dev(struct in_device *in_dev) | |||
1376 | 1363 | ||
1377 | ASSERT_RTNL(); | 1364 | ASSERT_RTNL(); |
1378 | 1365 | ||
1379 | if (!net_eq(dev_net(in_dev->dev), &init_net)) | ||
1380 | return; | ||
1381 | |||
1382 | /* Deactivate timers */ | 1366 | /* Deactivate timers */ |
1383 | ip_mc_down(in_dev); | 1367 | ip_mc_down(in_dev); |
1384 | 1368 | ||
@@ -1395,7 +1379,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev) | |||
1395 | write_unlock_bh(&in_dev->mc_list_lock); | 1379 | write_unlock_bh(&in_dev->mc_list_lock); |
1396 | } | 1380 | } |
1397 | 1381 | ||
1398 | static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr) | 1382 | static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) |
1399 | { | 1383 | { |
1400 | struct flowi fl = { .nl_u = { .ip4_u = | 1384 | struct flowi fl = { .nl_u = { .ip4_u = |
1401 | { .daddr = imr->imr_multiaddr.s_addr } } }; | 1385 | { .daddr = imr->imr_multiaddr.s_addr } } }; |
@@ -1404,19 +1388,19 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr) | |||
1404 | struct in_device *idev = NULL; | 1388 | struct in_device *idev = NULL; |
1405 | 1389 | ||
1406 | if (imr->imr_ifindex) { | 1390 | if (imr->imr_ifindex) { |
1407 | idev = inetdev_by_index(&init_net, imr->imr_ifindex); | 1391 | idev = inetdev_by_index(net, imr->imr_ifindex); |
1408 | if (idev) | 1392 | if (idev) |
1409 | __in_dev_put(idev); | 1393 | __in_dev_put(idev); |
1410 | return idev; | 1394 | return idev; |
1411 | } | 1395 | } |
1412 | if (imr->imr_address.s_addr) { | 1396 | if (imr->imr_address.s_addr) { |
1413 | dev = ip_dev_find(&init_net, imr->imr_address.s_addr); | 1397 | dev = ip_dev_find(net, imr->imr_address.s_addr); |
1414 | if (!dev) | 1398 | if (!dev) |
1415 | return NULL; | 1399 | return NULL; |
1416 | dev_put(dev); | 1400 | dev_put(dev); |
1417 | } | 1401 | } |
1418 | 1402 | ||
1419 | if (!dev && !ip_route_output_key(&init_net, &rt, &fl)) { | 1403 | if (!dev && !ip_route_output_key(net, &rt, &fl)) { |
1420 | dev = rt->u.dst.dev; | 1404 | dev = rt->u.dst.dev; |
1421 | ip_rt_put(rt); | 1405 | ip_rt_put(rt); |
1422 | } | 1406 | } |
@@ -1754,18 +1738,16 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) | |||
1754 | struct ip_mc_socklist *iml=NULL, *i; | 1738 | struct ip_mc_socklist *iml=NULL, *i; |
1755 | struct in_device *in_dev; | 1739 | struct in_device *in_dev; |
1756 | struct inet_sock *inet = inet_sk(sk); | 1740 | struct inet_sock *inet = inet_sk(sk); |
1741 | struct net *net = sock_net(sk); | ||
1757 | int ifindex; | 1742 | int ifindex; |
1758 | int count = 0; | 1743 | int count = 0; |
1759 | 1744 | ||
1760 | if (!ipv4_is_multicast(addr)) | 1745 | if (!ipv4_is_multicast(addr)) |
1761 | return -EINVAL; | 1746 | return -EINVAL; |
1762 | 1747 | ||
1763 | if (!net_eq(sock_net(sk), &init_net)) | ||
1764 | return -EPROTONOSUPPORT; | ||
1765 | |||
1766 | rtnl_lock(); | 1748 | rtnl_lock(); |
1767 | 1749 | ||
1768 | in_dev = ip_mc_find_dev(imr); | 1750 | in_dev = ip_mc_find_dev(net, imr); |
1769 | 1751 | ||
1770 | if (!in_dev) { | 1752 | if (!in_dev) { |
1771 | iml = NULL; | 1753 | iml = NULL; |
@@ -1827,15 +1809,13 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) | |||
1827 | struct inet_sock *inet = inet_sk(sk); | 1809 | struct inet_sock *inet = inet_sk(sk); |
1828 | struct ip_mc_socklist *iml, **imlp; | 1810 | struct ip_mc_socklist *iml, **imlp; |
1829 | struct in_device *in_dev; | 1811 | struct in_device *in_dev; |
1812 | struct net *net = sock_net(sk); | ||
1830 | __be32 group = imr->imr_multiaddr.s_addr; | 1813 | __be32 group = imr->imr_multiaddr.s_addr; |
1831 | u32 ifindex; | 1814 | u32 ifindex; |
1832 | int ret = -EADDRNOTAVAIL; | 1815 | int ret = -EADDRNOTAVAIL; |
1833 | 1816 | ||
1834 | if (!net_eq(sock_net(sk), &init_net)) | ||
1835 | return -EPROTONOSUPPORT; | ||
1836 | |||
1837 | rtnl_lock(); | 1817 | rtnl_lock(); |
1838 | in_dev = ip_mc_find_dev(imr); | 1818 | in_dev = ip_mc_find_dev(net, imr); |
1839 | ifindex = imr->imr_ifindex; | 1819 | ifindex = imr->imr_ifindex; |
1840 | for (imlp = &inet->mc_list; (iml = *imlp) != NULL; imlp = &iml->next) { | 1820 | for (imlp = &inet->mc_list; (iml = *imlp) != NULL; imlp = &iml->next) { |
1841 | if (iml->multi.imr_multiaddr.s_addr != group) | 1821 | if (iml->multi.imr_multiaddr.s_addr != group) |
@@ -1873,21 +1853,19 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct | |||
1873 | struct in_device *in_dev = NULL; | 1853 | struct in_device *in_dev = NULL; |
1874 | struct inet_sock *inet = inet_sk(sk); | 1854 | struct inet_sock *inet = inet_sk(sk); |
1875 | struct ip_sf_socklist *psl; | 1855 | struct ip_sf_socklist *psl; |
1856 | struct net *net = sock_net(sk); | ||
1876 | int leavegroup = 0; | 1857 | int leavegroup = 0; |
1877 | int i, j, rv; | 1858 | int i, j, rv; |
1878 | 1859 | ||
1879 | if (!ipv4_is_multicast(addr)) | 1860 | if (!ipv4_is_multicast(addr)) |
1880 | return -EINVAL; | 1861 | return -EINVAL; |
1881 | 1862 | ||
1882 | if (!net_eq(sock_net(sk), &init_net)) | ||
1883 | return -EPROTONOSUPPORT; | ||
1884 | |||
1885 | rtnl_lock(); | 1863 | rtnl_lock(); |
1886 | 1864 | ||
1887 | imr.imr_multiaddr.s_addr = mreqs->imr_multiaddr; | 1865 | imr.imr_multiaddr.s_addr = mreqs->imr_multiaddr; |
1888 | imr.imr_address.s_addr = mreqs->imr_interface; | 1866 | imr.imr_address.s_addr = mreqs->imr_interface; |
1889 | imr.imr_ifindex = ifindex; | 1867 | imr.imr_ifindex = ifindex; |
1890 | in_dev = ip_mc_find_dev(&imr); | 1868 | in_dev = ip_mc_find_dev(net, &imr); |
1891 | 1869 | ||
1892 | if (!in_dev) { | 1870 | if (!in_dev) { |
1893 | err = -ENODEV; | 1871 | err = -ENODEV; |
@@ -2007,6 +1985,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
2007 | struct in_device *in_dev; | 1985 | struct in_device *in_dev; |
2008 | struct inet_sock *inet = inet_sk(sk); | 1986 | struct inet_sock *inet = inet_sk(sk); |
2009 | struct ip_sf_socklist *newpsl, *psl; | 1987 | struct ip_sf_socklist *newpsl, *psl; |
1988 | struct net *net = sock_net(sk); | ||
2010 | int leavegroup = 0; | 1989 | int leavegroup = 0; |
2011 | 1990 | ||
2012 | if (!ipv4_is_multicast(addr)) | 1991 | if (!ipv4_is_multicast(addr)) |
@@ -2015,15 +1994,12 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
2015 | msf->imsf_fmode != MCAST_EXCLUDE) | 1994 | msf->imsf_fmode != MCAST_EXCLUDE) |
2016 | return -EINVAL; | 1995 | return -EINVAL; |
2017 | 1996 | ||
2018 | if (!net_eq(sock_net(sk), &init_net)) | ||
2019 | return -EPROTONOSUPPORT; | ||
2020 | |||
2021 | rtnl_lock(); | 1997 | rtnl_lock(); |
2022 | 1998 | ||
2023 | imr.imr_multiaddr.s_addr = msf->imsf_multiaddr; | 1999 | imr.imr_multiaddr.s_addr = msf->imsf_multiaddr; |
2024 | imr.imr_address.s_addr = msf->imsf_interface; | 2000 | imr.imr_address.s_addr = msf->imsf_interface; |
2025 | imr.imr_ifindex = ifindex; | 2001 | imr.imr_ifindex = ifindex; |
2026 | in_dev = ip_mc_find_dev(&imr); | 2002 | in_dev = ip_mc_find_dev(net, &imr); |
2027 | 2003 | ||
2028 | if (!in_dev) { | 2004 | if (!in_dev) { |
2029 | err = -ENODEV; | 2005 | err = -ENODEV; |
@@ -2094,19 +2070,17 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |||
2094 | struct in_device *in_dev; | 2070 | struct in_device *in_dev; |
2095 | struct inet_sock *inet = inet_sk(sk); | 2071 | struct inet_sock *inet = inet_sk(sk); |
2096 | struct ip_sf_socklist *psl; | 2072 | struct ip_sf_socklist *psl; |
2073 | struct net *net = sock_net(sk); | ||
2097 | 2074 | ||
2098 | if (!ipv4_is_multicast(addr)) | 2075 | if (!ipv4_is_multicast(addr)) |
2099 | return -EINVAL; | 2076 | return -EINVAL; |
2100 | 2077 | ||
2101 | if (!net_eq(sock_net(sk), &init_net)) | ||
2102 | return -EPROTONOSUPPORT; | ||
2103 | |||
2104 | rtnl_lock(); | 2078 | rtnl_lock(); |
2105 | 2079 | ||
2106 | imr.imr_multiaddr.s_addr = msf->imsf_multiaddr; | 2080 | imr.imr_multiaddr.s_addr = msf->imsf_multiaddr; |
2107 | imr.imr_address.s_addr = msf->imsf_interface; | 2081 | imr.imr_address.s_addr = msf->imsf_interface; |
2108 | imr.imr_ifindex = 0; | 2082 | imr.imr_ifindex = 0; |
2109 | in_dev = ip_mc_find_dev(&imr); | 2083 | in_dev = ip_mc_find_dev(net, &imr); |
2110 | 2084 | ||
2111 | if (!in_dev) { | 2085 | if (!in_dev) { |
2112 | err = -ENODEV; | 2086 | err = -ENODEV; |
@@ -2163,9 +2137,6 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | |||
2163 | if (!ipv4_is_multicast(addr)) | 2137 | if (!ipv4_is_multicast(addr)) |
2164 | return -EINVAL; | 2138 | return -EINVAL; |
2165 | 2139 | ||
2166 | if (!net_eq(sock_net(sk), &init_net)) | ||
2167 | return -EPROTONOSUPPORT; | ||
2168 | |||
2169 | rtnl_lock(); | 2140 | rtnl_lock(); |
2170 | 2141 | ||
2171 | err = -EADDRNOTAVAIL; | 2142 | err = -EADDRNOTAVAIL; |
@@ -2246,19 +2217,17 @@ void ip_mc_drop_socket(struct sock *sk) | |||
2246 | { | 2217 | { |
2247 | struct inet_sock *inet = inet_sk(sk); | 2218 | struct inet_sock *inet = inet_sk(sk); |
2248 | struct ip_mc_socklist *iml; | 2219 | struct ip_mc_socklist *iml; |
2220 | struct net *net = sock_net(sk); | ||
2249 | 2221 | ||
2250 | if (inet->mc_list == NULL) | 2222 | if (inet->mc_list == NULL) |
2251 | return; | 2223 | return; |
2252 | 2224 | ||
2253 | if (!net_eq(sock_net(sk), &init_net)) | ||
2254 | return; | ||
2255 | |||
2256 | rtnl_lock(); | 2225 | rtnl_lock(); |
2257 | while ((iml = inet->mc_list) != NULL) { | 2226 | while ((iml = inet->mc_list) != NULL) { |
2258 | struct in_device *in_dev; | 2227 | struct in_device *in_dev; |
2259 | inet->mc_list = iml->next; | 2228 | inet->mc_list = iml->next; |
2260 | 2229 | ||
2261 | in_dev = inetdev_by_index(&init_net, iml->multi.imr_ifindex); | 2230 | in_dev = inetdev_by_index(net, iml->multi.imr_ifindex); |
2262 | (void) ip_mc_leave_src(sk, iml, in_dev); | 2231 | (void) ip_mc_leave_src(sk, iml, in_dev); |
2263 | if (in_dev != NULL) { | 2232 | if (in_dev != NULL) { |
2264 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); | 2233 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); |
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 1f1897a1a702..201b8ea3020d 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c | |||
@@ -608,7 +608,7 @@ int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri, | |||
608 | } | 608 | } |
609 | 609 | ||
610 | 610 | ||
611 | int ip_vs_app_init(void) | 611 | int __init ip_vs_app_init(void) |
612 | { | 612 | { |
613 | /* we will replace it with proc_net_ipvs_create() soon */ | 613 | /* we will replace it with proc_net_ipvs_create() soon */ |
614 | proc_net_fops_create(&init_net, "ip_vs_app", 0, &ip_vs_app_fops); | 614 | proc_net_fops_create(&init_net, "ip_vs_app", 0, &ip_vs_app_fops); |
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index f8bdae47a77f..44a6872dc245 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -965,7 +965,7 @@ static void ip_vs_conn_flush(void) | |||
965 | } | 965 | } |
966 | 966 | ||
967 | 967 | ||
968 | int ip_vs_conn_init(void) | 968 | int __init ip_vs_conn_init(void) |
969 | { | 969 | { |
970 | int idx; | 970 | int idx; |
971 | 971 | ||
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 9a5ace0b4dd6..6379705a8dcb 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -683,9 +683,22 @@ static void | |||
683 | ip_vs_zero_stats(struct ip_vs_stats *stats) | 683 | ip_vs_zero_stats(struct ip_vs_stats *stats) |
684 | { | 684 | { |
685 | spin_lock_bh(&stats->lock); | 685 | spin_lock_bh(&stats->lock); |
686 | memset(stats, 0, (char *)&stats->lock - (char *)stats); | 686 | |
687 | spin_unlock_bh(&stats->lock); | 687 | stats->conns = 0; |
688 | stats->inpkts = 0; | ||
689 | stats->outpkts = 0; | ||
690 | stats->inbytes = 0; | ||
691 | stats->outbytes = 0; | ||
692 | |||
693 | stats->cps = 0; | ||
694 | stats->inpps = 0; | ||
695 | stats->outpps = 0; | ||
696 | stats->inbps = 0; | ||
697 | stats->outbps = 0; | ||
698 | |||
688 | ip_vs_zero_estimator(stats); | 699 | ip_vs_zero_estimator(stats); |
700 | |||
701 | spin_unlock_bh(&stats->lock); | ||
689 | } | 702 | } |
690 | 703 | ||
691 | /* | 704 | /* |
@@ -1589,7 +1602,7 @@ static struct ctl_table vs_vars[] = { | |||
1589 | { .ctl_name = 0 } | 1602 | { .ctl_name = 0 } |
1590 | }; | 1603 | }; |
1591 | 1604 | ||
1592 | struct ctl_path net_vs_ctl_path[] = { | 1605 | const struct ctl_path net_vs_ctl_path[] = { |
1593 | { .procname = "net", .ctl_name = CTL_NET, }, | 1606 | { .procname = "net", .ctl_name = CTL_NET, }, |
1594 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, | 1607 | { .procname = "ipv4", .ctl_name = NET_IPV4, }, |
1595 | { .procname = "vs", }, | 1608 | { .procname = "vs", }, |
@@ -1784,7 +1797,9 @@ static const struct file_operations ip_vs_info_fops = { | |||
1784 | 1797 | ||
1785 | #endif | 1798 | #endif |
1786 | 1799 | ||
1787 | struct ip_vs_stats ip_vs_stats; | 1800 | struct ip_vs_stats ip_vs_stats = { |
1801 | .lock = __SPIN_LOCK_UNLOCKED(ip_vs_stats.lock), | ||
1802 | }; | ||
1788 | 1803 | ||
1789 | #ifdef CONFIG_PROC_FS | 1804 | #ifdef CONFIG_PROC_FS |
1790 | static int ip_vs_stats_show(struct seq_file *seq, void *v) | 1805 | static int ip_vs_stats_show(struct seq_file *seq, void *v) |
@@ -2306,7 +2321,7 @@ static struct nf_sockopt_ops ip_vs_sockopts = { | |||
2306 | }; | 2321 | }; |
2307 | 2322 | ||
2308 | 2323 | ||
2309 | int ip_vs_control_init(void) | 2324 | int __init ip_vs_control_init(void) |
2310 | { | 2325 | { |
2311 | int ret; | 2326 | int ret; |
2312 | int idx; | 2327 | int idx; |
@@ -2333,8 +2348,6 @@ int ip_vs_control_init(void) | |||
2333 | INIT_LIST_HEAD(&ip_vs_rtable[idx]); | 2348 | INIT_LIST_HEAD(&ip_vs_rtable[idx]); |
2334 | } | 2349 | } |
2335 | 2350 | ||
2336 | memset(&ip_vs_stats, 0, sizeof(ip_vs_stats)); | ||
2337 | spin_lock_init(&ip_vs_stats.lock); | ||
2338 | ip_vs_new_estimator(&ip_vs_stats); | 2351 | ip_vs_new_estimator(&ip_vs_stats); |
2339 | 2352 | ||
2340 | /* Hook the defense timer */ | 2353 | /* Hook the defense timer */ |
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c index 8afc1503ed20..fa66824d264f 100644 --- a/net/ipv4/ipvs/ip_vs_dh.c +++ b/net/ipv4/ipvs/ip_vs_dh.c | |||
@@ -233,6 +233,7 @@ static struct ip_vs_scheduler ip_vs_dh_scheduler = | |||
233 | .name = "dh", | 233 | .name = "dh", |
234 | .refcnt = ATOMIC_INIT(0), | 234 | .refcnt = ATOMIC_INIT(0), |
235 | .module = THIS_MODULE, | 235 | .module = THIS_MODULE, |
236 | .n_list = LIST_HEAD_INIT(ip_vs_dh_scheduler.n_list), | ||
236 | .init_service = ip_vs_dh_init_svc, | 237 | .init_service = ip_vs_dh_init_svc, |
237 | .done_service = ip_vs_dh_done_svc, | 238 | .done_service = ip_vs_dh_done_svc, |
238 | .update_service = ip_vs_dh_update_svc, | 239 | .update_service = ip_vs_dh_update_svc, |
@@ -242,7 +243,6 @@ static struct ip_vs_scheduler ip_vs_dh_scheduler = | |||
242 | 243 | ||
243 | static int __init ip_vs_dh_init(void) | 244 | static int __init ip_vs_dh_init(void) |
244 | { | 245 | { |
245 | INIT_LIST_HEAD(&ip_vs_dh_scheduler.n_list); | ||
246 | return register_ip_vs_scheduler(&ip_vs_dh_scheduler); | 246 | return register_ip_vs_scheduler(&ip_vs_dh_scheduler); |
247 | } | 247 | } |
248 | 248 | ||
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c index bc04eedd6dbb..5a20f93bd7f9 100644 --- a/net/ipv4/ipvs/ip_vs_est.c +++ b/net/ipv4/ipvs/ip_vs_est.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/sysctl.h> | 19 | #include <linux/sysctl.h> |
20 | #include <linux/list.h> | ||
20 | 21 | ||
21 | #include <net/ip_vs.h> | 22 | #include <net/ip_vs.h> |
22 | 23 | ||
@@ -44,28 +45,11 @@ | |||
44 | */ | 45 | */ |
45 | 46 | ||
46 | 47 | ||
47 | struct ip_vs_estimator | 48 | static void estimation_timer(unsigned long arg); |
48 | { | ||
49 | struct ip_vs_estimator *next; | ||
50 | struct ip_vs_stats *stats; | ||
51 | |||
52 | u32 last_conns; | ||
53 | u32 last_inpkts; | ||
54 | u32 last_outpkts; | ||
55 | u64 last_inbytes; | ||
56 | u64 last_outbytes; | ||
57 | |||
58 | u32 cps; | ||
59 | u32 inpps; | ||
60 | u32 outpps; | ||
61 | u32 inbps; | ||
62 | u32 outbps; | ||
63 | }; | ||
64 | |||
65 | 49 | ||
66 | static struct ip_vs_estimator *est_list = NULL; | 50 | static LIST_HEAD(est_list); |
67 | static DEFINE_RWLOCK(est_lock); | 51 | static DEFINE_SPINLOCK(est_lock); |
68 | static struct timer_list est_timer; | 52 | static DEFINE_TIMER(est_timer, estimation_timer, 0, 0); |
69 | 53 | ||
70 | static void estimation_timer(unsigned long arg) | 54 | static void estimation_timer(unsigned long arg) |
71 | { | 55 | { |
@@ -76,9 +60,9 @@ static void estimation_timer(unsigned long arg) | |||
76 | u64 n_inbytes, n_outbytes; | 60 | u64 n_inbytes, n_outbytes; |
77 | u32 rate; | 61 | u32 rate; |
78 | 62 | ||
79 | read_lock(&est_lock); | 63 | spin_lock(&est_lock); |
80 | for (e = est_list; e; e = e->next) { | 64 | list_for_each_entry(e, &est_list, list) { |
81 | s = e->stats; | 65 | s = container_of(e, struct ip_vs_stats, est); |
82 | 66 | ||
83 | spin_lock(&s->lock); | 67 | spin_lock(&s->lock); |
84 | n_conns = s->conns; | 68 | n_conns = s->conns; |
@@ -114,19 +98,16 @@ static void estimation_timer(unsigned long arg) | |||
114 | s->outbps = (e->outbps+0xF)>>5; | 98 | s->outbps = (e->outbps+0xF)>>5; |
115 | spin_unlock(&s->lock); | 99 | spin_unlock(&s->lock); |
116 | } | 100 | } |
117 | read_unlock(&est_lock); | 101 | spin_unlock(&est_lock); |
118 | mod_timer(&est_timer, jiffies + 2*HZ); | 102 | mod_timer(&est_timer, jiffies + 2*HZ); |
119 | } | 103 | } |
120 | 104 | ||
121 | int ip_vs_new_estimator(struct ip_vs_stats *stats) | 105 | void ip_vs_new_estimator(struct ip_vs_stats *stats) |
122 | { | 106 | { |
123 | struct ip_vs_estimator *est; | 107 | struct ip_vs_estimator *est = &stats->est; |
124 | 108 | ||
125 | est = kzalloc(sizeof(*est), GFP_KERNEL); | 109 | INIT_LIST_HEAD(&est->list); |
126 | if (est == NULL) | ||
127 | return -ENOMEM; | ||
128 | 110 | ||
129 | est->stats = stats; | ||
130 | est->last_conns = stats->conns; | 111 | est->last_conns = stats->conns; |
131 | est->cps = stats->cps<<10; | 112 | est->cps = stats->cps<<10; |
132 | 113 | ||
@@ -142,59 +123,40 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats) | |||
142 | est->last_outbytes = stats->outbytes; | 123 | est->last_outbytes = stats->outbytes; |
143 | est->outbps = stats->outbps<<5; | 124 | est->outbps = stats->outbps<<5; |
144 | 125 | ||
145 | write_lock_bh(&est_lock); | 126 | spin_lock_bh(&est_lock); |
146 | est->next = est_list; | 127 | if (list_empty(&est_list)) |
147 | if (est->next == NULL) { | 128 | mod_timer(&est_timer, jiffies + 2 * HZ); |
148 | setup_timer(&est_timer, estimation_timer, 0); | 129 | list_add(&est->list, &est_list); |
149 | est_timer.expires = jiffies + 2*HZ; | 130 | spin_unlock_bh(&est_lock); |
150 | add_timer(&est_timer); | ||
151 | } | ||
152 | est_list = est; | ||
153 | write_unlock_bh(&est_lock); | ||
154 | return 0; | ||
155 | } | 131 | } |
156 | 132 | ||
157 | void ip_vs_kill_estimator(struct ip_vs_stats *stats) | 133 | void ip_vs_kill_estimator(struct ip_vs_stats *stats) |
158 | { | 134 | { |
159 | struct ip_vs_estimator *est, **pest; | 135 | struct ip_vs_estimator *est = &stats->est; |
160 | int killed = 0; | 136 | |
161 | 137 | spin_lock_bh(&est_lock); | |
162 | write_lock_bh(&est_lock); | 138 | list_del(&est->list); |
163 | pest = &est_list; | 139 | while (list_empty(&est_list) && try_to_del_timer_sync(&est_timer) < 0) { |
164 | while ((est=*pest) != NULL) { | 140 | spin_unlock_bh(&est_lock); |
165 | if (est->stats != stats) { | 141 | cpu_relax(); |
166 | pest = &est->next; | 142 | spin_lock_bh(&est_lock); |
167 | continue; | ||
168 | } | ||
169 | *pest = est->next; | ||
170 | kfree(est); | ||
171 | killed++; | ||
172 | } | 143 | } |
173 | if (killed && est_list == NULL) | 144 | spin_unlock_bh(&est_lock); |
174 | del_timer_sync(&est_timer); | ||
175 | write_unlock_bh(&est_lock); | ||
176 | } | 145 | } |
177 | 146 | ||
178 | void ip_vs_zero_estimator(struct ip_vs_stats *stats) | 147 | void ip_vs_zero_estimator(struct ip_vs_stats *stats) |
179 | { | 148 | { |
180 | struct ip_vs_estimator *e; | 149 | struct ip_vs_estimator *est = &stats->est; |
181 | 150 | ||
182 | write_lock_bh(&est_lock); | 151 | /* set counters zero, caller must hold the stats->lock lock */ |
183 | for (e = est_list; e; e = e->next) { | 152 | est->last_inbytes = 0; |
184 | if (e->stats != stats) | 153 | est->last_outbytes = 0; |
185 | continue; | 154 | est->last_conns = 0; |
186 | 155 | est->last_inpkts = 0; | |
187 | /* set counters zero */ | 156 | est->last_outpkts = 0; |
188 | e->last_conns = 0; | 157 | est->cps = 0; |
189 | e->last_inpkts = 0; | 158 | est->inpps = 0; |
190 | e->last_outpkts = 0; | 159 | est->outpps = 0; |
191 | e->last_inbytes = 0; | 160 | est->inbps = 0; |
192 | e->last_outbytes = 0; | 161 | est->outbps = 0; |
193 | e->cps = 0; | ||
194 | e->inpps = 0; | ||
195 | e->outpps = 0; | ||
196 | e->inbps = 0; | ||
197 | e->outbps = 0; | ||
198 | } | ||
199 | write_unlock_bh(&est_lock); | ||
200 | } | 162 | } |
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c index 0efa3db4b180..7a6a319f544a 100644 --- a/net/ipv4/ipvs/ip_vs_lblc.c +++ b/net/ipv4/ipvs/ip_vs_lblc.c | |||
@@ -539,6 +539,7 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler = | |||
539 | .name = "lblc", | 539 | .name = "lblc", |
540 | .refcnt = ATOMIC_INIT(0), | 540 | .refcnt = ATOMIC_INIT(0), |
541 | .module = THIS_MODULE, | 541 | .module = THIS_MODULE, |
542 | .n_list = LIST_HEAD_INIT(ip_vs_lblc_scheduler.n_list), | ||
542 | .init_service = ip_vs_lblc_init_svc, | 543 | .init_service = ip_vs_lblc_init_svc, |
543 | .done_service = ip_vs_lblc_done_svc, | 544 | .done_service = ip_vs_lblc_done_svc, |
544 | .update_service = ip_vs_lblc_update_svc, | 545 | .update_service = ip_vs_lblc_update_svc, |
@@ -550,7 +551,6 @@ static int __init ip_vs_lblc_init(void) | |||
550 | { | 551 | { |
551 | int ret; | 552 | int ret; |
552 | 553 | ||
553 | INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list); | ||
554 | sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table); | 554 | sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table); |
555 | ret = register_ip_vs_scheduler(&ip_vs_lblc_scheduler); | 555 | ret = register_ip_vs_scheduler(&ip_vs_lblc_scheduler); |
556 | if (ret) | 556 | if (ret) |
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c index 8e3bbeb45138..c234e73968a6 100644 --- a/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/net/ipv4/ipvs/ip_vs_lblcr.c | |||
@@ -728,6 +728,7 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler = | |||
728 | .name = "lblcr", | 728 | .name = "lblcr", |
729 | .refcnt = ATOMIC_INIT(0), | 729 | .refcnt = ATOMIC_INIT(0), |
730 | .module = THIS_MODULE, | 730 | .module = THIS_MODULE, |
731 | .n_list = LIST_HEAD_INIT(ip_vs_lblcr_scheduler.n_list), | ||
731 | .init_service = ip_vs_lblcr_init_svc, | 732 | .init_service = ip_vs_lblcr_init_svc, |
732 | .done_service = ip_vs_lblcr_done_svc, | 733 | .done_service = ip_vs_lblcr_done_svc, |
733 | .update_service = ip_vs_lblcr_update_svc, | 734 | .update_service = ip_vs_lblcr_update_svc, |
@@ -739,7 +740,6 @@ static int __init ip_vs_lblcr_init(void) | |||
739 | { | 740 | { |
740 | int ret; | 741 | int ret; |
741 | 742 | ||
742 | INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); | ||
743 | sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table); | 743 | sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table); |
744 | ret = register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); | 744 | ret = register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); |
745 | if (ret) | 745 | if (ret) |
diff --git a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c index ac9f08e065d5..ebcdbf75ac65 100644 --- a/net/ipv4/ipvs/ip_vs_lc.c +++ b/net/ipv4/ipvs/ip_vs_lc.c | |||
@@ -98,6 +98,7 @@ static struct ip_vs_scheduler ip_vs_lc_scheduler = { | |||
98 | .name = "lc", | 98 | .name = "lc", |
99 | .refcnt = ATOMIC_INIT(0), | 99 | .refcnt = ATOMIC_INIT(0), |
100 | .module = THIS_MODULE, | 100 | .module = THIS_MODULE, |
101 | .n_list = LIST_HEAD_INIT(ip_vs_lc_scheduler.n_list), | ||
101 | .init_service = ip_vs_lc_init_svc, | 102 | .init_service = ip_vs_lc_init_svc, |
102 | .done_service = ip_vs_lc_done_svc, | 103 | .done_service = ip_vs_lc_done_svc, |
103 | .update_service = ip_vs_lc_update_svc, | 104 | .update_service = ip_vs_lc_update_svc, |
@@ -107,7 +108,6 @@ static struct ip_vs_scheduler ip_vs_lc_scheduler = { | |||
107 | 108 | ||
108 | static int __init ip_vs_lc_init(void) | 109 | static int __init ip_vs_lc_init(void) |
109 | { | 110 | { |
110 | INIT_LIST_HEAD(&ip_vs_lc_scheduler.n_list); | ||
111 | return register_ip_vs_scheduler(&ip_vs_lc_scheduler) ; | 111 | return register_ip_vs_scheduler(&ip_vs_lc_scheduler) ; |
112 | } | 112 | } |
113 | 113 | ||
diff --git a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c index a46bf258d420..92f3a6770031 100644 --- a/net/ipv4/ipvs/ip_vs_nq.c +++ b/net/ipv4/ipvs/ip_vs_nq.c | |||
@@ -136,6 +136,7 @@ static struct ip_vs_scheduler ip_vs_nq_scheduler = | |||
136 | .name = "nq", | 136 | .name = "nq", |
137 | .refcnt = ATOMIC_INIT(0), | 137 | .refcnt = ATOMIC_INIT(0), |
138 | .module = THIS_MODULE, | 138 | .module = THIS_MODULE, |
139 | .n_list = LIST_HEAD_INIT(ip_vs_nq_scheduler.n_list), | ||
139 | .init_service = ip_vs_nq_init_svc, | 140 | .init_service = ip_vs_nq_init_svc, |
140 | .done_service = ip_vs_nq_done_svc, | 141 | .done_service = ip_vs_nq_done_svc, |
141 | .update_service = ip_vs_nq_update_svc, | 142 | .update_service = ip_vs_nq_update_svc, |
@@ -145,7 +146,6 @@ static struct ip_vs_scheduler ip_vs_nq_scheduler = | |||
145 | 146 | ||
146 | static int __init ip_vs_nq_init(void) | 147 | static int __init ip_vs_nq_init(void) |
147 | { | 148 | { |
148 | INIT_LIST_HEAD(&ip_vs_nq_scheduler.n_list); | ||
149 | return register_ip_vs_scheduler(&ip_vs_nq_scheduler); | 149 | return register_ip_vs_scheduler(&ip_vs_nq_scheduler); |
150 | } | 150 | } |
151 | 151 | ||
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c index 876714f23d65..6099a88fc200 100644 --- a/net/ipv4/ipvs/ip_vs_proto.c +++ b/net/ipv4/ipvs/ip_vs_proto.c | |||
@@ -43,7 +43,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE]; | |||
43 | /* | 43 | /* |
44 | * register an ipvs protocol | 44 | * register an ipvs protocol |
45 | */ | 45 | */ |
46 | static int __used register_ip_vs_protocol(struct ip_vs_protocol *pp) | 46 | static int __used __init register_ip_vs_protocol(struct ip_vs_protocol *pp) |
47 | { | 47 | { |
48 | unsigned hash = IP_VS_PROTO_HASH(pp->protocol); | 48 | unsigned hash = IP_VS_PROTO_HASH(pp->protocol); |
49 | 49 | ||
@@ -190,7 +190,7 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, | |||
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||
193 | int ip_vs_protocol_init(void) | 193 | int __init ip_vs_protocol_init(void) |
194 | { | 194 | { |
195 | char protocols[64]; | 195 | char protocols[64]; |
196 | #define REGISTER_PROTOCOL(p) \ | 196 | #define REGISTER_PROTOCOL(p) \ |
diff --git a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c index c8db12d39e61..358110d17e59 100644 --- a/net/ipv4/ipvs/ip_vs_rr.c +++ b/net/ipv4/ipvs/ip_vs_rr.c | |||
@@ -94,6 +94,7 @@ static struct ip_vs_scheduler ip_vs_rr_scheduler = { | |||
94 | .name = "rr", /* name */ | 94 | .name = "rr", /* name */ |
95 | .refcnt = ATOMIC_INIT(0), | 95 | .refcnt = ATOMIC_INIT(0), |
96 | .module = THIS_MODULE, | 96 | .module = THIS_MODULE, |
97 | .n_list = LIST_HEAD_INIT(ip_vs_rr_scheduler.n_list), | ||
97 | .init_service = ip_vs_rr_init_svc, | 98 | .init_service = ip_vs_rr_init_svc, |
98 | .done_service = ip_vs_rr_done_svc, | 99 | .done_service = ip_vs_rr_done_svc, |
99 | .update_service = ip_vs_rr_update_svc, | 100 | .update_service = ip_vs_rr_update_svc, |
@@ -102,7 +103,6 @@ static struct ip_vs_scheduler ip_vs_rr_scheduler = { | |||
102 | 103 | ||
103 | static int __init ip_vs_rr_init(void) | 104 | static int __init ip_vs_rr_init(void) |
104 | { | 105 | { |
105 | INIT_LIST_HEAD(&ip_vs_rr_scheduler.n_list); | ||
106 | return register_ip_vs_scheduler(&ip_vs_rr_scheduler); | 106 | return register_ip_vs_scheduler(&ip_vs_rr_scheduler); |
107 | } | 107 | } |
108 | 108 | ||
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c index b64767309855..a46ad9e35016 100644 --- a/net/ipv4/ipvs/ip_vs_sched.c +++ b/net/ipv4/ipvs/ip_vs_sched.c | |||
@@ -184,7 +184,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
184 | 184 | ||
185 | write_lock_bh(&__ip_vs_sched_lock); | 185 | write_lock_bh(&__ip_vs_sched_lock); |
186 | 186 | ||
187 | if (scheduler->n_list.next != &scheduler->n_list) { | 187 | if (!list_empty(&scheduler->n_list)) { |
188 | write_unlock_bh(&__ip_vs_sched_lock); | 188 | write_unlock_bh(&__ip_vs_sched_lock); |
189 | ip_vs_use_count_dec(); | 189 | ip_vs_use_count_dec(); |
190 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " | 190 | IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " |
@@ -229,7 +229,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | write_lock_bh(&__ip_vs_sched_lock); | 231 | write_lock_bh(&__ip_vs_sched_lock); |
232 | if (scheduler->n_list.next == &scheduler->n_list) { | 232 | if (list_empty(&scheduler->n_list)) { |
233 | write_unlock_bh(&__ip_vs_sched_lock); | 233 | write_unlock_bh(&__ip_vs_sched_lock); |
234 | IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " | 234 | IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " |
235 | "is not in the list. failed\n", scheduler->name); | 235 | "is not in the list. failed\n", scheduler->name); |
diff --git a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c index 2a7d31358181..77663d84cbd1 100644 --- a/net/ipv4/ipvs/ip_vs_sed.c +++ b/net/ipv4/ipvs/ip_vs_sed.c | |||
@@ -138,6 +138,7 @@ static struct ip_vs_scheduler ip_vs_sed_scheduler = | |||
138 | .name = "sed", | 138 | .name = "sed", |
139 | .refcnt = ATOMIC_INIT(0), | 139 | .refcnt = ATOMIC_INIT(0), |
140 | .module = THIS_MODULE, | 140 | .module = THIS_MODULE, |
141 | .n_list = LIST_HEAD_INIT(ip_vs_sed_scheduler.n_list), | ||
141 | .init_service = ip_vs_sed_init_svc, | 142 | .init_service = ip_vs_sed_init_svc, |
142 | .done_service = ip_vs_sed_done_svc, | 143 | .done_service = ip_vs_sed_done_svc, |
143 | .update_service = ip_vs_sed_update_svc, | 144 | .update_service = ip_vs_sed_update_svc, |
@@ -147,7 +148,6 @@ static struct ip_vs_scheduler ip_vs_sed_scheduler = | |||
147 | 148 | ||
148 | static int __init ip_vs_sed_init(void) | 149 | static int __init ip_vs_sed_init(void) |
149 | { | 150 | { |
150 | INIT_LIST_HEAD(&ip_vs_sed_scheduler.n_list); | ||
151 | return register_ip_vs_scheduler(&ip_vs_sed_scheduler); | 151 | return register_ip_vs_scheduler(&ip_vs_sed_scheduler); |
152 | } | 152 | } |
153 | 153 | ||
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c index b8fdfac65001..7b979e228056 100644 --- a/net/ipv4/ipvs/ip_vs_sh.c +++ b/net/ipv4/ipvs/ip_vs_sh.c | |||
@@ -230,6 +230,7 @@ static struct ip_vs_scheduler ip_vs_sh_scheduler = | |||
230 | .name = "sh", | 230 | .name = "sh", |
231 | .refcnt = ATOMIC_INIT(0), | 231 | .refcnt = ATOMIC_INIT(0), |
232 | .module = THIS_MODULE, | 232 | .module = THIS_MODULE, |
233 | .n_list = LIST_HEAD_INIT(ip_vs_sh_scheduler.n_list), | ||
233 | .init_service = ip_vs_sh_init_svc, | 234 | .init_service = ip_vs_sh_init_svc, |
234 | .done_service = ip_vs_sh_done_svc, | 235 | .done_service = ip_vs_sh_done_svc, |
235 | .update_service = ip_vs_sh_update_svc, | 236 | .update_service = ip_vs_sh_update_svc, |
@@ -239,7 +240,6 @@ static struct ip_vs_scheduler ip_vs_sh_scheduler = | |||
239 | 240 | ||
240 | static int __init ip_vs_sh_init(void) | 241 | static int __init ip_vs_sh_init(void) |
241 | { | 242 | { |
242 | INIT_LIST_HEAD(&ip_vs_sh_scheduler.n_list); | ||
243 | return register_ip_vs_scheduler(&ip_vs_sh_scheduler); | 243 | return register_ip_vs_scheduler(&ip_vs_sh_scheduler); |
244 | } | 244 | } |
245 | 245 | ||
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 45e9bd96c286..a652da2c3200 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c | |||
@@ -904,9 +904,9 @@ int stop_sync_thread(int state) | |||
904 | * progress of stopping the master sync daemon. | 904 | * progress of stopping the master sync daemon. |
905 | */ | 905 | */ |
906 | 906 | ||
907 | spin_lock(&ip_vs_sync_lock); | 907 | spin_lock_bh(&ip_vs_sync_lock); |
908 | ip_vs_sync_state &= ~IP_VS_STATE_MASTER; | 908 | ip_vs_sync_state &= ~IP_VS_STATE_MASTER; |
909 | spin_unlock(&ip_vs_sync_lock); | 909 | spin_unlock_bh(&ip_vs_sync_lock); |
910 | kthread_stop(sync_master_thread); | 910 | kthread_stop(sync_master_thread); |
911 | sync_master_thread = NULL; | 911 | sync_master_thread = NULL; |
912 | } else if (state == IP_VS_STATE_BACKUP) { | 912 | } else if (state == IP_VS_STATE_BACKUP) { |
diff --git a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c index 772c3cb4eca1..9b0ef86bb1f7 100644 --- a/net/ipv4/ipvs/ip_vs_wlc.c +++ b/net/ipv4/ipvs/ip_vs_wlc.c | |||
@@ -126,6 +126,7 @@ static struct ip_vs_scheduler ip_vs_wlc_scheduler = | |||
126 | .name = "wlc", | 126 | .name = "wlc", |
127 | .refcnt = ATOMIC_INIT(0), | 127 | .refcnt = ATOMIC_INIT(0), |
128 | .module = THIS_MODULE, | 128 | .module = THIS_MODULE, |
129 | .n_list = LIST_HEAD_INIT(ip_vs_wlc_scheduler.n_list), | ||
129 | .init_service = ip_vs_wlc_init_svc, | 130 | .init_service = ip_vs_wlc_init_svc, |
130 | .done_service = ip_vs_wlc_done_svc, | 131 | .done_service = ip_vs_wlc_done_svc, |
131 | .update_service = ip_vs_wlc_update_svc, | 132 | .update_service = ip_vs_wlc_update_svc, |
@@ -135,7 +136,6 @@ static struct ip_vs_scheduler ip_vs_wlc_scheduler = | |||
135 | 136 | ||
136 | static int __init ip_vs_wlc_init(void) | 137 | static int __init ip_vs_wlc_init(void) |
137 | { | 138 | { |
138 | INIT_LIST_HEAD(&ip_vs_wlc_scheduler.n_list); | ||
139 | return register_ip_vs_scheduler(&ip_vs_wlc_scheduler); | 139 | return register_ip_vs_scheduler(&ip_vs_wlc_scheduler); |
140 | } | 140 | } |
141 | 141 | ||
diff --git a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c index 1d6932d7dc97..0d86a79b87b5 100644 --- a/net/ipv4/ipvs/ip_vs_wrr.c +++ b/net/ipv4/ipvs/ip_vs_wrr.c | |||
@@ -212,6 +212,7 @@ static struct ip_vs_scheduler ip_vs_wrr_scheduler = { | |||
212 | .name = "wrr", | 212 | .name = "wrr", |
213 | .refcnt = ATOMIC_INIT(0), | 213 | .refcnt = ATOMIC_INIT(0), |
214 | .module = THIS_MODULE, | 214 | .module = THIS_MODULE, |
215 | .n_list = LIST_HEAD_INIT(ip_vs_wrr_scheduler.n_list), | ||
215 | .init_service = ip_vs_wrr_init_svc, | 216 | .init_service = ip_vs_wrr_init_svc, |
216 | .done_service = ip_vs_wrr_done_svc, | 217 | .done_service = ip_vs_wrr_done_svc, |
217 | .update_service = ip_vs_wrr_update_svc, | 218 | .update_service = ip_vs_wrr_update_svc, |
@@ -220,7 +221,6 @@ static struct ip_vs_scheduler ip_vs_wrr_scheduler = { | |||
220 | 221 | ||
221 | static int __init ip_vs_wrr_init(void) | 222 | static int __init ip_vs_wrr_init(void) |
222 | { | 223 | { |
223 | INIT_LIST_HEAD(&ip_vs_wrr_scheduler.n_list); | ||
224 | return register_ip_vs_scheduler(&ip_vs_wrr_scheduler) ; | 224 | return register_ip_vs_scheduler(&ip_vs_wrr_scheduler) ; |
225 | } | 225 | } |
226 | 226 | ||
diff --git a/net/ipv4/netfilter/ipt_addrtype.c b/net/ipv4/netfilter/ipt_addrtype.c index 49587a497229..462a22c97877 100644 --- a/net/ipv4/netfilter/ipt_addrtype.c +++ b/net/ipv4/netfilter/ipt_addrtype.c | |||
@@ -70,7 +70,7 @@ addrtype_mt_v1(const struct sk_buff *skb, const struct net_device *in, | |||
70 | (info->flags & IPT_ADDRTYPE_INVERT_SOURCE); | 70 | (info->flags & IPT_ADDRTYPE_INVERT_SOURCE); |
71 | if (ret && info->dest) | 71 | if (ret && info->dest) |
72 | ret &= match_type(dev, iph->daddr, info->dest) ^ | 72 | ret &= match_type(dev, iph->daddr, info->dest) ^ |
73 | (info->flags & IPT_ADDRTYPE_INVERT_DEST); | 73 | !!(info->flags & IPT_ADDRTYPE_INVERT_DEST); |
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
diff --git a/net/ipv4/netfilter/nf_nat_proto_common.c b/net/ipv4/netfilter/nf_nat_proto_common.c index 91537f11273f..6c4f11f51446 100644 --- a/net/ipv4/netfilter/nf_nat_proto_common.c +++ b/net/ipv4/netfilter/nf_nat_proto_common.c | |||
@@ -73,9 +73,13 @@ bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple, | |||
73 | range_size = ntohs(range->max.all) - min + 1; | 73 | range_size = ntohs(range->max.all) - min + 1; |
74 | } | 74 | } |
75 | 75 | ||
76 | off = *rover; | ||
77 | if (range->flags & IP_NAT_RANGE_PROTO_RANDOM) | 76 | if (range->flags & IP_NAT_RANGE_PROTO_RANDOM) |
78 | off = net_random(); | 77 | off = secure_ipv4_port_ephemeral(tuple->src.u3.ip, tuple->dst.u3.ip, |
78 | maniptype == IP_NAT_MANIP_SRC | ||
79 | ? tuple->dst.u.all | ||
80 | : tuple->src.u.all); | ||
81 | else | ||
82 | off = *rover; | ||
79 | 83 | ||
80 | for (i = 0; i < range_size; i++, off++) { | 84 | for (i = 0; i < range_size; i++, off++) { |
81 | *portptr = htons(min + off % range_size); | 85 | *portptr = htons(min + off % range_size); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 16fc6f454a31..cca921ea8550 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2914,6 +2914,68 @@ static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, | |||
2914 | return 0; | 2914 | return 0; |
2915 | } | 2915 | } |
2916 | 2916 | ||
2917 | static void rt_secret_reschedule(int old) | ||
2918 | { | ||
2919 | struct net *net; | ||
2920 | int new = ip_rt_secret_interval; | ||
2921 | int diff = new - old; | ||
2922 | |||
2923 | if (!diff) | ||
2924 | return; | ||
2925 | |||
2926 | rtnl_lock(); | ||
2927 | for_each_net(net) { | ||
2928 | int deleted = del_timer_sync(&net->ipv4.rt_secret_timer); | ||
2929 | |||
2930 | if (!new) | ||
2931 | continue; | ||
2932 | |||
2933 | if (deleted) { | ||
2934 | long time = net->ipv4.rt_secret_timer.expires - jiffies; | ||
2935 | |||
2936 | if (time <= 0 || (time += diff) <= 0) | ||
2937 | time = 0; | ||
2938 | |||
2939 | net->ipv4.rt_secret_timer.expires = time; | ||
2940 | } else | ||
2941 | net->ipv4.rt_secret_timer.expires = new; | ||
2942 | |||
2943 | net->ipv4.rt_secret_timer.expires += jiffies; | ||
2944 | add_timer(&net->ipv4.rt_secret_timer); | ||
2945 | } | ||
2946 | rtnl_unlock(); | ||
2947 | } | ||
2948 | |||
2949 | static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write, | ||
2950 | struct file *filp, | ||
2951 | void __user *buffer, size_t *lenp, | ||
2952 | loff_t *ppos) | ||
2953 | { | ||
2954 | int old = ip_rt_secret_interval; | ||
2955 | int ret = proc_dointvec_jiffies(ctl, write, filp, buffer, lenp, ppos); | ||
2956 | |||
2957 | rt_secret_reschedule(old); | ||
2958 | |||
2959 | return ret; | ||
2960 | } | ||
2961 | |||
2962 | static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table, | ||
2963 | int __user *name, | ||
2964 | int nlen, | ||
2965 | void __user *oldval, | ||
2966 | size_t __user *oldlenp, | ||
2967 | void __user *newval, | ||
2968 | size_t newlen) | ||
2969 | { | ||
2970 | int old = ip_rt_secret_interval; | ||
2971 | int ret = sysctl_jiffies(table, name, nlen, oldval, oldlenp, newval, | ||
2972 | newlen); | ||
2973 | |||
2974 | rt_secret_reschedule(old); | ||
2975 | |||
2976 | return ret; | ||
2977 | } | ||
2978 | |||
2917 | static ctl_table ipv4_route_table[] = { | 2979 | static ctl_table ipv4_route_table[] = { |
2918 | { | 2980 | { |
2919 | .ctl_name = NET_IPV4_ROUTE_GC_THRESH, | 2981 | .ctl_name = NET_IPV4_ROUTE_GC_THRESH, |
@@ -3048,8 +3110,8 @@ static ctl_table ipv4_route_table[] = { | |||
3048 | .data = &ip_rt_secret_interval, | 3110 | .data = &ip_rt_secret_interval, |
3049 | .maxlen = sizeof(int), | 3111 | .maxlen = sizeof(int), |
3050 | .mode = 0644, | 3112 | .mode = 0644, |
3051 | .proc_handler = &proc_dointvec_jiffies, | 3113 | .proc_handler = &ipv4_sysctl_rt_secret_interval, |
3052 | .strategy = &sysctl_jiffies, | 3114 | .strategy = &ipv4_sysctl_rt_secret_interval_strategy, |
3053 | }, | 3115 | }, |
3054 | { .ctl_name = 0 } | 3116 | { .ctl_name = 0 } |
3055 | }; | 3117 | }; |
@@ -3126,10 +3188,12 @@ static __net_init int rt_secret_timer_init(struct net *net) | |||
3126 | net->ipv4.rt_secret_timer.data = (unsigned long)net; | 3188 | net->ipv4.rt_secret_timer.data = (unsigned long)net; |
3127 | init_timer_deferrable(&net->ipv4.rt_secret_timer); | 3189 | init_timer_deferrable(&net->ipv4.rt_secret_timer); |
3128 | 3190 | ||
3129 | net->ipv4.rt_secret_timer.expires = | 3191 | if (ip_rt_secret_interval) { |
3130 | jiffies + net_random() % ip_rt_secret_interval + | 3192 | net->ipv4.rt_secret_timer.expires = |
3131 | ip_rt_secret_interval; | 3193 | jiffies + net_random() % ip_rt_secret_interval + |
3132 | add_timer(&net->ipv4.rt_secret_timer); | 3194 | ip_rt_secret_interval; |
3195 | add_timer(&net->ipv4.rt_secret_timer); | ||
3196 | } | ||
3133 | return 0; | 3197 | return 0; |
3134 | } | 3198 | } |
3135 | 3199 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 383d17359d01..8e42fbbd5761 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -989,7 +989,9 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) | |||
989 | up->encap_rcv != NULL) { | 989 | up->encap_rcv != NULL) { |
990 | int ret; | 990 | int ret; |
991 | 991 | ||
992 | bh_unlock_sock(sk); | ||
992 | ret = (*up->encap_rcv)(sk, skb); | 993 | ret = (*up->encap_rcv)(sk, skb); |
994 | bh_lock_sock(sk); | ||
993 | if (ret <= 0) { | 995 | if (ret <= 0) { |
994 | UDP_INC_STATS_BH(sock_net(sk), | 996 | UDP_INC_STATS_BH(sock_net(sk), |
995 | UDP_MIB_INDATAGRAMS, | 997 | UDP_MIB_INDATAGRAMS, |
@@ -1092,7 +1094,7 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb, | |||
1092 | if (skb1) { | 1094 | if (skb1) { |
1093 | int ret = 0; | 1095 | int ret = 0; |
1094 | 1096 | ||
1095 | bh_lock_sock_nested(sk); | 1097 | bh_lock_sock(sk); |
1096 | if (!sock_owned_by_user(sk)) | 1098 | if (!sock_owned_by_user(sk)) |
1097 | ret = udp_queue_rcv_skb(sk, skb1); | 1099 | ret = udp_queue_rcv_skb(sk, skb1); |
1098 | else | 1100 | else |
@@ -1194,7 +1196,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], | |||
1194 | 1196 | ||
1195 | if (sk != NULL) { | 1197 | if (sk != NULL) { |
1196 | int ret = 0; | 1198 | int ret = 0; |
1197 | bh_lock_sock_nested(sk); | 1199 | bh_lock_sock(sk); |
1198 | if (!sock_owned_by_user(sk)) | 1200 | if (!sock_owned_by_user(sk)) |
1199 | ret = udp_queue_rcv_skb(sk, skb); | 1201 | ret = udp_queue_rcv_skb(sk, skb); |
1200 | else | 1202 | else |