From: Yu Watanabe Date: Thu, 4 Jul 2019 20:48:21 +0000 (+0900) Subject: network: fix the initial value of the counter for brvlan X-Git-Tag: v243-rc1~190^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=412ac780acdc9ba431dc0d1a0bd0e3a81cce1f33;p=thirdparty%2Fsystemd.git network: fix the initial value of the counter for brvlan Fixes #12958. --- diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c index f7fa84e293c..cadaaff91dd 100644 --- a/src/network/networkd-brvlan.c +++ b/src/network/networkd-brvlan.c @@ -53,7 +53,7 @@ static int append_vlan_info_data(Link *const link, sd_netlink_message *req, uint assert(br_vid_bitmap); assert(br_untagged_bitmap); - i = cnt = -1; + cnt = 0; begin = end = UINT16_MAX; for (k = 0; k < BRIDGE_VLAN_BITMAP_LEN; k++) { @@ -129,9 +129,8 @@ static int append_vlan_info_data(Link *const link, sd_netlink_message *req, uint i = j; } while (!done); } - if (!cnt) - return -EINVAL; + assert(cnt > 0); return cnt; }