From: Benjamin Poirier Date: Mon, 11 Dec 2023 14:07:19 +0000 (-0500) Subject: bridge: vlan: Remove paranoid check X-Git-Tag: v6.7.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b8508f44d8554cf80ef92a745c8be813b99fccb;p=thirdparty%2Fiproute2.git bridge: vlan: Remove paranoid check To make the code lighter, remove the check on the actual print_range() output width. In the odd case that an out-of-range, wide vlan id is printed, printf() will treat the negative field width as positive and the output will simply be further misaligned. Suggested-by: Petr Machata Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier Signed-off-by: Stephen Hemminger --- diff --git a/bridge/vlan.c b/bridge/vlan.c index 797b7802a..7a175b047 100644 --- a/bridge/vlan.c +++ b/bridge/vlan.c @@ -661,13 +661,8 @@ static void print_vlan_tunnel_info(struct rtattr *tb, int ifindex) open_json_object(NULL); width = print_range("vlan", last_vid_start, tunnel_vid); - if (width <= VLAN_ID_LEN) { - if (!is_json_context()) - printf("%-*s ", VLAN_ID_LEN - width, ""); - } else { - fprintf(stderr, "BUG: vlan range too wide, %u\n", - width); - } + if (!is_json_context()) + printf("%-*s ", VLAN_ID_LEN - width, ""); print_range("tunid", last_tunid_start, tunnel_id); close_json_object(); print_nl();