diff --git a/src/igmp.c b/src/igmp.c index 729d323..5d86efc 100644 --- a/src/igmp.c +++ b/src/igmp.c @@ -643,11 +643,16 @@ void send_igmp(uint32_t src, uint32_t dst, int type, int code, uint32_t group, i rc = sendto(igmp_socket, send_buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)); if (rc < 0) { - if (errno == ENETDOWN) + switch (errno) { + case ENETUNREACH: + case ENETDOWN: check_vif_state(); - else + break; + default: logit(igmp_log_level(type, code), errno, "sendto to %s on %s", inet_fmt(dst, s1, sizeof(s1)), inet_fmt(src, s2, sizeof(s2))); + break; + } } if (setloop) diff --git a/src/ipip.c b/src/ipip.c index 4e463e1..c706eb8 100644 --- a/src/ipip.c +++ b/src/ipip.c @@ -114,11 +114,16 @@ void send_ipip(uint32_t src, uint32_t dst, int type, int code, uint32_t group, i msg.msg_iov = iov; msg.msg_iovlen = 2; if (sendmsg(raw_socket, &msg, 0) < 0) { - if (errno == ENETDOWN) + switch (errno) { + case ENETUNREACH: + case ENETDOWN: check_vif_state(); - else + break; + default: logit(LOG_WARNING, errno, "sendmsg to %s on %s", inet_fmt(sdst.sin_addr.s_addr, s1, sizeof(s1)), inet_fmt(src, s2, sizeof(s2))); + break; + } } IF_DEBUG(DEBUG_PKT|igmp_debug_kind(type, code))