Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] amd64: dhcpcd not merging /ppp/peers/resolv.conf
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Sat Jun 15, 2013 6:22 pm    Post subject: [SOLVED] amd64: dhcpcd not merging /ppp/peers/resolv.conf Reply with quote

I'm trying to use an 'identical' configuration set-up betwixt x86 and amd64.

[Ongoing Edit..]
USE="-dhcp" emerge ppp allows a config common between x86 and hardened multi-lib x86_64.
2013-08: no-mulitlib and hardened no-multilib still no such luck
[tidE]

using ppp-2.4.5-r3 and dhcpcd-2.5.4

I should explain in advance, that I 'tend' to build my system from a stage3, with additional
software to make a stage4 without Xorg, then tar-ball it; then add Xorg, and tar-ball that.
These x86 and amd64 were 'made' that way (as stage4) so it is 'unlikely' that they have
configuration differences (other than customization to my domain, window-manager, and
x86- vs amd64-specific make.conf, and so on).

with usepeerdns,
in x86, the /etc/ppp/peers/resolv.conf is properly merged into the /etc/resolv.conf.
in amd64, it is not merged properly (the dns information is missing; .head and .tail are merged).

both ebuilds are installing identically-sized configuration files (but of course the amd64 binaries are
slightly larger).

I've tried installing resolvconf, but it doesn't change the behavior.
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx


Last edited by CleanTestr on Sat Aug 10, 2013 5:12 pm; edited 5 times in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Sun Jun 16, 2013 4:47 pm    Post subject: Reply with quote

With resolvconf you can see all the received information like so

Code:
resolvconf -l


So if either DHCP or PPP DNS is missing then that is at fault at start looking there.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Sun Jun 16, 2013 6:10 pm    Post subject: Reply with quote

output of (on hardened/no-multilib):
Code:
shutdown -r now
pppd call isp
resolvconf -l

Code:
# resolv.conf from lo
# Generated by net-scripts for interface lo
domain my_domain


contents of /etc/ppp/resolv.conf:
nameserver ...
nameserver ...

I'll boot back to x86 and modify this with the x86 results...

output of (on x86-desktop):
Code:
shutdown -r now
pppd call isp
resolvconf -l

Code:
# resolv.conf from lo
# Generated by net-scripts for interface lo
domain my_domain

# resolv.conf from ppp0
# Generated by ppp for ppp0
nameserver ...
nameserver ...


contents of /etc/ppp/resolv.conf:
nameserver ...
nameserver ...

* * *

I'm looking at a file called /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf...
... wondering what provides 'list_interfaces'...

If I execute (on amd64):
Code:
shutdown -r now
pppd call isp
resolvconf -a ppp0 /etc/ppp/resolv.conf
resolvconf -l

I get:
Code:
# resolv.conf from lo
# Generated by net-scripts for interface lo
domain my_domain

# resolv.conf from ppp0
nameserver ...
nameserver ...

...which is *almost* the same, but not quite. :(
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx
Back to top
View user's profile Send private message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Sun Jun 16, 2013 8:44 pm    Post subject: Reply with quote

on amd64:

From dhcpcd's install, in /lib/dhcpcd/dhcpcd-run-hooks, I see:
Code:
state_dir=/var/run/dhcpcd

and from /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf, I see:
Code:
resolv_conf_dir="$state_dir/resolv.conf"


Now, after boot, pppd, in /var/run/dhcpcd/, I find:
Code:
ntp.conf

(which is a directory, which is empty), only.

Which is the same in x86.

Now, /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf contains the line:
Code:
local cf="$state_dir/resolv.conf.$ifname"
..
# Build a list of interfaces
interfaces=$(list_interfaces "$resolv_conf_dir")

# Build the resolv.conf
if [ -n "$interfaces" ]; then
..
fi
..
# Assemble resolv.conf using our head and tail files
..
printf %s "$domain$search$servers" >> "$cf"

All 3 of these ($domain $search $servers) are key-pair lookups in $interfaces, which is
'built' by list_interfaces, which is in /lib/dhcpcd/dhcpcd-run-hooks. Basically
it iterates on interface_order, which seems to be supplied by dhcp.c.
In dhcpcd.h:
Code:
extern struct interface *ifaces;
,
which is filled in by net.c : discover_interfaces, which calls
/usr/include/ifaddrs.h : extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
very properly 'filling in' the '&struct ifaddrs' passed to it, or returning -1 on error (my guess).

In glibc-2.17/inet/ifaddrs.c

Code:
/* Create a linked list of `struct ifaddrs' structures, one for each
   network interface on the host machine.  If successful, store the
   list in *IFAP and return 0.  On errors, return -1 and set `errno'.  */
int
getifaddrs (struct ifaddrs **ifap)
{
  __set_errno (ENOSYS);
  return -1;
}
libc_hidden_def (getifaddrs)
stub_warning (getifaddrs)


My *BaaD*, for using ~amd64 glibc, to get Mixxx running on Gentoo/hardened/no-multilib ;)

Soo...

does this mean that dhcpcd *ought* be using the complementary (assumed to exist)
'method that pppd uses' to write /etc/ppp/resolv.conf in order to write /etc/resolv.conf ??

From ppp-2.4.5/pppd/sys-linux.c:
Code:
Line 1915:  if (ioctl(sock_fd, SIOCGIFCONF, &ifc) < 0) {


Following right along...:

a 'libc_hidden_def' is a:
Code:
#  define __hidden_ver1(local, internal, name) \
extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
extern __typeof (name) __EI_##name \
   __attribute__((alias (__hidden_asmname (#local))))

... so I'm looking for a getifaddrs_internal(..)...

In glibc-2.17/sysdeps/unix/sysv/linux/ifaddrs.c
Code:
static int
getifaddrs_internal (struct ifaddrs **ifap)
{
  struct netlink_handle nh = { 0, 0, 0, NULL, NULL };


And in the glibc-2.17/NEWS: '..have been converted to use the Linux NetLink Api..'
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Mon Jun 17, 2013 4:23 pm    Post subject: Reply with quote

Neither of your two configs have any resolv information obtained via dhcpcd so why are you bringing that into this?

To me it look like pppd is not calling resolvconf to add it's information on one system as you're doing it by hand on the other.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Tue Jun 18, 2013 12:23 am    Post subject: Reply with quote

@UberLord: Because of this:

cat /etc/resolv.conf
Code:
# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line


* * *

What I tried next, is to USE="-dhcp" emerge ppp on both x86 and amd64,
without resolvconf or dhcpcd.

(rename /sbin/resolvconf /sbin/_resolvconf, so the script won't find it)

_resolvconf -l now lists
Code:
# resolv.conf from lo
# Generated by net-scripts for interface lo
domain my_domain


and /etc/resolv.conf contains:
Code:
nameserver ...
nameserver ...


which is what cursory inspection of /etc/ppp/ip-up.d/40-dns.sh would suggest.

For now, I'm going to go with this approach, since it works for me :)

The question remains, why is the behavior of pppd different between x86 and amd64 when USE="dhcp"?
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum