Author: markj
Date: Sat Dec 21 16:16:43 2019
New Revision: 355983
URL: https://svnweb.freebsd.org/changeset/base/355983

Log:
  MFC r355887:
  vnic: Relax PHY node matching after r336281.
  
  PR:   242654

Modified:
  stable/12/sys/dev/vnic/thunder_bgx_fdt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/vnic/thunder_bgx_fdt.c
==============================================================================
--- stable/12/sys/dev/vnic/thunder_bgx_fdt.c    Sat Dec 21 16:08:34 2019        
(r355982)
+++ stable/12/sys/dev/vnic/thunder_bgx_fdt.c    Sat Dec 21 16:16:43 2019        
(r355983)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/bitset.h>
 #include <sys/bitstring.h>
 #include <sys/bus.h>
+#include <sys/ctype.h>
 #include <sys/endian.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
@@ -151,6 +152,7 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name
 {
        const char *type;
        ssize_t sz;
+       char last;
 
        switch (bgx->qlm_mode) {
        case QLM_MODE_SGMII:
@@ -193,10 +195,11 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name
 
        if (sz > size)
                return (FALSE);
-       if (strncmp(phy_name, type, sz - 1) == 0 &&
-           (phy_name[sz - 1] == '\0' || phy_name[sz - 1] == '@'))
-               return (TRUE);
-
+       if (strncmp(phy_name, type, sz - 1) == 0) {
+               last = phy_name[sz - 1];
+               if (last == '\0' || last == '@' || isdigit(last))
+                       return (TRUE);
+       }
        return (FALSE);
 }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to