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:
Mark Johnston 2018-07-14 16:06:53 +00:00
parent 9c9c01e43b
commit f6982511f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336281

View File

@ -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);