On Thu, 2015-09-24 at 15:38 -0700, Naveen Singh wrote:
> Isn't the IPv4 or IPv6 address passed as an argument to
> __connman_ntp_start a character array? We would still need to convert
> this character array to the IP addresses and for that we would need to
> know the family. Do you think there is any other way to do this
> without using inet_pton (which requires the family knowledge). Let me
> know.

Since the string is always an address, a shortcut would be to use
getaddrinfo() directly with hints.ai_flags = AI_NUMERICHOST. This is
what connman_inet_check_ipaddress() does, but in start_ntp() the address
is also needed, not only the address family.

The point is that the conversion from string to addres and address
family need to be done only when needed to make the patch smaller and
less intrusive.

Cheers,

        Patrik



_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to