firewall + random init pkt size
This commit is contained in:
1 parent
42eef31a64
commit
dbcd167a85
12 files changed
+286
-4
No files matched your search
@@ -117,6 +117,15 @@ static int instance_init_common(struct UTUN_INSTANCE* instance, struct UASYNC* u
|
||||
DEBUG_INFO(DEBUG_CATEGORY_BGP, "BGP module initialized");
|
||||
}
|
||||
|
||||
// Initialize firewall
|
||||
fw_init(&instance->fw);
|
||||
if (fw_load_rules(&instance->fw, &config->global) != 0) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_CONFIG, "Failed to load firewall rules");
|
||||
} else {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "Firewall initialized: %d rules, bypass_all=%d",
|
||||
instance->fw.count, instance->fw.bypass_all);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -264,6 +273,9 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
|
||||
instance->bgp = NULL;
|
||||
}
|
||||
|
||||
// Cleanup firewall
|
||||
fw_free(&instance->fw);
|
||||
|
||||
// Cleanup config
|
||||
if (instance->config) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "[INSTANCE_DESTROY] Freeing configuration");
|
||||
|
||||
Reference in new issue
Block a user