[Replicant] [PATCH 5/6] Fix implicit declaration of ipv4NetmaskToPrefixLength

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Tue May 7 13:58:03 UTC 2019

Rationale for using extern:
The ipv4NetmaskToPrefixLength function is implemnted
in libnetutils/ifc_utils.c inside the android_system_core

In the lineage-16.0 branch[2]:
- ipv4NetmaskToPrefixLength is not declared in any
  headers in this repository.
- In the same repository, libnetutils/dhcpclient.c uses extern
  for the declaration of ipv4NetmaskToPrefixLength.

[2]At the time of writing it was at the following commit:
   e7f238619 healthd: make periodic battery status a debug message

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
 data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/data.c b/data.c
index 7f7439a..647f9b8 100644
--- a/data.c
+++ b/data.c
@@ -28,6 +28,8 @@
 #include <samsung-ril.h>
 #include <utils.h>
+extern int ipv4NetmaskToPrefixLength(in_addr_t mask);
 int ipc2ril_gprs_fail_cause(unsigned char fail_cause)
 	switch (fail_cause) {

More information about the Replicant mailing list