From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] ipv4/ipv6: Prepare for new route gateway semantics.
Date: Fri, 27 Jan 2012 06:24:18 +0900 [thread overview]
Message-ID: <4F21C482.4070707@linux-ipv6.org> (raw)
In-Reply-To: <20120126.155544.2054995753871805122.davem@davemloft.net>
Hello.
David Miller wrote:
>
> In the future the ipv4/ipv6 route gateway will take on two types
> of values:
>
> 1) INADDR_ANY/IN6ADDR_ANY, for local network routes, and in this case
> the neighbour must be obtained using the destination address in
> ipv4/ipv6 header as the lookup key.
>
> 2) Everything else, the actual nexthop route address.
>
> So if the gateway is not inaddr-any we use it, otherwise we must use
> the packet's destination address.
>
> Signed-off-by: David S. Miller<davem@davemloft.net>
> ---
> net/ipv4/route.c | 5 +++++
> net/ipv6/route.c | 16 +++++++++++++++-
> 2 files changed, 20 insertions(+), 1 deletions(-)
>
:
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 8c2e3ab..7d7f306 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -121,9 +121,23 @@ static u32 *ipv6_cow_metrics(struct dst_entry *dst, unsigned long old)
> return p;
> }
>
> +static inline const void *choose_neigh_daddr(struct rt6_info *rt, const void *daddr)
> +{
> + struct in6_addr *p =&rt->rt6i_gateway;
> +
> + if (p->s6_addr32[0] | p->s6_addr32[1] |
> + p->s6_addr32[2] | p->s6_addr32[3])
> + return (const void *) p;
> + return daddr;
> +}
> +
Why not use ipv6_addr_any()?
--yoshfuji
next prev parent reply other threads:[~2012-01-26 21:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 20:55 [PATCH 1/2] ipv4/ipv6: Prepare for new route gateway semantics David Miller
2012-01-26 21:24 ` YOSHIFUJI Hideaki [this message]
2012-01-26 21:29 ` David Miller
2012-01-27 18:59 ` Brent Cook
2012-01-27 21:34 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F21C482.4070707@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.