aboutsummaryrefslogtreecommitdiff
path: root/src/ip_icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ip_icmp.c')
-rw-r--r--src/ip_icmp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ip_icmp.c b/src/ip_icmp.c
index 7590cff..58e35a5 100644
--- a/src/ip_icmp.c
+++ b/src/ip_icmp.c
@@ -190,7 +190,12 @@ void icmp_input(struct mbuf *m, int hlen)
/* Send the packet */
addr = so->fhost.ss;
- sotranslate_out(so, &addr);
+ if (sotranslate_out(so, &addr) < 0) {
+ icmp_send_error(m, ICMP_UNREACH, ICMP_UNREACH_NET, 0,
+ strerror(errno));
+ udp_detach(so);
+ return;
+ }
if (sendto(so->s, icmp_ping_msg, strlen(icmp_ping_msg), 0,
(struct sockaddr *)&addr, sockaddr_size(&addr)) == -1) {