aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 02:42:11 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-12 00:43:20 -0400
commitd7aabf22efb50e6d52ed953ed2a43996152a7fb0 (patch)
tree0214416f3a27ab1425f9f90f073dc86730aa2e06
parentf3ee4010e84452aa133e5163e6cfabc52b194e94 (diff)
[IPV6]: Use in6addr_any where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/mcast.c19
2 files changed, 12 insertions, 11 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7df04d294924..e93fa62089f8 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2745,7 +2745,6 @@ static void addrconf_dad_timer(unsigned long data)
2745{ 2745{
2746 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; 2746 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data;
2747 struct inet6_dev *idev = ifp->idev; 2747 struct inet6_dev *idev = ifp->idev;
2748 struct in6_addr unspec;
2749 struct in6_addr mcaddr; 2748 struct in6_addr mcaddr;
2750 2749
2751 read_lock_bh(&idev->lock); 2750 read_lock_bh(&idev->lock);
@@ -2774,9 +2773,8 @@ static void addrconf_dad_timer(unsigned long data)
2774 read_unlock_bh(&idev->lock); 2773 read_unlock_bh(&idev->lock);
2775 2774
2776 /* send a neighbour solicitation for our addr */ 2775 /* send a neighbour solicitation for our addr */
2777 memset(&unspec, 0, sizeof(unspec));
2778 addrconf_addr_solict_mult(&ifp->addr, &mcaddr); 2776 addrconf_addr_solict_mult(&ifp->addr, &mcaddr);
2779 ndisc_send_ns(ifp->idev->dev, NULL, &ifp->addr, &mcaddr, &unspec); 2777 ndisc_send_ns(ifp->idev->dev, NULL, &ifp->addr, &mcaddr, &in6addr_any);
2780out: 2778out:
2781 in6_ifa_put(ifp); 2779 in6_ifa_put(ifp);
2782} 2780}
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