Skip to content

Commit

Permalink
LocalIP (Android): don't set --default-route-only to true by defaul…
Browse files Browse the repository at this point in the history
…t on Android

As we can't detect default route on that platform
  • Loading branch information
CarterLi committed Nov 7, 2023
1 parent c42b684 commit 864e707
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/data/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ Module specific options:
--localip-show-mac <?value>: Show mac addresses in local ip module. Default is false
--localip-show-loop <?value>: Show loop back addresses (127.0.0.1) in local ip module. Default is false
--localip-name-prefix <str>: Show interfaces with given interface name prefix only. Default is empty
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is true
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is true on non-android platforms
--localip-compact <?value>: Show all IPs in one line. Default is false
--netio-name-prefix <str>: Show interfaces with given name prefix only. Default is empty
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is true
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is true on non-android platforms
--publicip-timeout <num>: Time in milliseconds to wait for the public ip server to respond. Default is disabled (0)
--publicip-url <str>: The URL of public IP detection server to be used.
--weather-location <str>: Set the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`).
Expand Down
8 changes: 7 additions & 1 deletion src/modules/localip/localip.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)

options->showType = FF_LOCALIP_TYPE_IPV4_BIT;
ffStrbufInit(&options->namePrefix);
options->defaultRouteOnly = true;
options->defaultRouteOnly =
#ifdef __ANDROID__
false
#else
true
#endif
;
}

void ffDestroyLocalIpOptions(FFLocalIpOptions* options)
Expand Down
8 changes: 7 additions & 1 deletion src/modules/netio/netio.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ void ffInitNetIOOptions(FFNetIOOptions* options)
ffOptionInitModuleArg(&options->moduleArgs);

ffStrbufInit(&options->namePrefix);
options->defaultRouteOnly = true;
options->defaultRouteOnly =
#ifdef __ANDROID__
false
#else
true
#endif
;
}

void ffDestroyNetIOOptions(FFNetIOOptions* options)
Expand Down

0 comments on commit 864e707

Please sign in to comment.