[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_35777FB65087C7C646A80431@qq.com>
Date: Fri, 8 Mar 2024 14:42:42 +0800
From: "陈嘉昀" <jiayunchen@...il.nju.edu.cn>
To: "netdev" <netdev@...r.kernel.org>
Subject: puzzling features on ip change/replace
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
Powered by blists - more mailing lists