[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/LWIP PATCH] Define getaddrinfo() and freeaddrinfo() as functions instead of wrappers


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 23 Aug 2019 14:54:37 +0300
  • Cc: felipe.huici@xxxxxxxxx, charalampos.mainas@xxxxxxxxx, Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
  • Delivery-date: Fri, 23 Aug 2019 11:54:43 +0000
  • Ironport-phdr: 9a23:wT725RZdXPVwc1hWZhVaDJD/LSx+4OfEezUN459isYplN5qZrsW9bnLW6fgltlLVR4KTs6sC17OM9fm8CSdcu96oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vMhm6txjdu8YVjIdtJas91AbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDMi7mrZltJ/g75aoBK5phxw3YjUYJ2ONPFjeq/RZM4WSXZdUspUUSFKH4GyYJYVD+cZIOhWsYf9qVsNoxWwCwajC+HgxSNHiHLtwa030f4sHR3a0AEuHd8DtmnfotXvNKcVVOC41LfFzTLYb/NK2Df97pXDfBY8ofGUQLJ7bM3cxlUoFwPeklWQqIrlMymR1uQQq2ib8vFtWv60i2I9swFxvyOgyt02ionOn48YzE3P+yZhwIstONG1R1N3bcSnHZZQrS2WKZV6T8E4T2xmoCo3yaMKtYS5cSUI0pgr2h/SZv6df4SV5h/uVOCcKipiin1/YrKwnROy/FClyu37S8a7zk5HrjFAktnQrnAN0AHT6tSfRvt94Eih3TGP2hjN6uFBO080lK7bJ4Q9zb4rjJYTqVnDETTslEXsi6+abkQk+u625OT7erjqu5CRO5Juhgz9MqkigNKzDfo6PwQUUWWX4eG826fi/U39TrVKlPo2kqzBvZ/GIsQbvbK5Aw5T0oo57xa/Ei+m0MkDkHYbN1JJYgqHj5XyNF3UOvD4Cu+zg06wnzdz2/DGIrrhD43JLnfZi7fuYat951RHxwo0wtBQ+ohbCrcFLf/yQULxu9nYAQU4Mwyw2eroFNJ91oYGU2KVHqCZKL/SsUOP5u83JumMZYkVuDf6K/g+/vLhkGE2mUEDcqmtxpYXbHG4Hu96I0WCe3btjckOEWEQsgo5Vuzqh0WIUSRPaHaqQ6I8+jY7BZq6AofDXI+tmqaO3COhEZ1TfmBGDUuMHW3td4qeWvcMbjidItR6nzwCS7euV4sh2gu1uwPg1bVnM/Le+jcEupL7yNh1++rTmAk89TNqC8Sd0nmNQH9ukmMIWj823bxwoU1mx1eFz6d3n/hYGsZI6P9TTAg6KM2U8+svDtH0WwXaO9uEVluiatGnGi0qCMI8xZkJeUkuNc+li0Xo2DG2Arlds6GTGdRg+aXHw3n3YcJg02vu37Jnl0QsBNFIYz71zpVj/hTeUtaa236SkLynIOFFhHbA
  • Ironport-sdr: 8cQZD1/UHtYtWDuAiALtiHniS/1pft7MQs2f7upGhks9GI9YXDGjzdRmfFWlZRSj6tHSVU50pF DOGsD39qZcdg==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Please ignore this version, I forgot to add the functions declarations.
The v2 should be considered instead.

Thanks,
Costin

On 8/22/19 3:24 PM, Costin Lupu wrote:
> From: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
> 
> Commit 28138d6d added getaddrinfo() and freeaddrinfo() as wrappers. However,
> it's not necessary for a source file to include the netdb.h header where they
> are defined when it uses them. So their definitions are needed as functions 
> and
> not as macros.
> 
> Signed-off-by: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
> ---
>  exportsyms.uk   |  4 ++--
>  include/netdb.h |  4 ----
>  inet.c          | 14 ++++++++++++++
>  3 files changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/exportsyms.uk b/exportsyms.uk
> index 9df9d0d..856ca8f 100644
> --- a/exportsyms.uk
> +++ b/exportsyms.uk
> @@ -35,7 +35,7 @@ getservbyname
>  getservbyport
>  inet_ntop
>  inet_pton
> -lwip_getaddrinfo
> -lwip_freeaddrinfo
> +getaddrinfo
> +freeaddrinfo
>  gai_strerror
>  getnameinfo
> diff --git a/include/netdb.h b/include/netdb.h
> index d650499..3c8c76d 100644
> --- a/include/netdb.h
> +++ b/include/netdb.h
> @@ -6,10 +6,6 @@
>  #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
>               lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
>  
> -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
> -#define getaddrinfo(nodname, servname, hints, res) \
> -             lwip_getaddrinfo(nodname, servname, hints, res)
> -
>  #endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */
>  
>  struct servent {
> diff --git a/inet.c b/inet.c
> index bbb81a3..903b676 100644
> --- a/inet.c
> +++ b/inet.c
> @@ -44,6 +44,20 @@ int inet_pton(int af, const char *src, void *dst)
>       return lwip_inet_pton(af, src, dst);
>  }
>  
> +#if LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS)
> +int getaddrinfo(const char *node, const char *service,
> +             const struct addrinfo *hints,
> +             struct addrinfo **res)
> +{
> +     return lwip_getaddrinfo(node, service, hints, res);
> +}
> +
> +void freeaddrinfo(struct addrinfo *res)
> +{
> +     return lwip_freeaddrinfo(res);
> +}
> +#endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */
> +
>  /* Note: lwip implementation of getaddrinfo does not return all the errors
>   * codes mentioned in its man page.
>   */
> 

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.