diff options
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index c2dc2e2b6c07..54f91efdae58 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1404,6 +1404,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size) | |||
1404 | struct sk_buff *skb; | 1404 | struct sk_buff *skb; |
1405 | struct mld2_report *pmr; | 1405 | struct mld2_report *pmr; |
1406 | struct in6_addr addr_buf; | 1406 | struct in6_addr addr_buf; |
1407 | const struct in6_addr *saddr; | ||
1407 | int err; | 1408 | int err; |
1408 | u8 ra[8] = { IPPROTO_ICMPV6, 0, | 1409 | u8 ra[8] = { IPPROTO_ICMPV6, 0, |
1409 | IPV6_TLV_ROUTERALERT, 2, 0, 0, | 1410 | IPV6_TLV_ROUTERALERT, 2, 0, 0, |
@@ -1422,10 +1423,11 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size) | |||
1422 | * use unspecified address as the source address | 1423 | * use unspecified address as the source address |
1423 | * when a valid link-local address is not available. | 1424 | * when a valid link-local address is not available. |
1424 | */ | 1425 | */ |
1425 | memset(&addr_buf, 0, sizeof(addr_buf)); | 1426 | saddr = &in6addr_any; |
1426 | } | 1427 | } else |
1428 | saddr = &addr_buf; | ||
1427 | 1429 | ||
1428 | ip6_nd_hdr(sk, skb, dev, &addr_buf, &mld2_all_mcr, NEXTHDR_HOP, 0); | 1430 | ip6_nd_hdr(sk, skb, dev, saddr, &mld2_all_mcr, NEXTHDR_HOP, 0); |
1429 | 1431 | ||
1430 | memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra)); | 1432 | memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra)); |
1431 | 1433 | ||
@@ -1766,7 +1768,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1766 | struct inet6_dev *idev; | 1768 | struct inet6_dev *idev; |
1767 | struct sk_buff *skb; | 1769 | struct sk_buff *skb; |
1768 | struct icmp6hdr *hdr; | 1770 | struct icmp6hdr *hdr; |
1769 | const struct in6_addr *snd_addr; | 1771 | const struct in6_addr *snd_addr, *saddr; |
1770 | struct in6_addr *addrp; | 1772 | struct in6_addr *addrp; |
1771 | struct in6_addr addr_buf; | 1773 | struct in6_addr addr_buf; |
1772 | int err, len, payload_len, full_len; | 1774 | int err, len, payload_len, full_len; |
@@ -1805,10 +1807,11 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1805 | * use unspecified address as the source address | 1807 | * use unspecified address as the source address |
1806 | * when a valid link-local address is not available. | 1808 | * when a valid link-local address is not available. |
1807 | */ | 1809 | */ |
1808 | memset(&addr_buf, 0, sizeof(addr_buf)); | 1810 | saddr = &in6addr_any; |
1809 | } | 1811 | } else |
1812 | saddr = &addr_buf; | ||
1810 | 1813 | ||
1811 | ip6_nd_hdr(sk, skb, dev, &addr_buf, snd_addr, NEXTHDR_HOP, payload_len); | 1814 | ip6_nd_hdr(sk, skb, dev, saddr, snd_addr, NEXTHDR_HOP, payload_len); |
1812 | 1815 | ||
1813 | memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra)); | 1816 | memcpy(skb_put(skb, sizeof(ra)), ra, sizeof(ra)); |
1814 | 1817 | ||
@@ -1819,7 +1822,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type) | |||
1819 | addrp = (struct in6_addr *) skb_put(skb, sizeof(struct in6_addr)); | 1822 | addrp = (struct in6_addr *) skb_put(skb, sizeof(struct in6_addr)); |
1820 | ipv6_addr_copy(addrp, addr); | 1823 | ipv6_addr_copy(addrp, addr); |
1821 | 1824 | ||
1822 | hdr->icmp6_cksum = csum_ipv6_magic(&addr_buf, snd_addr, len, | 1825 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, snd_addr, len, |
1823 | IPPROTO_ICMPV6, | 1826 | IPPROTO_ICMPV6, |
1824 | csum_partial((__u8 *) hdr, len, 0)); | 1827 | csum_partial((__u8 *) hdr, len, 0)); |
1825 | 1828 | ||