diff --git a/tc/f_bpf.c b/tc/f_bpf.c index afc2e582..5c97c863 100644 --- a/tc/f_bpf.c +++ b/tc/f_bpf.c @@ -71,9 +71,6 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle, struct rtattr *tail; int ret = 0; - if (argc == 0) - return 0; - if (handle) { if (get_u32(&t->tcm_handle, handle, 0)) { fprintf(stderr, "Illegal \"handle\"\n"); @@ -81,6 +78,9 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle, } } + if (argc == 0) + return 0; + tail = (struct rtattr *)(((void *)n) + NLMSG_ALIGN(n->nlmsg_len)); addattr_l(n, MAX_MSG, TCA_OPTIONS, NULL, 0);