From: David Miller <davem@davemloft.net>
To: sd@queasysnail.net
Cc: netdev@vger.kernel.org, sbrivio@redhat.com, dsahern@gmail.com
Subject: Re: [PATCH net-next v2] ipv6: allow userspace to add IFA_F_OPTIMISTIC addresses
Date: Thu, 01 Mar 2018 13:43:31 -0500 (EST) [thread overview]
Message-ID: <20180301.134331.411913582403902141.davem@davemloft.net> (raw)
In-Reply-To: <8eabe9849c8fd3de711764c64d9e0bf6a4d6825b.1519831327.git.sd@queasysnail.net>
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Wed, 28 Feb 2018 16:40:08 +0100
> According to RFC 4429 (section 3.1), adding new IPv6 addresses as
> optimistic addresses is acceptable, as long as the implementation
> follows some rules:
>
> * Optimistic DAD SHOULD only be used when the implementation is aware
> that the address is based on a most likely unique interface
> identifier (such as in [RFC2464]), generated randomly [RFC3041],
> or by a well-distributed hash function [RFC3972] or assigned by
> Dynamic Host Configuration Protocol for IPv6 (DHCPv6) [RFC3315].
> Optimistic DAD SHOULD NOT be used for manually entered
> addresses.
>
> Thus, it seems reasonable to allow userspace to set the optimistic flag
> when adding new addresses.
>
> We must not let userspace set NODAD + OPTIMISTIC, since if the kernel is
> not performing DAD we would never clear the optimistic flag. We must
> also ignore userspace's request to add OPTIMISTIC flag to addresses that
> have already completed DAD (addresses that don't have the TENTATIVE
> flag, or that have the DADFAILED flag).
>
> Then we also need to clear the OPTIMISTIC flag on permanent addresses
> when DAD fails. Otherwise, IFA_F_OPTIMISTIC addresses added by userspace
> can still be used after DAD has failed, because in
> ipv6_chk_addr_and_flags(), IFA_F_OPTIMISTIC overrides IFA_F_TENTATIVE.
>
> Setting IFA_F_OPTIMISTIC from userspace is conditional on
> CONFIG_IPV6_OPTIMISTIC_DAD and the optimistic_dad sysctl.
>
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Applied, thank you.
prev parent reply other threads:[~2018-03-01 18:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 15:40 [PATCH net-next v2] ipv6: allow userspace to add IFA_F_OPTIMISTIC addresses Sabrina Dubroca
2018-03-01 18:43 ` David Miller [this message]
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=20180301.134331.411913582403902141.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.com \
--cc=sd@queasysnail.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).