]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
authorMaxime de Roucy <maxime.deroucy@gmail.com>
Mon, 7 Mar 2022 11:40:57 +0000 (12:40 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 12 Mar 2022 03:13:04 +0000 (19:13 -0800)
As Linux-2.0 is getting old and systemd allows non Linux-2.0 compatible
aliases to be set, I think iproute2 should be able to manage such
aliases.

Signed-off-by: Maxime de Roucy <maxime.deroucy@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipaddress.c
man/man8/ip-address.8.in

index 4109d8bd2c43640bee40656c124ea6393d95a345..a14eb31b8b3f84564967dcd4ac1cb08e06fb132c 100644 (file)
@@ -2343,16 +2343,6 @@ static bool ipaddr_is_multicast(inet_prefix *a)
                return false;
 }
 
-static bool is_valid_label(const char *dev, const char *label)
-{
-       size_t len = strlen(dev);
-
-       if (strncmp(label, dev, len) != 0)
-               return false;
-
-       return label[len] == '\0' || label[len] == ':';
-}
-
 static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
 {
        struct {
@@ -2495,12 +2485,6 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
                fprintf(stderr, "Not enough information: \"dev\" argument is required.\n");
                return -1;
        }
-       if (l && !is_valid_label(d, l)) {
-               fprintf(stderr,
-                       "\"label\" (%s) must match \"dev\" (%s) or be prefixed by \"dev\" with a colon.\n",
-                       l, d);
-               return -1;
-       }
 
        if (peer_len == 0 && local_len) {
                if (cmd == RTM_DELADDR && lcl.family == AF_INET && !(lcl.flags & PREFIXLEN_SPECIFIED)) {
index a614ac64d1e722d5eb136c8bfacee45f2cabd08c..1846252df92f980d541d8cfffb43dbf27c1d43e6 100644 (file)
@@ -195,9 +195,6 @@ is derived by setting/resetting the host bits of the interface prefix.
 .TP
 .BI label " LABEL"
 Each address may be tagged with a label string.
-In order to preserve compatibility with Linux-2.0 net aliases,
-this string must coincide with the name of the device or must be prefixed
-with the device name followed by colon.
 The maximum allowed total length of label is 15 characters.
 
 .TP