提交 897217b9 编写于 作者: D David Ahern 提交者: David S. Miller

selftests: Set default protocol for raw sockets in nettest

IPPROTO_IP (0) is not valid for raw sockets. Default the protocol for
raw sockets to IPPROTO_RAW if the protocol has not been set via the -P
option.
Signed-off-by: NDavid Ahern <dsahern@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 77646b63
......@@ -1667,6 +1667,8 @@ int main(int argc, char *argv[])
case 'R':
args.type = SOCK_RAW;
args.port = 0;
if (!args.protocol)
args.protocol = IPPROTO_RAW;
break;
case 'P':
pe = getprotobyname(optarg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册