summaryrefslogtreecommitdiff
path: root/src/ptunnel.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-12-24 12:25:15 +0100
committerToni Uhlig <matzeton@googlemail.com>2018-12-24 12:25:15 +0100
commit2c7c3b62df2661b3276253fb3d8d624d81c398a2 (patch)
tree6e774153116d03025fcfce95e5ed3016af25fa96 /src/ptunnel.c
parent021b6847054cec55303efeec22a179397ce88165 (diff)
added additional autoconf ICMP_FILTER compile check
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/ptunnel.c')
-rw-r--r--src/ptunnel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ptunnel.c b/src/ptunnel.c
index f640d1b..9f435f9 100644
--- a/src/ptunnel.c
+++ b/src/ptunnel.c
@@ -388,7 +388,9 @@ void* pt_proxy(void *args) {
in_addr_t *adr;
#endif
struct in_addr in_addr;
+#ifdef HAVE_ICMPFILTER
struct icmp_filter filt;
+#endif
/* Start the thread, initialize protocol and ring states. */
pt_log(kLog_debug, "Starting ping proxy..\n");
@@ -411,9 +413,11 @@ void* pt_proxy(void *args) {
else {
pt_log(kLog_debug, "Attempting to create privileged ICMP raw socket..\n");
fwd_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+#ifdef HAVE_ICMPFILTER
filt.data = ~((1<<ICMP_ECHO) | (1<<ICMP_ECHOREPLY));
if (setsockopt(fwd_sock, SOL_RAW, ICMP_FILTER, &filt, sizeof filt) == -1)
pt_log(kLog_error, "setockopt for ICMP_FILTER: %s\n", strerror(errno));
+#endif
}
if (fwd_sock < 0) {
pt_log(kLog_error, "Couldn't create %s socket: %s\n",