Although not required to address bad code generation in
some versions of gcc 9 and 10, a coding style that requires
explicit comparison of the result to zero before use is
both clearer and would have avoided the generation of bad
code.
This change converts all use of cmp function usage from
```
if (strcmp(a, b) || !strcmp(c, d)) ...
```
to
```
if (strcmp(a, b) != 0 || strcmp(c, d)) == 0
```
for all C library cmp functions and related:
- strcmp(), strncmp()
- strcasecmp(), strncasecmp()
- stricmp(), strnicmp()
- memcmp()
Change-Id: Ic60c15e1e3a07e4faaf10648eefe3adae2543188
HP-UX only returns IPv6 addresses using SIOCGLIFCONF,
SIOCGIFCONF has to be used for IPv4 addresses.
Solaris uses the same code as described in the comments, which
should correctly detect all addresses when running in a zone.
This adds the code that went missing from commit e20183da.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
HP-UX only returns IPv6 addresses using SIOCGLIFCONF,
SIOCGIFCONF has to be used for IPv4 addresses.
Solaris uses the same code as described in the comments, which
should correctly detect all addresses when running in a zone.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
It broke detection of IPv4 addresses on HP-UX machines with an IPv6
loopback address. Successful resolution of at least one IPv6 address
would then skip doing a separate IPv4 lookup as required by HP-UX.
This reverts commit 76afc31e9b.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
The libroken-getifaddrs fails to retrive the ipv6-address in
solaris-zones but it might connect over ipv6 anyway, and then the kdc
refuses to give a ticket with the cryptic message:
kinit: krb5_get_init_creds: No ENC-TS found
A saner message ends up in the kdc's logfile.
because of a ENXIO when looking for a ipv6-address on the
ipv4-interface, the whole getlifaddrs2 fails and getifaddrs2 is run
instead and it just discovers the ipv4-address.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
Crash occurs on Linux systems that support AF_NETLINK but do not have
getifaddrs() in libc (eg. SuSE 8.1).
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
message was lost
(free_nlmsglist): free all linked elements, not just the first one
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15640 ec53bebd-3082-4978-b11e-865c3cabbd6b
retrieve addresses larger than `struct sockaddr'. From Magnus Ahltorp
<ahltorp@nada.kth.se> (with some modifications by me)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10794 ec53bebd-3082-4978-b11e-865c3cabbd6b