Skip to content

Commit

Permalink
tc:flower: allow to set 'police' for flower
Browse files Browse the repository at this point in the history
Signed-off-by: Volodymyr Bendiuga <[email protected]>
  • Loading branch information
voldymyr authored and ekez-graw committed Dec 6, 2018
1 parent d71da1d commit bf4dd6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ enum {
TCA_FLOWER_KEY_IP_TOS_MASK, /* u8 */
TCA_FLOWER_KEY_IP_TTL, /* u8 */
TCA_FLOWER_KEY_IP_TTL_MASK, /* u8 */
TCA_FLOWER_POLICE,

TCA_FLOWER_KEY_CVLAN_ID, /* be16 */
TCA_FLOWER_KEY_CVLAN_PRIO, /* u8 */
Expand Down
12 changes: 12 additions & 0 deletions tc/f_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,13 @@ static int flower_parse_opt(struct filter_util *qu, char *handle,
return -1;
}
continue;
} else if (matches(*argv, "police") == 0) {
NEXT_ARG();
if (parse_police(&argc, &argv, TCA_FLOWER_POLICE, n)) {
fprintf(stderr, "Illegal \"police\"\n");
return -1;
}
continue;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
Expand Down Expand Up @@ -1594,6 +1601,11 @@ static int flower_print_opt(struct filter_util *qu, FILE *f,
if (tb[TCA_FLOWER_ACT])
tc_print_action(f, tb[TCA_FLOWER_ACT], 0);

if (tb[TCA_FLOWER_POLICE]) {
fprintf(f, "\n");
tc_print_police(f, tb[TCA_FLOWER_POLICE]);
}

return 0;
}

Expand Down

0 comments on commit bf4dd6a

Please sign in to comment.