Commit ca97a644 authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

ipv6: Introduce ipv6_addr_is_solict_mult() to check Solicited Node Multicast Addresses.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b27b28cb
...@@ -305,6 +305,14 @@ static inline bool ipv6_addr_is_isatap(const struct in6_addr *addr) ...@@ -305,6 +305,14 @@ static inline bool ipv6_addr_is_isatap(const struct in6_addr *addr)
return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
} }
static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
{
return (addr->s6_addr32[0] == htonl(0xff020000) &&
addr->s6_addr32[1] == htonl(0x00000000) &&
addr->s6_addr32[2] == htonl(0x00000001) &&
addr->s6_addr[12] == 0xff);
}
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int if6_proc_init(void); extern int if6_proc_init(void);
extern void if6_proc_exit(void); extern void if6_proc_exit(void);
......
...@@ -685,11 +685,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) ...@@ -685,11 +685,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
* RFC2461 7.1.1: * RFC2461 7.1.1:
* DAD has to be destined for solicited node multicast address. * DAD has to be destined for solicited node multicast address.
*/ */
if (dad && if (dad && !ipv6_addr_is_solict_mult(daddr)) {
!(daddr->s6_addr32[0] == htonl(0xff020000) &&
daddr->s6_addr32[1] == htonl(0x00000000) &&
daddr->s6_addr32[2] == htonl(0x00000001) &&
daddr->s6_addr [12] == 0xff )) {
ND_PRINTK(2, warn, "NS: bad DAD packet (wrong destination)\n"); ND_PRINTK(2, warn, "NS: bad DAD packet (wrong destination)\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment