netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 陈嘉昀 <jiayunchen@smail.nju.edu.cn>
To: netdev <netdev@vger.kernel.org>
Subject: puzzling features on ip change/replace
Date: Fri, 8 Mar 2024 14:42:42 +0800	[thread overview]
Message-ID: <tencent_35777FB65087C7C646A80431@qq.com> (raw)

Hi all,

I am testing some basic features for iproute2. When I test the usage of 'ip change', the manual seems not to offer enough information.

The synopsis tells that:

```
 ip address { add | change | replace } IFADDR dev IFNAME [
               LIFETIME ] [ CONFFLAG-LIST ]
```

and IFADDR can be impelemented as:

```
IFADDR := PREFIX | ADDR peer PREFIX [ broadcast ADDR ] [ anycast
               ADDR ] [ label LABEL ] [ scope SCOPE-ID ] [ proto
               ADDRPROTO ]
```

So I am confusing about whether parts of IFADDR can be changed through 'ip change' command or 'ip change' command can only change the LIFETIME?

Here is my test scenario:

```
ip addr add 1.1.1.1/32 dev eth0 label eth0:X # this command works, adding a new ip addr to eth0 with label X, exited with 0

ip addr add 2.2.2.2/32 dev eth0 label eth0:Y

ip addr change 1.1.1.1/32 dev eth0 label eth0:Y # this command also exits with 0, but it takes no effect in fact.
```

And when I try to check the info:

```
ip addr show dev eth0 label eth0:Y # it shows the ip 2.2.2.2/32 only.
```

It's natural to manage the ip address through the label in the real scenarios, but this behavior really puzzles. At least, it should display some error message if the change command is failed, rather than pretend that nothing happened and exit 0 slightly.

Maybe I can pull a patch on documentation to explain this? Or fix the return code for my third command?


Cheers,
Chen Jiayun

                 reply	other threads:[~2024-03-08  6:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=tencent_35777FB65087C7C646A80431@qq.com \
    --to=jiayunchen@smail.nju.edu.cn \
    --cc=netdev@vger.kernel.org \
    /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).