Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Dec 2019 16:16:43 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355983 - stable/12/sys/dev/vnic
Message-ID:  <201912211616.xBLGGhOA066582@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912211616.xBLGGhOA066582>