Dibbler-client fails to bind on ppp interfaces, fails to install, fails to build on Ubuntu 22.04

Bug #1970280 reported by Radek Zajic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dibbler (Ubuntu)
New
Undecided
Unassigned

Bug Description

Before I start: I know that the author of Dibbler considers this software unmaintained (https://klub.com.pl/dhcpv6/); yet it is included in the repositories, so here I am with this bug report.

== Issue #1: Dibbler binds to incorrect link-local address of a ppp(oe) interface ==
After upgrading my home router from Ubuntu 20.04 to Ubuntu 22.04, I have noticed that dibbler-client is no longer capable of starting up and binding to the PPPoE (PPP) interface created as part of my connection set-up process.

This is how the link local addresses look like:
rzajic@router:/home/work/dibbler/dibbler-1.0.1$ ip -6 a s dev ppp999 scope link
28: ppp999: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc cake state UNKNOWN group default qlen 3
    inet6 fe80::8157:b42e:45ec:96ae peer fe80::427c:7dff:fe93:d231/128 scope link
       valid_lft forever preferred_lft forever

fe80::8157:b42e:45ec:96ae is my side of the point to point link
fe80::427c:7dff:fe93:d231 is the ISP side of the point to point link
(The addresses change on every reconnection, it's nothing sensitive.)

The error logs from Dibbler-client were:

Apr 25 11:00:39 router.local systemd[1]: Starting LSB: Starts DHCPv6 client...
Apr 25 11:00:39 router.local dibbler-client[86944]: Starting DHCPv6 client: dibbler-client.
Apr 25 11:00:39 router.local systemd[1]: Started LSB: Starts DHCPv6 client.
Apr 25 11:00:39 router.local DibblerClient[86950]: PD: Following interfaces marked as downlink: br0.2
Apr 25 11:00:39 router.local DibblerClient[86950]: Prefix delegation option (no parameters) found.
Apr 25 11:00:39 router.local DibblerClient[86950]: Parsing /etc/dibbler/client.conf done, result=0(success)
Apr 25 11:00:39 router.local DibblerClient[86950]: 1 interface(s) specified in /etc/dibbler/client.conf
Apr 25 11:00:39 router.local DibblerClient[86950]: Interface ppp999/28 configuration has been loaded.
Apr 25 11:00:39 router.local DibblerClient[86950]: DUID's value = 00:01:00:01:27:3c:48:99:40:8d:5c:b3:2a:ab was loaded from client-duid file.
Apr 25 11:00:39 router.local DibblerClient[86950]: My DUID is 00:01:00:01:27:3c:48:99:40:8d:5c:b3:2a:ab.
Apr 25 11:00:39 router.local DibblerClient[86950]: Loading old address database (client-AddrMgr.xml), using built-in routines.
Apr 25 11:00:39 router.local DibblerClient[86950]: Unable to open client-AddrMgr.xml.
Apr 25 11:00:39 router.local DibblerClient[86950]: Bind reuse enabled (multiple instances allowed).
Apr 25 11:00:39 router.local DibblerClient[86950]: Creating control (::) socket on the lo/1 interface.
Apr 25 11:00:39 router.local DibblerClient[86950]: Creating socket (addr=fe80::427c:7dff:fe93:d231) on ppp999/28 interface.
Apr 25 11:00:39 router.local DibblerClient[86950]: Unable to bind socket (iface=ppp999/28, addr=fe80::427c:7dff:fe93:d231, port=546).
Apr 25 11:00:39 router.local DibblerClient[86950]: Low-level layer error message: Unable to bind socket: Cannot assign requested address
Apr 25 11:00:39 router.local DibblerClient[86950]: Socket creation (addr=fe80::427c:7dff:fe93:d231) on ppp999/28 interface failed.
Apr 25 11:00:39 router.local DibblerClient[86950]: Fatal error during TransMgr initialization.

After a quick review, it became clear that the dibbler-client attempts to bind to incorrect IPv6 link local address. This might be related to how the new(er?) clients present the link local addresses.

Using the script from https://raw.githubusercontent.com/d0u9/examples/master/C/netlink/ip_show.c, I can see that the link local address on my side of the point to point link is now represented as "local address", while on non-point to point links the link local addresses are represented as interface addresses.

==================================
family: 6
dev: ppp999
prefix length: 128

local address: fe80::8157:b42e:45ec:96ae (flags 128, scope 253)
if address: fe80::427c:7dff:fe93:d231 (flags 128, scope 253)

==================================
family: 6
dev: tap4
prefix length: 64

if address: fe80::4048:1aff:fe2e:64f4 (flags 128, scope 253)

This can be worked around by modifying the low level Linux code (note that there seems to be a bug in Dibbler code, which uses IFLA_ADDRESS [belongs to layer 2, e.g. MAC address] instead of IFA_ADDRESS):
--- lowlevel-linux.c 2022-04-25 23:56:08.736090768 +0200
+++ dibbler-1.0.1/Port-linux/lowlevel-linux.c 2022-04-25 23:30:35.889052974 +0200
@@ -277,7 +277,7 @@
      if (!rta_tb[IFA_LOCAL]) rta_tb[IFA_LOCAL] = rta_tb[IFA_ADDRESS];
      if (!rta_tb[IFA_ADDRESS]) rta_tb[IFA_ADDRESS] = rta_tb[IFA_LOCAL];

- memcpy(addr,(char*)RTA_DATA(rta_tb[IFLA_ADDRESS]),16);
+ memcpy(addr,(char*)RTA_DATA(rta_tb[IFA_LOCAL]),16);
      if (addr[0]!=0xfe || addr[1]!=0x80) {
   continue; /* ignore non link-scoped addrs */
      }

The local address is always set a few lines above the memcpy() call.

After rebuild (see Issue #3 below), the process starts, binds and request a prefix (which was my goal at the beginning):

Apr 25 23:39:45 router.local systemd[1]: Starting LSB: Starts DHCPv6 client...
Apr 25 23:39:45 router.local dibbler-client[243724]: Starting DHCPv6 client: dibbler-client.
Apr 25 23:39:45 router.local systemd[1]: Started LSB: Starts DHCPv6 client.
Apr 25 23:39:45 router.local DibblerClient[243730]: PD: Following interfaces marked as downlink: br0.2
Apr 25 23:39:45 router.local DibblerClient[243730]: Prefix delegation option (no parameters) found.
Apr 25 23:39:45 router.local DibblerClient[243730]: Parsing /etc/dibbler/client.conf done, result=0(success)
Apr 25 23:39:45 router.local DibblerClient[243730]: 1 interface(s) specified in /etc/dibbler/client.conf
Apr 25 23:39:45 router.local DibblerClient[243730]: Interface ppp999/28 configuration has been loaded.
Apr 25 23:39:45 router.local DibblerClient[243730]: DUID's value = 00:01:00:01:27:3c:48:99:40:8d:5c:b3:2a:ab was loaded from client-duid file.
Apr 25 23:39:45 router.local DibblerClient[243730]: My DUID is 00:01:00:01:27:3c:48:99:40:8d:5c:b3:2a:ab.
Apr 25 23:39:45 router.local DibblerClient[243730]: Loading old address database (client-AddrMgr.xml), using built-in routines.
Apr 25 23:39:45 router.local DibblerClient[243730]: DB timestamp:1650922785, now()=1650922785, db is 0 second(s) old.
Apr 25 23:39:45 router.local DibblerClient[243730]: Auth: Replay detection value loaded 0
Apr 25 23:39:45 router.local DibblerClient[243730]: All client's 00:01:00:01:27:3c:48:99:40:8d:5c:b3:2a:ab leases are not valid.
Apr 25 23:39:45 router.local DibblerClient[243730]: Bind reuse enabled (multiple instances allowed).
Apr 25 23:39:45 router.local DibblerClient[243730]: Creating control (::) socket on the lo/1 interface.
Apr 25 23:39:45 router.local DibblerClient[243730]: DEBUG: realIface: <IfaceIface name="ppp999" ifindex="28" hwType="512" flags="0x110d1" mBit="0" oBit="0">
                                                        <!-- no-loopback running multicast -->
                                                        <!-- PrefixLength configured to 128 -->
                                                        <!-- 1 link scoped addrs -->
                                                        <Addr>fe80::8157:b42e:45ec:96ae</Addr>
                                                        <!-- 3 non-local addrs -->
                                                        2001:1ae9:ff2:xxxx::1 2001:1ae9:ff2:xxxx:faf0:100c:edd5:ed6d 2001:1ae9:ff2:xxxx:8157:b42e:45ec:96ae <Mac></Mac>
                                                      </IfaceIface>
                                                    , Interface
Apr 25 23:39:45 router.local DibblerClient[243730]: Creating socket (addr=fe80::8157:b42e:45ec:96ae) on ppp999/28 interface.
Apr 25 23:39:45 router.local DibblerClient[243730]: Initialising link-state detection for interfaces: ppp999/28
Apr 25 23:39:45 router.local DibblerClient[243730]: CONFIRM support compiled in.
Apr 25 23:39:45 router.local DibblerClient[243730]: Creating SOLICIT message with 0 IA(s), no TA and 1 PD(s) on ppp999/28 interface.
Apr 25 23:39:45 router.local DibblerClient[243730]: Sending SOLICIT(opts:1 25 8 ) on ppp999/28 to multicast.
Apr 25 23:39:45 router.local DibblerClient[243730]: Sleeping for 1 second(s).
Apr 25 23:39:45 router.local DibblerClient[243730]: Received 81 bytes on interface ppp999/28 (socket=3, addr=fe80::427c:7dff:fe93:d231).
Apr 25 23:39:45 router.local DibblerClient[243730]: Received ADVERTISE on ppp999/28,trans-id=0x655732, 3 opts: 2 1 25
Apr 25 23:39:45 router.local DibblerClient[243730]: Script execution skipped for ADVERTISE response to SOLICIT. No action needed for this message type.
Apr 25 23:39:45 router.local DibblerClient[243730]: Sleeping for 1 second(s).
Apr 25 23:39:46 router.local DibblerClient[243730]: Processing msg (SOLICIT,transID=0x655732,opts: 1 25 8)
Apr 25 23:39:46 router.local DibblerClient[243730]: Creating REQUEST. Backup server list contains 1 server(s).
Apr 25 23:39:46 router.local DibblerClient[243730]: Advertise from Server ID=00:03:00:01:40:7c:7d:93:d2:31, no preference option, assumed 0.[using this]
Apr 25 23:39:46 router.local DibblerClient[243730]: Sending REQUEST(opts:1 25 2 8 ) on ppp999/28 to multicast.
Apr 25 23:39:46 router.local DibblerClient[243730]: Sleeping for 1 second(s).
Apr 25 23:39:46 router.local DibblerClient[243730]: Received 81 bytes on interface ppp999/28 (socket=3, addr=fe80::427c:7dff:fe93:d231).
Apr 25 23:39:46 router.local DibblerClient[243730]: Received REPLY on ppp999/28,trans-id=0xd529db, 3 opts: 2 1 25
Apr 25 23:39:46 router.local DibblerClient[243730]: PD: Adding 2001:1ae9:xxxx:xx00:: prefix to PD (iaid=1) to addrDB.
Apr 25 23:39:46 router.local DibblerClient[243730]: PD: Adding prefix 2001:1ae9:xxxx:xx00::/56 to all interfaces (prefix will be split to /64 prefixes if necessary).
Apr 25 23:39:46 router.local DibblerClient[243730]: PD: Using 1 suitable interface(s):br0.2
Apr 25 23:39:46 router.local DibblerClient[243730]: PD: Adding prefix 2001:1ae9:xxxx:xx00::/56 on the br0.2/13 interface.
Apr 25 23:39:46 router.local DibblerClient[243730]: RENEW(IA_PD) will be sent (T1) after 1800, REBIND (T2) after 2880 seconds.
Apr 25 23:39:46 router.local DibblerClient[243730]: About to execute /etc/dibbler/client-notify.sh script, 15 variables.
Apr 25 23:39:46 router.local DibblerClient[243730]: Script execution complete, return code=0
Apr 25 23:39:46 router.local DibblerClient[243730]: Sleeping for 1799 second(s).

== Issue #2: Post-install script fails ==

This is yet another issue spotted as part of the installation. Maybe it would deserve a separate bug report - who knows. Anyway, here it is:

The postinst script fails, causing the whole installation to fail:
Preparing to unpack .../dibbler-client_1.0.1-1build2_amd64.deb ...
Unpacking dibbler-client (1.0.1-1build2) over (1.0.1-1build2) ...
Setting up dibbler-client (1.0.1-1build2) ...
Error: The new file /etc/dibbler/client.conf-dpkg-new does not exist!
dpkg: error processing package dibbler-client (--install):
 installed dibbler-client package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 dibbler-client

This can be fixed by creating the conf-new version at all times:
--- dibbler-client.postinst 2022-04-25 23:52:28.891596403 +0200
+++ /home/work/dibbler/dibbler-1.0.1/debian/dibbler-client.postinst 2022-04-25 23:39:40.203950174 +0200
@@ -30,6 +30,8 @@
     rm ${CONFFILE_NEW}
 fi

+touch ${CONFFILE_NEW}
+
 db_version 2.0
 #db_capb backup
 db_settitle dibbler-client/title

== Issue #3: Dibbler rebuild fails ==
To rebuild the package on Ubuntu 22.04 with the latest gcc, I had to supply the "-fcommon" flag explicitly:

apt-get source dibbler-client
apt-get build-deps dibbler-client
cd dibbler-1.0.1/
DEB_CPPFLAGS_SET="-fcommon" DEB_CFLAGS_SET="-fcommon" debuild -us -uc -i -b

Without that backwards compatibility flag, build fails on this error:
/usr/bin/ld: libLowLevel_a-interface.o (symbol from plugin): in function `daemon_log':
(.text+0x0): multiple definition of `interface_do_message'; libLowLevel_a-lowlevel-linux-link-state.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: libLowLevel_a-interface.o (symbol from plugin): in function `daemon_log':
(.text+0x0): multiple definition of `interface_auto_up'; libLowLevel_a-lowlevel-linux-link-state.o (symbol from plugin):(.text+0x0): first defined here
./Port-linux/daemon.h:30:5: warning: 'die' violates the C++ One Definition Rule [-Wodr]
   30 | int die(const char * pidfile);
      | ^
Port-linux/daemon.cpp:191:6: note: return value type mismatch
  191 | void die(const char * pidfile) {
      | ^
Port-linux/daemon.cpp:191:6: note: type 'void' should match type 'int'
Port-linux/daemon.cpp:191:6: note: 'die' was previously declared here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:629: dibbler-client] Error 1
make[2]: Leaving directory '/home/work/dibbler/dibbler-1.0.1'
make[1]: *** [Makefile:816: all-recursive] Error 1
make[1]: Leaving directory '/home/work/dibbler/dibbler-1.0.1'
dh_auto_build: error: make -j1 returned exit code 2
make: *** [debian/rules:16: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -i -b failed

== System info ==
# lsb_release -rd
Description: Ubuntu 22.04 LTS
Release: 22.04

# Shows my rebuild/patched version
# apt-cache policy dibbler-client
dibbler-client:
  Installed: 1.0.1-1build2
  Candidate: 1.0.1-1.1
  Version table:
     1.0.1-1.1 500
        500 http://cz.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
 *** 1.0.1-1build2 100
        100 /var/lib/dpkg/status

Tags: jammy patch
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.