]> xenbits.xensource.com Git - freebsd.git/commitdiff
Relax compat.linux.osrelease checks. This way one can do eg
authortrasz <trasz@FreeBSD.org>
Mon, 2 Sep 2019 16:57:42 +0000 (16:57 +0000)
committertrasz <trasz@FreeBSD.org>
Mon, 2 Sep 2019 16:57:42 +0000 (16:57 +0000)
'compat.linux.osrelease=3.10.0-957.12.1.el7.x86_64', which
corresponds to CentOS 7.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20685

sys/compat/linux/linux_mib.c

index 99c7065f72dc6042439bf65749dc0076211252af..d74313056b32a0adc11cf030fca0f7bee6158e8a 100644 (file)
@@ -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);