[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070406.125154.73441979.yoshfuji@linux-ipv6.org>
Date: Fri, 06 Apr 2007 12:51:54 +0900 (JST)
From: YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@...ux-ipv6.org>
To: brian.haley@...com
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 4/4] Add loopback address type inline
In article <4615BCBD.2030607@...com> (at Thu, 05 Apr 2007 23:21:33 -0400), Brian Haley <brian.haley@...com> says:
> Add loopback address type inline to avoid calls to ipv6_addr_type().
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index f6aa338..7f1aabe 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -455,8 +455,9 @@ int ip6_forward(struct sk_buff *skb)
> */
> if (xrlim_allow(dst, 1*HZ))
> ndisc_send_redirect(skb, n, target);
> - } else if (ipv6_addr_type(&hdr->saddr)&(IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK
> - |IPV6_ADDR_LINKLOCAL)) {
> + } else if (ipv6_addr_type_multicast(&hdr->saddr) ||
> + ipv6_addr_loopback(&hdr->saddr) ||
> + ipv6_addr_scope_linklocal(&hdr->saddr)) {
> /* This check is security critical. */
> goto error;
> }
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 32c6398..06ee92d 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1067,7 +1067,6 @@ int ip6_route_add(struct fib6_config *cfg)
> struct net_device *dev = NULL;
> struct inet6_dev *idev = NULL;
> struct fib6_table *table;
> - int addr_type;
>
> if (cfg->fc_dst_len > 128 || cfg->fc_src_len > 128)
> return -EINVAL;
> @@ -1108,9 +1107,7 @@ int ip6_route_add(struct fib6_config *cfg)
> cfg->fc_protocol = RTPROT_BOOT;
> rt->rt6i_protocol = cfg->fc_protocol;
>
> - addr_type = ipv6_addr_type(&cfg->fc_dst);
> -
> - if (addr_type & IPV6_ADDR_MULTICAST)
> + if (ipv6_addr_type_multicast(&cfg->fc_dst))
> rt->u.dst.input = ip6_mc_input;
> else
> rt->u.dst.input = ip6_forward;
different commit...
--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists