Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 386161 - net-dns/ddclient-3.8.1-r3 unable to determine IP address
Summary: net-dns/ddclient-3.8.1-r3 unable to determine IP address
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Aaron W. Swenson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 22:26 UTC by Clemens Noss
Modified: 2012-04-19 15:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Noss 2011-10-07 22:26:59 UTC
When ddclient is called directly, with command line arguments, with the ip address not determined by a wrapper script, i.e. -use=<anything but ip>, the ip address cannot be determined.

When reading the code /usr/sbin/ddclient, searching for "use", the code appears to be buggy, causing exactly this behaviour.

Reproducible: Always

Steps to Reproduce:
Reproducibility: Happens, when trying to use ddclient with command line arguments, unless workarounds are in place.

1. ddclient -daemon=0 -syslog -use=if -if=ppp0 -verbose
2.
3.
Actual Results:  
WARNING: unable to determine IP address

Expected Results:  
SUCCESS: ...

The code forces the "use" configuration variable to "ip", requiring the ip address to be set on the command line. This takes precedence over any attempt to unset it in the config file, in fact, unsetting it constitutes an invalid value.

This configuration variable takes precedence over the command line option, overriding the commandline option unconditionally, as there is no way the config variable can be empty.

So the arguments "-use=if -if=ppp0" become effectively "-use=ip ip=". Unless the intended command line arg is set in the config file (that is the workaround). The workaround is undesirable as it still breaks the commandline option "use=".

This used to work before.

It is likely that the bug is in the upstream version, I did not check completely for patches. But it seems unlikely that nobody found it before...

My suggestion for the code is to leave the default for {use} empty and change
-my $use = $config{$h}{'use'} || opt('use');
to
+my $use = opt('use') || $config{$h}{'use'} || "ip";
Comment 1 Aaron W. Swenson gentoo-dev 2011-10-12 20:01:06 UTC
Yes, this is definitely an upstream issue. We can fix it here.
Comment 2 Aaron W. Swenson gentoo-dev 2011-11-13 16:42:58 UTC
  13 Nov 2011; Aaron W. Swenson <titanofold@gentoo.org>
  +ddclient-3.8.1-r4.ebuild, +files/cmd-over-cfg.patch,
  +files/ddclient.confd-r1, +files/ddclient.initd-r3:
  Fixes bug 386161. Initscript now creates (/var)?/run/ddclient folder for
  those on tmpfs.
Comment 3 Denis Lisov 2012-04-19 15:01:43 UTC
The patch provided, while fixes the original bug, makes it impossible to update several DNS names with different IPs as it disables the per-hostname 'use' option, falling back to defaults instead.