46a5e0e7421bcc47755ae15d430c15a16dc9e03e |
|
21-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
hostname-util: introduce new is_gateway_hostname() call
This moves is_gateway() from nss-myhostname into the basic APIs, and
makes it more like is_localhost(). Also, we rename it to
is_gateway_hostname() to make it more expressive.
Sharing this function in src/basic/ allows us to reuse the function for
routing name requests in resolved (in a later commit). |
f43242886cae3daf0474134175707cbc02c05191 |
|
14-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
nss-myhostname: use LOOPBACK_IFINDEX instead of if_nametoindex("lo")
Given that we already hardocde the loopback ifindex, following the
kernel's own logic, we can replace the invocation of
if_nametoindex("lo") with LOOPBACK_IFINDEX. |
e8a7a315391a6a07897122725cd707f4e9ce63d7 |
|
25-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
nss-myhostname: resolve 'localhost' so that /etc/hosts becomes optional
This makes sure nss-myhostname not only resolves the local host name to
127.0.0.2/::1 but also the host name 'localhost: to 127.0.0.1/::1. This
makes installation of /etc/passwd optional, as it usually only includes
a mapping for 'localhost'.
This change also resolves ::1 to the local hostname (as before), but
also lists 'localhost' as an alias. This means look-ups are now fully
reversible, even though they are 1:n mappings.
Finally, the module will no longer erroneously claim that local IP
addresses which aren't on the loopback device were. |
d2f1f23ad2636cf05589a67b5229c7fd604bc21f |
|
07-Feb-2013 |
Eelco Dolstra <eelco.dolstra@logicblox.com> |
nss-myhostname: copy first result to preallocated buffer
Fixes a segfault in nscd when using nss-myhostname.
Nscd expects that an NSS module's gethostbyname4_r function returns
its first result in the pre-allocated gaih_addrtuple denoted by **pat.
(See nscd/aicache.c in the Glibc sources.) However, nss-myhostname
doesn't fill in **pat but allocates the first result in ‘buffer’, then
sets *pat. So nscd crashes (e.g. when running ‘getent ahosts
my-machine’).
Hard to tell if this is a bug in nscd, since there doesn't seem to be
a proper API spec for gethostbyname4_r. But in any case, this patch
fixes the crash by copying the first result to **pat. |