LocalIP: fix --localip-default-route-only false not working with --gen-config

Fix #1570
This commit is contained in:
李通洲
2025-02-17 21:29:27 +08:00
parent d1385804bb
commit 399f262692
+4 -4
View File
@@ -419,8 +419,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
if (defaultOptions.showType != options->showType)
{
if (options->showType & FF_LOCALIP_TYPE_IPV4_BIT)
yyjson_mut_obj_add_bool(doc, module, "showIpv4", true);
if (!(options->showType & FF_LOCALIP_TYPE_IPV4_BIT))
yyjson_mut_obj_add_bool(doc, module, "showIpv4", false);
if (options->showType & FF_LOCALIP_TYPE_IPV6_BIT)
yyjson_mut_obj_add_bool(doc, module, "showIpv6", true);
@@ -446,8 +446,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
if (options->showType & FF_LOCALIP_TYPE_COMPACT_BIT)
yyjson_mut_obj_add_bool(doc, module, "compact", true);
if (options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT)
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", true);
if (!(options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT))
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", false);
if (options->showType & FF_LOCALIP_TYPE_ALL_IPS_BIT)
yyjson_mut_obj_add_bool(doc, module, "showAllIps", true);