diff --git a/src/firewall.c b/src/firewall.c index 0a0dad65..814b5a72 100644 --- a/src/firewall.c +++ b/src/firewall.c @@ -686,3 +686,9 @@ ev_fw_sync_with_authserver(struct wd_request_context *context) } } +void +conntrack_flush() +{ + debug(LOG_DEBUG, "Flush conntrack"); + execute("conntrack -F", 0); +} \ No newline at end of file diff --git a/src/firewall.h b/src/firewall.h index 168abeb5..6aff0385 100644 --- a/src/firewall.h +++ b/src/firewall.h @@ -125,4 +125,6 @@ void ev_fw_sync_with_authserver(struct wd_request_context *); /** @brief */ void ev_fw_sync_with_authserver_v2(struct wd_request_context *); +void conntrack_flush(); + #endif /* _FIREWALL_H_ */ diff --git a/src/gateway.c b/src/gateway.c index cb5f26ab..6ddf6c0d 100644 --- a/src/gateway.c +++ b/src/gateway.c @@ -355,6 +355,7 @@ wd_init(s_config *config) } #if 1 + conntrack_flush(); /* Reset the firewall (if WiFiDog crashed) */ fw_destroy(); /* Then initialize it */