net: icmp: Fix return values of ICMP error send function
The return code from net_icmpv{4|6}_send_error() was not correct if the error message could be sent. Now 0 is returned if sending succeed, and <0 otherwise. Change-Id: Iff67f097a9d9519c9f11d4cbc9cf428a7c74ec1b Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
8ae7bb257f
commit
430e271751
|
@ -272,7 +272,7 @@ int net_icmpv4_send_error(struct net_buf *orig, uint8_t type, uint8_t code)
|
|||
|
||||
if (net_send_data(buf) >= 0) {
|
||||
net_stats_update_icmp_sent();
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drop:
|
||||
|
@ -281,8 +281,5 @@ drop:
|
|||
drop_no_buf:
|
||||
net_stats_update_icmp_drop();
|
||||
|
||||
/* Note that we always return < 0 so that the caller knows to
|
||||
* discard the original buffer.
|
||||
*/
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -310,7 +310,7 @@ int net_icmpv6_send_error(struct net_buf *orig, uint8_t type, uint8_t code,
|
|||
|
||||
if (net_send_data(buf) >= 0) {
|
||||
net_stats_update_icmp_sent();
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drop:
|
||||
|
@ -319,9 +319,6 @@ drop:
|
|||
drop_no_buf:
|
||||
net_stats_update_icmp_drop();
|
||||
|
||||
/* Note that we always return < 0 so that the caller knows to
|
||||
* discard the original buffer.
|
||||
*/
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue