Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Change-Id: I35ae1e4c7a2e6e1f5e6e6075c77ab7c65533c297
diff --git a/net/test/bpf.py b/net/test/bpf.py
index c9ad264..5e90daa 100755
--- a/net/test/bpf.py
+++ b/net/test/bpf.py
@@ -26,6 +26,7 @@
# TODO: is there a better way of doing this?
__NR_bpf = {
"aarch64": 280,
+ "armv7l": 386,
"armv8l": 386,
"x86_64": 321}[os.uname()[4]]
diff --git a/net/test/csocket.py b/net/test/csocket.py
index bdd501c..ccabf4a 100644
--- a/net/test/csocket.py
+++ b/net/test/csocket.py
@@ -17,6 +17,7 @@
import ctypes
import ctypes.util
import os
+import re
import socket
import struct
@@ -78,9 +79,9 @@
# TODO: Unlike most of this file, these functions aren't specific to wrapping C
# library calls. Move them to a utils.py or constants.py file, once we have one.
def LinuxVersion():
- # Example: "3.4.67-00753-gb7a556f".
- # Get the part before the dash.
- version = os.uname()[2].split("-")[0]
+ # Example: "3.4.67-00753-gb7a556f", "4.4.135+".
+ # Get the prefix consisting of digits and dots.
+ version = re.search("^[0-9.]*", os.uname()[2]).group()
# Convert it into a tuple such as (3, 4, 67). That allows comparing versions
# using < and >, since tuples are compared lexicographically.
version = tuple(int(i) for i in version.split("."))