From: tannerlove Date: Tue, 9 Jun 2020 21:21:32 +0000 (-0400) Subject: selftests/net: in rxtimestamp getopt_long needs terminating null entry X-Git-Tag: v5.10.7~2307^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/rxtimestamp.c b/tools/testing/selftests/net/rxtimestamp.c index 6dee9e6..422e776 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;