Skip to content

Commit 0554543

Browse files
committed
bonding: fix parsing miimon,hashing_type,min_links from netlink
#430 Fixes: 8460c9b ('link/bonding: implement parsing link type')
1 parent 641cd0e commit 0554543

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

include/netlink/utils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ enum {
361361
NL_CAPABILITY_VERSION_3_14_0 = 40,
362362
#define NL_CAPABILITY_VERSION_3_14_0 NL_CAPABILITY_VERSION_3_14_0
363363

364+
/**
365+
* Fixes parsing bonding properties miimon, hashing_type, and
366+
* min_links from netlink.
367+
*/
368+
NL_CAPABILITY_ROUTE_FIX_PARSE_BONDING = 41,
369+
#define NL_CAPABILITY_ROUTE_FIX_PARSE_BONDING NL_CAPABILITY_ROUTE_FIX_PARSE_BONDING
370+
364371
__NL_CAPABILITY_MAX,
365372
NL_CAPABILITY_MAX = (__NL_CAPABILITY_MAX - 1),
366373
#define NL_CAPABILITY_MAX NL_CAPABILITY_MAX

lib/route/link/bonding.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int bond_info_parse(struct rtnl_link *link, struct nlattr *data,
9090
}
9191

9292
if (tb[IFLA_BOND_MIIMON]) {
93-
bn->hashing_type = nla_get_u32(tb[IFLA_BOND_MIIMON]);
93+
bn->miimon = nla_get_u32(tb[IFLA_BOND_MIIMON]);
9494
bn->ce_mask |= BOND_HAS_MIIMON;
9595
}
9696

@@ -100,7 +100,7 @@ static int bond_info_parse(struct rtnl_link *link, struct nlattr *data,
100100
}
101101

102102
if (tb[IFLA_BOND_MIN_LINKS]) {
103-
bn->hashing_type = nla_get_u32(tb[IFLA_BOND_MIN_LINKS]);
103+
bn->min_links = nla_get_u32(tb[IFLA_BOND_MIN_LINKS]);
104104
bn->ce_mask |= BOND_HAS_MIN_LINKS;
105105
}
106106

lib/utils.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,15 @@ int nl_has_capability (int capability)
12891289
0, /* NL_CAPABILITY_VERSION_3_12_0 */
12901290
0, /* NL_CAPABILITY_VERSION_3_13_0 */
12911291
0), /* NL_CAPABILITY_VERSION_3_14_0 */
1292+
_NL_SET (5,
1293+
NL_CAPABILITY_ROUTE_FIX_PARSE_BONDING,
1294+
0,
1295+
0,
1296+
0,
1297+
0,
1298+
0,
1299+
0,
1300+
0),
12921301
/* IMPORTANT: these capability numbers are intended to be universal and stable
12931302
* for libnl3. Don't allocate new numbers on your own that differ from upstream
12941303
* libnl3.

0 commit comments

Comments
 (0)