mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-07 10:12:53 +03:00
coap_io.c: Track ICMP Host Administravely Prohibited error
Add in tracking for EHOSTUNREACH in coap_network_read().
This commit is contained in:
1 parent
279755b1df
commit
6b32ed3de2
1 file changed
+7
-5
+7
-5
@@ -830,14 +830,16 @@ coap_network_read(coap_socket_t *sock, coap_packet_t *packet) {
|
||||
#endif
|
||||
if (len < 0) {
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() == WSAECONNRESET) {
|
||||
if (WSAGetLastError() == WSAECONNRESET ||
|
||||
WSAGetLastError() == WSAECONNREFUSED) {
|
||||
#else
|
||||
if (errno == ECONNREFUSED) {
|
||||
if (errno == ECONNREFUSED || errno == EHOSTUNREACH) {
|
||||
#endif
|
||||
/* client-side ICMP destination unreachable, ignore it */
|
||||
coap_log(LOG_WARNING, "** %s: coap_network_read: unreachable\n",
|
||||
sock->session ?
|
||||
coap_session_str(sock->session) : "");
|
||||
coap_log(LOG_WARNING, "** %s: coap_network_read: ICMP: %s\n",
|
||||
sock->session ?
|
||||
coap_session_str(sock->session) : "",
|
||||
coap_socket_strerror());
|
||||
return -2;
|
||||
}
|
||||
coap_log(LOG_WARNING, "** %s: coap_network_read: %s\n",
|
||||
|
||||
Reference in new issue
Block a user