summaryrefslogtreecommitdiff
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authortannerlove <tannerlove@google.com>2020-06-09 17:21:32 -0400
committerDavid S. Miller <davem@davemloft.net>2020-06-09 14:31:33 -0700
commit865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e (patch)
treea887b5bc589ed6af7a7c0d9331b28092cb37a0a0 /tools/testing/selftests
parent62a502cc91f97e3ffd312d9b42e8d01a137c63ff (diff)
downloadlwn-865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e.tar.gz
lwn-865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e.zip
selftests/net: in rxtimestamp getopt_long needs terminating null entry
getopt_long requires the last element to be filled with zeros. Otherwise, passing an unrecognized option can cause a segfault. Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps") Signed-off-by: Tanner Love <tannerlove@google.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/net/rxtimestamp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/rxtimestamp.c b/tools/testing/selftests/net/rxtimestamp.c
index 6dee9e636a95..422e7761254d 100644
--- a/tools/testing/selftests/net/rxtimestamp.c
+++ b/tools/testing/selftests/net/rxtimestamp.c
@@ -115,6 +115,7 @@ static struct option long_options[] = {
{ "tcp", no_argument, 0, 't' },
{ "udp", no_argument, 0, 'u' },
{ "ip", no_argument, 0, 'i' },
+ { NULL, 0, NULL, 0 },
};
static int next_port = 19999;