mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
77646b63ff
commit
897217b9a0
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue