Skip to content

Commit

Permalink
mvls: Bind to all devlink devices matching mv88e6*
Browse files Browse the repository at this point in the history
In recent kernels (at least 6.5), the devlink driver is reported as
"mv88e6085" instead of "mv88e6xxx". Relax the requirement on the
driver name to any string beginning with "mv88e6", which should be
backwards compatible as well.
  • Loading branch information
wkz committed Sep 6, 2023
1 parent 42c91ef commit c9534ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mvls/mvls.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ static int env_init_dev_cb(const struct nlmsghdr *nlh, void *_env)
!tb[DEVLINK_ATTR_INFO_DRIVER_NAME])
return MNL_CB_ERROR;

if (strcmp("mv88e6xxx",
mnl_attr_get_str(tb[DEVLINK_ATTR_INFO_DRIVER_NAME])))
if (strncmp("mv88e6",
mnl_attr_get_str(tb[DEVLINK_ATTR_INFO_DRIVER_NAME]), 6))
return MNL_CB_OK;

mnl_attr_for_each(ver, nlh, sizeof(struct genlmsghdr)) {
Expand Down

0 comments on commit c9534ff

Please sign in to comment.