netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>, netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Ido Schimmel <idosch@idosch.org>
Subject: Re: [PATCHv2 net-next] IPv4: add extack info for IPv4 address add/delete
Date: Fri, 18 Aug 2023 18:33:50 -0600	[thread overview]
Message-ID: <012be13c-b18c-b548-9d0a-f820a8ebfc8f@kernel.org> (raw)
In-Reply-To: <20230818082523.1972307-1-liuhangbin@gmail.com>

On 8/18/23 2:25 AM, Hangbin Liu wrote:
> Add extack info for IPv4 address add/delete, which would be useful for
> users to understand the problem without having to read kernel code.
> 
> No extack message for the ifa_local checking in __inet_insert_ifa() as
> it has been checked in find_matching_ifa().
> 
> Suggested-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> v2: Lowercase all ipv4 prefix. use one extack msg for ifa_valid checking.
> ---
>  net/ipv4/devinet.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 5deac0517ef7..c3658b8755bc 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -509,6 +509,7 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
>  				return -EEXIST;
>  			}
>  			if (ifa1->ifa_scope != ifa->ifa_scope) {
> +				NL_SET_ERR_MSG(extack, "ipv4: Invalid scope value");

It's not necessarily an invalid scope, but rather it differs from other
configured addresses on the device. That check goes back to the
beginning of git history, and I do not really get why it matters.

Overall looks ok to me:

Reviewed-by: David Ahern <dsahern@kernel.org>


  reply	other threads:[~2023-08-19  0:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  8:25 [PATCHv2 net-next] IPv4: add extack info for IPv4 address add/delete Hangbin Liu
2023-08-19  0:33 ` David Ahern [this message]
2023-08-19 15:15 ` Ido Schimmel
2023-08-21  6:40 ` patchwork-bot+netdevbpf

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=012be13c-b18c-b548-9d0a-f820a8ebfc8f@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@idosch.org \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).