diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:49:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:49:40 -0500 |
commit | 0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (patch) | |
tree | 454d1842b1833d976da62abcbd5c47521ebe9bd7 /net/ipv6/mcast.c | |
parent | 54a696bd07c14d3b1192d03ce7269bc59b45209a (diff) | |
parent | eb56092fc168bf5af199d47af50c0d84a96db898 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits)
net: Allow dependancies of FDDI & Tokenring to be modular.
igb: Fix build warning when DCA is disabled.
net: Fix warning fallout from recent NAPI interface changes.
gro: Fix potential use after free
sfc: If AN is enabled, always read speed/duplex from the AN advertising bits
sfc: When disabling the NIC, close the device rather than unregistering it
sfc: SFT9001: Add cable diagnostics
sfc: Add support for multiple PHY self-tests
sfc: Merge top-level functions for self-tests
sfc: Clean up PHY mode management in loopback self-test
sfc: Fix unreliable link detection in some loopback modes
sfc: Generate unique names for per-NIC workqueues
802.3ad: use standard ethhdr instead of ad_header
802.3ad: generalize out mac address initializer
802.3ad: initialize ports LACPDU from const initializer
802.3ad: remove typedef around ad_system
802.3ad: turn ports is_individual into a bool
802.3ad: turn ports is_enabled into a bool
802.3ad: make ntt bool
ixgbe: Fix set_ringparam in ixgbe to use the same memory pools.
...
Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due
to the conversion to %pI (in this networking merge) and the addition of
doing IPv6 addresses (from the earlier merge of CIFS).
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index d7b3c6d398ae..a51fb33e6864 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -303,20 +303,23 @@ static struct inet6_dev *ip6_mc_find_dev(struct net *net, | |||
303 | dev = dev_get_by_index(net, ifindex); | 303 | dev = dev_get_by_index(net, ifindex); |
304 | 304 | ||
305 | if (!dev) | 305 | if (!dev) |
306 | return NULL; | 306 | goto nodev; |
307 | idev = in6_dev_get(dev); | 307 | idev = in6_dev_get(dev); |
308 | if (!idev) { | 308 | if (!idev) |
309 | dev_put(dev); | 309 | goto release; |
310 | return NULL; | ||
311 | } | ||
312 | read_lock_bh(&idev->lock); | 310 | read_lock_bh(&idev->lock); |
313 | if (idev->dead) { | 311 | if (idev->dead) |
314 | read_unlock_bh(&idev->lock); | 312 | goto unlock_release; |
315 | in6_dev_put(idev); | 313 | |
316 | dev_put(dev); | ||
317 | return NULL; | ||
318 | } | ||
319 | return idev; | 314 | return idev; |
315 | |||
316 | unlock_release: | ||
317 | read_unlock_bh(&idev->lock); | ||
318 | in6_dev_put(idev); | ||
319 | release: | ||
320 | dev_put(dev); | ||
321 | nodev: | ||
322 | return NULL; | ||
320 | } | 323 | } |
321 | 324 | ||
322 | void ipv6_sock_mc_close(struct sock *sk) | 325 | void ipv6_sock_mc_close(struct sock *sk) |
@@ -1466,7 +1469,7 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1466 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1469 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1467 | skb->dev->ifindex); | 1470 | skb->dev->ifindex); |
1468 | 1471 | ||
1469 | err = xfrm_lookup(&skb->dst, &fl, NULL, 0); | 1472 | err = xfrm_lookup(net, &skb->dst, &fl, NULL, 0); |
1470 | if (err) | 1473 | if (err) |
1471 | goto err_out; | 1474 | goto err_out; |
1472 | 1475 | ||
@@ -1817,7 +1820,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1817 | 1820 | ||
1818 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, | 1821 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, |
1819 | IPPROTO_ICMPV6, | 1822 | IPPROTO_ICMPV6, |
1820 | csum_partial((__u8 *) hdr, len, 0)); | 1823 | csum_partial(hdr, len, 0)); |
1821 | 1824 | ||
1822 | idev = in6_dev_get(skb->dev); | 1825 | idev = in6_dev_get(skb->dev); |
1823 | 1826 | ||
@@ -1831,7 +1834,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1831 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, | 1834 | &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
1832 | skb->dev->ifindex); | 1835 | skb->dev->ifindex); |
1833 | 1836 | ||
1834 | err = xfrm_lookup(&skb->dst, &fl, NULL, 0); | 1837 | err = xfrm_lookup(net, &skb->dst, &fl, NULL, 0); |
1835 | if (err) | 1838 | if (err) |
1836 | goto err_out; | 1839 | goto err_out; |
1837 | 1840 | ||
@@ -2430,9 +2433,9 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v) | |||
2430 | struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); | 2433 | struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); |
2431 | 2434 | ||
2432 | seq_printf(seq, | 2435 | seq_printf(seq, |
2433 | "%-4d %-15s " NIP6_SEQFMT " %5d %08X %ld\n", | 2436 | "%-4d %-15s %pi6 %5d %08X %ld\n", |
2434 | state->dev->ifindex, state->dev->name, | 2437 | state->dev->ifindex, state->dev->name, |
2435 | NIP6(im->mca_addr), | 2438 | &im->mca_addr, |
2436 | im->mca_users, im->mca_flags, | 2439 | im->mca_users, im->mca_flags, |
2437 | (im->mca_flags&MAF_TIMER_RUNNING) ? | 2440 | (im->mca_flags&MAF_TIMER_RUNNING) ? |
2438 | jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0); | 2441 | jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0); |
@@ -2591,10 +2594,10 @@ static int igmp6_mcf_seq_show(struct seq_file *seq, void *v) | |||
2591 | "Source Address", "INC", "EXC"); | 2594 | "Source Address", "INC", "EXC"); |
2592 | } else { | 2595 | } else { |
2593 | seq_printf(seq, | 2596 | seq_printf(seq, |
2594 | "%3d %6.6s " NIP6_SEQFMT " " NIP6_SEQFMT " %6lu %6lu\n", | 2597 | "%3d %6.6s %pi6 %pi6 %6lu %6lu\n", |
2595 | state->dev->ifindex, state->dev->name, | 2598 | state->dev->ifindex, state->dev->name, |
2596 | NIP6(state->im->mca_addr), | 2599 | &state->im->mca_addr, |
2597 | NIP6(psf->sf_addr), | 2600 | &psf->sf_addr, |
2598 | psf->sf_count[MCAST_INCLUDE], | 2601 | psf->sf_count[MCAST_INCLUDE], |
2599 | psf->sf_count[MCAST_EXCLUDE]); | 2602 | psf->sf_count[MCAST_EXCLUDE]); |
2600 | } | 2603 | } |