diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-09-02 16:57:42 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-09-02 16:57:42 +0000 |
commit | 7a8cbc5288ec0cf6efa966254bd4dd8973486bc9 (patch) | |
tree | 82be10b664f011d94f220f3451e1e35c5f4c5b96 | |
parent | 1874c61b90eee5dab03842031db3685b876b1134 (diff) | |
download | src-7a8cbc5288ec0cf6efa966254bd4dd8973486bc9.tar.gz src-7a8cbc5288ec0cf6efa966254bd4dd8973486bc9.zip |
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.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20685
Notes
Notes:
svn path=/head/; revision=351703
-rw-r--r-- | sys/compat/linux/linux_mib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index 99c7065f72dc..d74313056b32 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -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); |