Skip to content

Commit 399f262

Browse files
committed
LocalIP: fix --localip-default-route-only false not working with --gen-config
Fix #1570
1 parent d138580 commit 399f262

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/modules/localip/localip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
419419

420420
if (defaultOptions.showType != options->showType)
421421
{
422-
if (options->showType & FF_LOCALIP_TYPE_IPV4_BIT)
423-
yyjson_mut_obj_add_bool(doc, module, "showIpv4", true);
422+
if (!(options->showType & FF_LOCALIP_TYPE_IPV4_BIT))
423+
yyjson_mut_obj_add_bool(doc, module, "showIpv4", false);
424424

425425
if (options->showType & FF_LOCALIP_TYPE_IPV6_BIT)
426426
yyjson_mut_obj_add_bool(doc, module, "showIpv6", true);
@@ -446,8 +446,8 @@ void ffGenerateLocalIpJsonConfig(FFLocalIpOptions* options, yyjson_mut_doc* doc,
446446
if (options->showType & FF_LOCALIP_TYPE_COMPACT_BIT)
447447
yyjson_mut_obj_add_bool(doc, module, "compact", true);
448448

449-
if (options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT)
450-
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", true);
449+
if (!(options->showType & FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT))
450+
yyjson_mut_obj_add_bool(doc, module, "defaultRouteOnly", false);
451451

452452
if (options->showType & FF_LOCALIP_TYPE_ALL_IPS_BIT)
453453
yyjson_mut_obj_add_bool(doc, module, "showAllIps", true);

0 commit comments

Comments
 (0)