diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-11-01 07:17:40 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-11-01 07:17:40 (GMT) |
commit | 4267d8f336b11e8fbbf1a4b54499ee19012b1b28 (patch) | |
tree | 4349cb1f09cc204f50a2555565359d486d2ce694 /src/nl-qdisc-list.c | |
parent | 7903d6ab4bc54421463517a116e93eef2448e92c (diff) | |
download | libnl-4267d8f336b11e8fbbf1a4b54499ee19012b1b28.zip libnl-4267d8f336b11e8fbbf1a4b54499ee19012b1b28.tar.gz libnl-4267d8f336b11e8fbbf1a4b54499ee19012b1b28.tar.bz2 |
classid auto generation if provided tc name does not exist
Manually editing etc/libnl/classid before adding tc objects is a pain.
This patch adds code to attempt auto generating a unique tc id which
will then be assigned to the provided name and added to the classid
file.
This will make the following commands work with prior definitions of
the names "top" and "test"
sudo sbin/nl-qdisc-add --dev eth0 --parent root --id top htb
sudo sbin/nl-class-add --dev eth0 --parent top --id test htb --rate 100mbit
It will generate the following ids automatically:
4001: top
4001:1 test
Diffstat (limited to 'src/nl-qdisc-list.c')
-rw-r--r-- | src/nl-qdisc-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nl-qdisc-list.c b/src/nl-qdisc-list.c index 1ecb9a4..de24fde 100644 --- a/src/nl-qdisc-list.c +++ b/src/nl-qdisc-list.c @@ -85,7 +85,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': nl_cli_tc_parse_handle(tc, optarg, 0); break; case 'k': nl_cli_qdisc_parse_kind(qdisc, optarg); break; } } |