diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-06-19 11:30:51 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-06-19 11:30:51 +0000 |
commit | 2533bf21126a28f85e40fbfbbc9ba94fdb297530 (patch) | |
tree | 2209a9e1338f055e1b1097ae82d2258afe4f56bc | |
parent | 26be815b86e8d49add8c9a8b320239b9594ff03d (diff) | |
parent | 6fc8d28368b8de624c7d1e7e42db29bb4dceed96 (diff) | |
download | slirp-2533bf21126a28f85e40fbfbbc9ba94fdb297530.zip slirp-2533bf21126a28f85e40fbfbbc9ba94fdb297530.tar.gz slirp-2533bf21126a28f85e40fbfbbc9ba94fdb297530.tar.bz2 |
Merge branch 'strip-ip-header-from-icmp-packet-in-macos' into 'master'
icmp: Handle ICMP packets as IPPROTO_IP on BSD
See merge request slirp/libslirp!133
-rw-r--r-- | src/ip_icmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ip_icmp.c b/src/ip_icmp.c index 6ae523c..755fa3d 100644 --- a/src/ip_icmp.c +++ b/src/ip_icmp.c @@ -34,6 +34,8 @@ #include "slirp.h" #include "ip_icmp.h" +#include <sys/param.h> + #ifndef WITH_ICMP_ERROR_MSG #define WITH_ICMP_ERROR_MSG 0 #endif @@ -100,7 +102,7 @@ static int icmp_send(struct socket *so, struct mbuf *m, int hlen) * isn't possible to detect this difference at runtime, so we must use an * #ifdef to determine if we need to remove the IP header. */ -#ifdef CONFIG_BSD +#if defined(BSD) && !defined(__GNU__) so->so_type = IPPROTO_IP; #else so->so_type = IPPROTO_ICMP; |