net: icmpv4: Return ENETUNREACH when IPv4 is unavailable
net_icmpv4_send_echo_request currently returns EINVAL (invalid argument) when IPv4 is unavailable. Since the availability of IPv4 has nothing to do with the arguments provided to this function and the meaning of EINVAL in this case is ambiguous, return the ENETUNREACH (network is unreachable) error number instead. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
44b43710f2
commit
2c733d5195
1 changed files with 1 additions and 1 deletions
|
@ -513,7 +513,7 @@ int net_icmpv4_send_echo_request(struct net_if *iface,
|
|||
}
|
||||
|
||||
if (!iface->config.ip.ipv4) {
|
||||
return -EINVAL;
|
||||
return -ENETUNREACH;
|
||||
}
|
||||
|
||||
/* Take the first address of the network interface */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue