* [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate
@ 2004-02-06 9:10 YOSHIFUJI Hideaki / 吉藤英明
2004-02-06 23:33 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-02-06 9:10 UTC (permalink / raw)
To: davem; +Cc: yoshfuji, netdev
Hello.
[PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate
D: Use cheaper ipv6_addr_any() where appropriate.
Thanks.
--- linux26-recv_ns/net/ipv6/ndisc.c Fri Feb 6 16:38:44 2004
+++ linux26-ipv6_addr_any/net/ipv6/ndisc.c Fri Feb 6 16:58:37 2004
@@ -709,7 +709,7 @@ static void ndisc_recv_ns(struct sk_buff
struct inet6_ifaddr *ifp;
struct inet6_dev *idev = NULL;
struct neighbour *neigh;
- int addr_type = ipv6_addr_type(saddr);
+ int dad = ipv6_addr_any(saddr);
int inc;
if (ipv6_addr_is_multicast(&msg->target)) {
@@ -722,7 +722,7 @@ static void ndisc_recv_ns(struct sk_buff
* RFC2461 7.1.1:
* DAD has to be destined for solicited node multicast address.
*/
- if (addr_type == IPV6_ADDR_ANY &&
+ if (dad &&
!(daddr->s6_addr32[0] == htonl(0xff020000) &&
daddr->s6_addr32[1] == htonl(0x00000000) &&
daddr->s6_addr32[2] == htonl(0x00000001) &&
@@ -752,7 +752,7 @@ static void ndisc_recv_ns(struct sk_buff
* there MUST NOT be source link-layer address option
* in the message.
*/
- if (addr_type == IPV6_ADDR_ANY) {
+ if (dad) {
if (net_ratelimit())
printk(KERN_WARNING "ICMP6 NS: bad DAD packet (link-layer address option)\n");
return;
@@ -768,10 +768,8 @@ static void ndisc_recv_ns(struct sk_buff
does DAD, otherwise we ignore solicitations
until DAD timer expires.
*/
- if (addr_type != IPV6_ADDR_ANY) {
- in6_ifa_put(ifp);
- return;
- }
+ if (!dad)
+ goto out;
if (dev->type == ARPHRD_IEEE802_TR) {
unsigned char *sadr = skb->mac.raw;
if (((sadr[8] ^ dev->dev_addr[0]) & 0x7f) == 0 &&
@@ -781,8 +779,7 @@ static void ndisc_recv_ns(struct sk_buff
sadr[12] == dev->dev_addr[4] &&
sadr[13] == dev->dev_addr[5]) {
/* looped-back to us */
- in6_ifa_put(ifp);
- return;
+ goto out;
}
}
addrconf_dad_failure(ifp);
@@ -820,7 +817,7 @@ static void ndisc_recv_ns(struct sk_buff
goto out;
}
- if (addr_type == IPV6_ADDR_ANY) {
+ if (dad) {
struct in6_addr maddr;
ipv6_addr_all_nodes(&maddr);
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate
2004-02-06 9:10 [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate YOSHIFUJI Hideaki / 吉藤英明
@ 2004-02-06 23:33 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-02-06 23:33 UTC (permalink / raw)
To: yoshfuji; +Cc: netdev
On Fri, 06 Feb 2004 18:10:14 +0900 (JST)
YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[(B <yoshfuji@linux-ipv6.org> wrote:
> [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate
>
> D: Use cheaper ipv6_addr_any() where appropriate.
Also applied. Guess you didn't get all of these cases the other
week when you were making similar changes. :-)
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-06 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-06 9:10 [PATCH 3/3] IPV6: use cheaper ipv6_addr_any() where appropriate YOSHIFUJI Hideaki / 吉藤英明
2004-02-06 23:33 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).