summaryrefslogtreecommitdiffstats
path: root/src/nl-class-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nl-class-add.c')
-rw-r--r--src/nl-class-add.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nl-class-add.c b/src/nl-class-add.c
index 553dec1..80ea826 100644
--- a/src/nl-class-add.c
+++ b/src/nl-class-add.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
struct nl_cli_qdisc_module *qm;
struct rtnl_class_ops *ops;
int err, flags = NLM_F_CREATE | NLM_F_EXCL;
- char *kind;
+ char *kind, *id = NULL;
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_ROUTE);
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
case 'v': nl_cli_print_version(); break;
case 'd': nl_cli_tc_parse_dev(tc, link_cache, optarg); break;
case 'p': nl_cli_tc_parse_parent(tc, optarg); break;
- case 'i': nl_cli_tc_parse_handle(tc, optarg); break;
+ case 'i': id = strdup(optarg); break;
case ARG_UPDATE: flags = NLM_F_CREATE; break;
case ARG_UPDATE_ONLY: flags = 0; break;
case ARG_MTU: nl_cli_tc_parse_mtu(tc, optarg); break;
@@ -125,6 +125,11 @@ int main(int argc, char *argv[])
if (!rtnl_tc_get_parent(tc))
nl_cli_fatal(EINVAL, "You must specify a parent (--parent=XXX)");
+ if (id) {
+ nl_cli_tc_parse_handle(tc, id, 1);
+ free(id);
+ }
+
kind = argv[optind++];
rtnl_class_set_kind(class, kind);