Skip to content

Commit

Permalink
selftests/net: in rxtimestamp getopt_long needs terminating null entry
Browse files Browse the repository at this point in the history
[ Upstream commit 865a6cb ]

getopt_long requires the last element to be filled with zeros.
Otherwise, passing an unrecognized option can cause a segfault.

Fixes: 16e7812 ("selftests/net: Add a test to validate behavior of rx timestamps")
Signed-off-by: Tanner Love <[email protected]>
Acked-by: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tannerlove authored and gregkh committed Jun 17, 2020
1 parent 05e275d commit 57bad9e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57bad9e

Please sign in to comment.