projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77646b6
)
selftests: Set default protocol for raw sockets in nettest
author
David Ahern
<dsahern@kernel.org>
Thu, 17 Sep 2020 15:13:33 +0000
(09:13 -0600)
committer
David S. Miller
<davem@davemloft.net>
Fri, 18 Sep 2020 00:07:15 +0000
(17:07 -0700)
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: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/nettest.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/net/nettest.c
b/tools/testing/selftests/net/nettest.c
index 93208caacbe6519d7cee86a457fb9172c15655ca..f75c53ce0a2d08c9324bf77681b695afe6d58d9e 100644
(file)
--- a/
tools/testing/selftests/net/nettest.c
+++ b/
tools/testing/selftests/net/nettest.c
@@
-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);