提交 d4795d75 编写于 作者: T tannerlove 提交者: Yang Yingliang

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: 16e78122 ("selftests/net: Add a test to validate behavior of rx timestamps")
Signed-off-by: NTanner Love <tannerlove@google.com>
Acked-by: NWillem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a7604647
...@@ -114,6 +114,7 @@ static struct option long_options[] = { ...@@ -114,6 +114,7 @@ static struct option long_options[] = {
{ "tcp", no_argument, 0, 't' }, { "tcp", no_argument, 0, 't' },
{ "udp", no_argument, 0, 'u' }, { "udp", no_argument, 0, 'u' },
{ "ip", no_argument, 0, 'i' }, { "ip", no_argument, 0, 'i' },
{ NULL, 0, NULL, 0 },
}; };
static int next_port = 19999; static int next_port = 19999;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册