summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authortannerlove <tannerlove@google.com>2020-06-10 00:21:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-20 11:25:04 +0300
commit872aebe7696c7851b99330103aa0376ec51eb316 (patch)
treea79c446f2e7eedb0c4b7fc0bef83bfaa84a2e804 /tools/testing
parentcbebd5a2a63e2e98770b01568c1b5b3f8f0b5bbf (diff)
downloadlinux-872aebe7696c7851b99330103aa0376ec51eb316.tar.xz
selftests/net: in rxtimestamp getopt_long needs terminating null entry
[ Upstream commit 865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/networking/timestamping/rxtimestamp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/networking/timestamping/rxtimestamp.c b/tools/testing/selftests/networking/timestamping/rxtimestamp.c
index dd4162fc0419..7a573fb4c1c4 100644
--- a/tools/testing/selftests/networking/timestamping/rxtimestamp.c
+++ b/tools/testing/selftests/networking/timestamping/rxtimestamp.c
@@ -114,6 +114,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;