mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-12-07 12:41:09 +00:00
Add support for IFALIAS
New 2.6.28 support for text description
This commit is contained in:
parent
1e659af3c0
commit
ace9c96121
@ -281,6 +281,10 @@ int print_linkinfo(const struct sockaddr_nl *who,
|
||||
if (do_link && tb[IFLA_LINKINFO] && show_details)
|
||||
print_linktype(fp, tb[IFLA_LINKINFO]);
|
||||
|
||||
if (do_link && tb[IFLA_IFALIAS])
|
||||
fprintf(fp,"\n alias %s",
|
||||
(const char *) RTA_DATA(tb[IFLA_IFALIAS]));
|
||||
|
||||
if (do_link && tb[IFLA_STATS] && show_stats) {
|
||||
struct rtnl_link_stats slocal;
|
||||
struct rtnl_link_stats *s = RTA_DATA(tb[IFLA_STATS]);
|
||||
|
||||
@ -67,6 +67,7 @@ void iplink_usage(void)
|
||||
fprintf(stderr, " [ broadcast LLADDR ]\n");
|
||||
fprintf(stderr, " [ mtu MTU ]\n");
|
||||
fprintf(stderr, " [ netns PID ]\n");
|
||||
fprintf(stderr, " [ alias NAME ]\n");
|
||||
fprintf(stderr, " ip link show [ DEVICE ]\n");
|
||||
|
||||
if (iplink_have_newlink()) {
|
||||
@ -289,6 +290,12 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
|
||||
*type = *argv;
|
||||
argc--; argv++;
|
||||
break;
|
||||
} else if (matches(*argv, "alias") == 0) {
|
||||
NEXT_ARG();
|
||||
addattr_l(&req->n, sizeof(*req), IFLA_IFALIAS,
|
||||
*argv, strlen(*argv));
|
||||
argc--; argv++;
|
||||
break;
|
||||
} else {
|
||||
if (strcmp(*argv, "dev") == 0) {
|
||||
NEXT_ARG();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user