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: <CABawtvMgVqA-zyOn7g+gSmqgTY9nG2vtEm_pan2F_huXz__Kfw@mail.gmail.com>
Date:   Thu, 6 Jul 2017 17:03:54 +0800
From:   Ethan Zhao <ethan.kernel@...il.com>
To:     Zheng Li <lizheng043@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>, vyasevich@...il.com,
        nhorman@...driver.com, linux-sctp@...r.kernel.org,
        David Miller <davem@...emloft.net>, jmorris@...ei.org,
        james.z.li@...csson.com, allen.y.zhao@...csson.com,
        feng.qiu@...csson.com
Subject: Re: [PATCH] sctp: set the value of flowi6_oif to sk_bound_dev_if to
 make sctp_v6_get_dst to find the correct route entry.

Zheng,

On Thu, Jul 6, 2017 at 3:00 PM, Zheng Li <lizheng043@...il.com> wrote:
> From: Zheng Li <james.z.li@...csson.com>
>
> if there are several same route entries with different outgoing net device,
> application's socket specifies the oif through setsockopt with
> SO_BINDTODEVICE, sctpv6 should choose the route entry whose outgoing net
> device is the oif which was specified by socket, set the value of
> flowi6_oif to sk->sk_bound_dev_if to make sctp_v6_get_dst to find the
> correct route entry.
>
> Signed-off-by: Zheng Li <james.z.li@...csson.com>
> ---
>  net/sctp/ipv6.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index f5b45b8..2a186b20 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -252,6 +252,8 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
>         fl6->flowi6_proto = IPPROTO_SCTP;
>         if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
>                 fl6->flowi6_oif = daddr->v6.sin6_scope_id;
> +       else if (asoc)
> +               fl6->flowi6_oif = asoc->base.sk->sk_bound_dev_if;

  Yes, ipv4 does the same way,  but sctp ipv4 code aslo set the
source port to htons(asoc->base.bind_addr.port) meanwhile;
:>

Thanks,
Ethan

>
>         pr_debug("%s: dst=%pI6 ", __func__, &fl6->daddr);
>
> --
> 2.7.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ