Skip to content

Commit 864e707

Browse files
committed
LocalIP (Android): don't set --default-route-only to true by default on Android
As we can't detect default route on that platform
1 parent c42b684 commit 864e707

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/data/help.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ Module specific options:
162162
--localip-show-mac <?value>: Show mac addresses in local ip module. Default is false
163163
--localip-show-loop <?value>: Show loop back addresses (127.0.0.1) in local ip module. Default is false
164164
--localip-name-prefix <str>: Show interfaces with given interface name prefix only. Default is empty
165-
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is true
165+
--localip-default-route-only <?value>: Show the interface that is used for default routing only. Default is true on non-android platforms
166166
--localip-compact <?value>: Show all IPs in one line. Default is false
167167
--netio-name-prefix <str>: Show interfaces with given name prefix only. Default is empty
168-
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is true
168+
--netio-default-route-only <?value>: Show the interfac that is used for default routing only. Default is true on non-android platforms
169169
--publicip-timeout <num>: Time in milliseconds to wait for the public ip server to respond. Default is disabled (0)
170170
--publicip-url <str>: The URL of public IP detection server to be used.
171171
--weather-location <str>: Set the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`).

src/modules/localip/localip.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,13 @@ void ffInitLocalIpOptions(FFLocalIpOptions* options)
370370

371371
options->showType = FF_LOCALIP_TYPE_IPV4_BIT;
372372
ffStrbufInit(&options->namePrefix);
373-
options->defaultRouteOnly = true;
373+
options->defaultRouteOnly =
374+
#ifdef __ANDROID__
375+
false
376+
#else
377+
true
378+
#endif
379+
;
374380
}
375381

376382
void ffDestroyLocalIpOptions(FFLocalIpOptions* options)

src/modules/netio/netio.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@ void ffInitNetIOOptions(FFNetIOOptions* options)
230230
ffOptionInitModuleArg(&options->moduleArgs);
231231

232232
ffStrbufInit(&options->namePrefix);
233-
options->defaultRouteOnly = true;
233+
options->defaultRouteOnly =
234+
#ifdef __ANDROID__
235+
false
236+
#else
237+
true
238+
#endif
239+
;
234240
}
235241

236242
void ffDestroyNetIOOptions(FFNetIOOptions* options)

0 commit comments

Comments
 (0)