lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <703510f1-22af-aca1-b066-d2c38fe572b1@cogentembedded.com>
Date:   Tue, 19 Nov 2019 12:25:16 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Andrea Mayer <andrea.mayer@...roma2.it>,
        "David S. Miller" <davem@...emloft.net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Lebrun <dav.lebrun@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [net-next] seg6: allow local packet processing for SRv6 End.DT6
 behavior

On 18.11.2019 21:20, Andrea Mayer wrote:

> End.DT6 behavior makes use of seg6_lookup_nexthop() function which drops
> all packets that are destined to be locally processed. However, DT* should
> be able to delivery decapsulated packets that are destined to local

    Deliver?

> addresses. Function seg6_lookup_nexthop() is also used by DX6, so in order
> to maintain compatibility I created another routing helper function which
> is called seg6_lookup_any_nexthop(). This function is able to take into
> account both packets that have to be processed locally and the ones that
> are destined to be forwarded directly to another machine. Hence,
> seg6_lookup_any_nexthop() is used in DT6 rather than seg6_lookup_nexthop()
> to allow local delivery.
> 
> Signed-off-by: Andrea Mayer <andrea.mayer@...roma2.it>
> ---
>   net/ipv6/seg6_local.c | 22 ++++++++++++++++++----
>   1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
> index e70567446f28..43f3c9f1b4c1 100644
> --- a/net/ipv6/seg6_local.c
> +++ b/net/ipv6/seg6_local.c
> @@ -149,8 +149,9 @@ static void advance_nextseg(struct ipv6_sr_hdr *srh, struct in6_addr *daddr)
>   	*daddr = *addr;
>   }
>   
> -int seg6_lookup_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
> -			u32 tbl_id)
> +static int
> +seg6_lookup_any_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
> +			u32 tbl_id, int local_delivery)
>   {
>   	struct net *net = dev_net(skb->dev);
>   	struct ipv6hdr *hdr = ipv6_hdr(skb);
[...]
> @@ -199,6 +207,12 @@ int seg6_lookup_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
>   	return dst->error;
>   }
>   
> +inline int seg6_lookup_nexthop(struct sk_buff *skb,
> +			       struct in6_addr *nhaddr, u32 tbl_id)
> +{
> +	return seg6_lookup_any_nexthop(skb, nhaddr, tbl_id, false);

    The last parameter to that function is of type *int*, not 'bool'. Be 
consistent please...

> @@ -396,7 +410,7 @@ static int input_action_end_dt6(struct sk_buff *skb,
>   
>   	skb_set_transport_header(skb, sizeof(struct ipv6hdr));
>   
> -	seg6_lookup_nexthop(skb, NULL, slwt->table);
> +	seg6_lookup_any_nexthop(skb, NULL, slwt->table, true);

    Same here, just declare the last parameter as 'bool'.

[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ