svn commit: r364217 - stable/12/sys/compat/linux

Edward Tomasz Napierala trasz at FreeBSD.org
Thu Aug 13 19:07:07 UTC 2020


Author: trasz
Date: Thu Aug 13 19:07:07 2020
New Revision: 364217
URL: https://svnweb.freebsd.org/changeset/base/364217

Log:
  MFC r351703:
  
  Relax compat.linux.osrelease checks.  This way one can do eg
  'compat.linux.osrelease=3.10.0-957.12.1.el7.x86_64', which
  corresponds to CentOS 7.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/compat/linux/linux_mib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_mib.c
==============================================================================
--- stable/12/sys/compat/linux/linux_mib.c	Thu Aug 13 19:05:51 2020	(r364216)
+++ stable/12/sys/compat/linux/linux_mib.c	Thu Aug 13 19:07:07 2020	(r364217)
@@ -146,7 +146,8 @@ linux_map_osrel(char *osrelease, int *osrel)
 		return (EINVAL);
 	osrelease = sep + 1;
 	v2 = strtol(osrelease, &sep, 10);
-	if (osrelease == sep || sep != eosrelease)
+	if (osrelease == sep ||
+	    (sep != eosrelease && (sep + 1 >= eosrelease || *sep != '-')))
 		return (EINVAL);
 
 	v = LINUX_KERNVER(v0, v1, v2);


More information about the svn-src-stable-12 mailing list