Fix vnic fallback PHY name matching after r334880.
In some cases it seems that the PHY mode can only be identified by matching against the corresponding device node name in the FDT. r334880 broke this for the case where the node name contains a unit address. Fix the problem by allowing a match in that case. Reviewed by: andrew, sbruno Tested by: sbruno Differential Revision: https://reviews.freebsd.org/D16259
This commit is contained in:
parent
9c9c01e43b
commit
f6982511f8
@ -193,7 +193,8 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name, ssize_t size)
|
||||
|
||||
if (sz > size)
|
||||
return (FALSE);
|
||||
if (strncmp(phy_name, type, sz) == 0)
|
||||
if (strncmp(phy_name, type, sz - 1) == 0 &&
|
||||
(phy_name[sz - 1] == '\0' || phy_name[sz - 1] == '@'))
|
||||
return (TRUE);
|
||||
|
||||
return (FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user