* [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
@ 2022-03-03 22:14 maxime.deroucy
2022-03-03 22:37 ` Stephen Hemminger
2022-03-04 22:24 ` Stephen Hemminger
0 siblings, 2 replies; 5+ messages in thread
From: maxime.deroucy @ 2022-03-03 22:14 UTC (permalink / raw)
To: netdev
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.
---
ip/ipaddress.c | 16 ----------------
man/man8/ip-address.8.in | 3 ---
2 files changed, 19 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 739b0b9c..a80996ef 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -2349,16 +2349,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 {
@@ -2501,12 +2491,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)) {
diff --git a/man/man8/ip-address.8.in b/man/man8/ip-address.8.in
index a614ac64..1846252d 100644
--- a/man/man8/ip-address.8.in
+++ b/man/man8/ip-address.8.in
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
2022-03-03 22:14 [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases maxime.deroucy
@ 2022-03-03 22:37 ` Stephen Hemminger
2022-03-04 22:24 ` Stephen Hemminger
1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2022-03-03 22:37 UTC (permalink / raw)
To: maxime.deroucy; +Cc: netdev
On Thu, 03 Mar 2022 23:14:55 +0100
maxime.deroucy@gmail.com wrote:
> 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.
> ---
> ip/ipaddress.c | 16 ----------------
> man/man8/ip-address.8.in | 3 ---
> 2 files changed, 19 deletions(-)
Agree that iproute2 shouldn't enforce restrictions that kernel does not.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
2022-03-03 22:14 [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases maxime.deroucy
2022-03-03 22:37 ` Stephen Hemminger
@ 2022-03-04 22:24 ` Stephen Hemminger
2022-03-07 11:23 ` [PATCH] " Maxime de Roucy
2022-03-07 11:32 ` [PATCH v2] " Maxime de Roucy
1 sibling, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2022-03-04 22:24 UTC (permalink / raw)
To: maxime.deroucy; +Cc: netdev
On Thu, 03 Mar 2022 23:14:55 +0100
maxime.deroucy@gmail.com wrote:
> 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.
> ---
> ip/ipaddress.c | 16 ----------------
> man/man8/ip-address.8.in | 3 ---
> 2 files changed, 19 deletions(-)
Sorry, this patch is missing Signed-off-by:
Please resubmit and run it through checkpatch to make sure it
is correct format.
ERROR: patch seems to be corrupt (line wrapped?)
#93: FILE: ip/ipaddress.c:2348:
return false;
ERROR: Missing Signed-off-by: line(s)
total: 2 errors, 0 warnings, 43 lines checked
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
2022-03-04 22:24 ` Stephen Hemminger
@ 2022-03-07 11:23 ` Maxime de Roucy
2022-03-07 11:32 ` [PATCH v2] " Maxime de Roucy
1 sibling, 0 replies; 5+ messages in thread
From: Maxime de Roucy @ 2022-03-07 11:23 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Maxime de Roucy
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>
---
ip/ipaddress.c | 16 ----------------
man/man8/ip-address.8.in | 3 ---
2 files changed, 19 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 739b0b9c..a80996ef 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -2349,16 +2349,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 {
@@ -2501,12 +2491,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)) {
diff --git a/man/man8/ip-address.8.in b/man/man8/ip-address.8.in
index a614ac64..1846252d 100644
--- a/man/man8/ip-address.8.in
+++ b/man/man8/ip-address.8.in
@@ -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
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases
2022-03-04 22:24 ` Stephen Hemminger
2022-03-07 11:23 ` [PATCH] " Maxime de Roucy
@ 2022-03-07 11:32 ` Maxime de Roucy
1 sibling, 0 replies; 5+ messages in thread
From: Maxime de Roucy @ 2022-03-07 11:32 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Maxime de Roucy
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>
---
ip/ipaddress.c | 16 ----------------
man/man8/ip-address.8.in | 3 ---
2 files changed, 19 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 739b0b9c..a80996ef 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -2349,16 +2349,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 {
@@ -2501,12 +2491,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)) {
diff --git a/man/man8/ip-address.8.in b/man/man8/ip-address.8.in
index a614ac64..1846252d 100644
--- a/man/man8/ip-address.8.in
+++ b/man/man8/ip-address.8.in
@@ -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
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-07 11:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 22:14 [PATCH iproute2-next] ipaddress: remove 'label' compatibility with Linux-2.0 net aliases maxime.deroucy
2022-03-03 22:37 ` Stephen Hemminger
2022-03-04 22:24 ` Stephen Hemminger
2022-03-07 11:23 ` [PATCH] " Maxime de Roucy
2022-03-07 11:32 ` [PATCH v2] " Maxime de Roucy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.