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 {
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)) {
.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