Skip to content

Commit

Permalink
slirp: Prevent sending ICMP error replies to source-only addresses
Browse files Browse the repository at this point in the history
This triggered the related assert in arp_table_search.

Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Feb 8, 2012
1 parent 9f1134d commit 6612db1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions slirp/ip_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ icmp_error(struct mbuf *msrc, u_char type, u_char code, int minsize,
#endif
if(ip->ip_off & IP_OFFMASK) goto end_error; /* Only reply to fragment 0 */

/* Do not reply to source-only IPs */
if ((ip->ip_src.s_addr & htonl(~(0xf << 28))) == 0) {
goto end_error;
}

shlen=ip->ip_hl << 2;
s_ip_len=ip->ip_len;
if(ip->ip_p == IPPROTO_ICMP) {
Expand Down

0 comments on commit 6612db1

Please sign in to comment.