leamas / ddupdate

Update DNS Data for Dynamic IP Addresses
MIT License
40 stars 28 forks source link

get_ip() fails to get interface of default route #35

Closed bigtonylewis closed 4 years ago

bigtonylewis commented 4 years ago

During ddupdate-config after configuring a service, I get an exception with a final line of: Cannot find address for Device "link" does not exist., giving up

Looking at get_ip(), it parses the output of ip route looking for default and taking the fifth word off that line. For me, that line is: default dev ppp0 scope link, resulting in the word link being parsed from the line. It appears my default route line is different to the one you coded for. My ppp0 interface is configured by pppd.

leamas commented 4 years ago

Thanks for good bug report. Sorry for not replying, ENOTIME... will try to fix shortly, should not be hard.

leamas commented 4 years ago

hm... could you please submit the complete output fromip routeon your box?

bigtonylewis commented 4 years ago

Here it is, with IP addresses randomised. For text parsing purposes, though, it should meet your needs

default dev ppp0 scope link 10.167.0.1 via 10.167.0.168 dev tun0 10.167.0.168 dev tun0 proto kernel scope link src 10.167.0.237 10.100.159.0/24 dev wg0 proto kernel scope link src 10.100.159.179 10.193.230.0/24 via 10.100.159.1 dev wg0 10.153.1.0/24 dev enp2s0f0 proto kernel scope link src 10.153.1.1 metric 100 10.153.179.0/24 dev lxdbr0 proto kernel scope link src 10.153.179.1 133.159.238.101 dev ppp0 proto kernel scope link src 133.159.203.189 169.254.0.0/16 dev wg0 scope link metric 1000

leamas commented 4 years ago

hm... Ok, it looks like I presumed. Could you possibly try the patch I pushed to the devel branch?

bigtonylewis commented 4 years ago

Yes, that seems to work fine for me. I think getting the word after 'dev' looks like the right approach

leamas commented 4 years ago

Fixed in 4c25210, available in 0.6.5.

Closing