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]
Date:   Mon, 8 Apr 2019 15:07:35 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Alan Maguire <alan.maguire@...cle.com>
Cc:     Willem de Bruijn <willemb@...gle.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        David Miller <davem@...emloft.net>,
        Shuah Khan <shuah@...nel.org>, Martin KaFai Lau <kafai@...com>,
        songliubraving@...com, yhs@...com, quentin.monnet@...ronome.com,
        John Fastabend <john.fastabend@...il.com>, rdna@...com,
        linux-kselftest@...r.kernel.org,
        Network Development <netdev@...r.kernel.org>,
        bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH v2 bpf-next 4/4] selftests_bpf: add L2 encap to test_tc_tunnel

On Mon, Apr 8, 2019 at 12:59 PM Alan Maguire <alan.maguire@...cle.com> wrote:
>
> Update test_tc_tunnel to verify adding inner L2 header
> encapsulation (an MPLS label or ethernet header) works.
>
> Signed-off-by: Alan Maguire <alan.maguire@...cle.com>

>  static const int cfg_udp_src = 20000;
>  static const int cfg_udp_dst = 5555;
> +/* MPLSoverUDP */
> +#define MPLS_OVER_UDP_PORT 6635
> +static const int cfg_mplsudp_dst = MPLS_OVER_UDP_PORT;
> +#define        ETH_OVER_UDP_PORT 7777
> +static const int cfg_ethudp_dst = ETH_OVER_UDP_PORT;

nit: static const variables not really needed if duplicating the macro.


> -static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto)
> +static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto,
> +                                     __u16 l2_proto)
>  {
> +       __u32 udp_dst = cfg_udp_dst;

nit: __u16 (as in encap_ipv6)

> -static int decap_ipv4(struct __sk_buff *skb)
> +static __always_inline int decap_ipv4(struct __sk_buff *skb)

unnecessary change? also for decap_ipv6

> +elif [[ "$mac" == "mpls" ]]; then
> +       modprobe mpls_iptunnel ||true
> +       modprobe mpls_gso ||true

this requires adding CONFIG_MPLS and CONFIG_MPLS_IPTUNNEL to
tools/testing/selftests/bpf/config


> +       ip netns exec "${ns2}" sysctl -qw net.mpls.platform_labels=65536
> +       ip netns exec "${ns2}" ip -f mpls route add 1000 dev lo
> +       ip netns exec "${ns2}" ip link set lo up
> +       ip netns exec "${ns2}" sysctl -qw net.mpls.conf.testtun0.input=1
> +       ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.lo.rp_filter=0
> +fi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ