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

Joonas Kylmälä joonas.kylmala at iki.fi
Sun Jun 2 17:32:14 UTC 2019


Hi,

somebody who knows C better please review this!

Joonas

Denis 'GNUtoo' Carikli:
> Rationale for using extern:
> ---------------------------
> The ipv4NetmaskToPrefixLength function is implemnted
> in libnetutils/ifc_utils.c inside the android_system_core
> repository[1].
> 
> 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.
> 
> References:
> -----------
> [1]https://github.com/LineageOS/android_system_core
> [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