Devuan bug report logs - #421
isc-dhcp-client: no ipv6 prefix set automatically

version graph

Package: isc-dhcp-client; Maintainer for isc-dhcp-client is (unknown); Source for isc-dhcp-client is src:isc-dhcp.

Reported by: Adrian Zaugg <adi@ente.limmat.ch>

Date: Sat, 4 Apr 2020 21:18:02 UTC

Severity: normal

Tags: debian

Found in version 4.3.5-3+deb9u1

Done: Mark Hindley <mark@hindley.org.uk>

Full log


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

Received: (at submit) by bugs.devuan.org; 4 Apr 2020 21:10:04 +0000
Return-Path: <prvs=03635e6c33=adi@ente.limmat.ch>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Sat, 04 Apr 2020 21:10:04 +0000 (UTC)
Received: from ente.limmat.ch (ente.limmat.ch [62.12.167.100])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 97E47F606F8
	for <submit@bugs.devuan.org>; Sat,  4 Apr 2020 23:00:29 +0200 (CEST)
Authentication-Results: vm6.ganeti.dyne.org;
	dkim=pass (2048-bit key; secure) header.d=ente.limmat.ch header.i=@ente.limmat.ch header.b="K1jT+j9t";
	dkim-atps=neutral
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ente.limmat.ch; s=main;
	h=X-MTA-Admin-Wish:Date:Message-ID:To:From:Content-Transfer-Encoding:MIME-Version:Content-Type; bh=c1gEhziattlNHQhBEH/7yF3mv50Ubc9+OG9E/Js+m8Y=;
	b=K1jT+j9tquViJsxPbHritg15UjHvt2HAcOwqw8BwwSPbSZC8vac2ZUgkriwSsl4L0BIodY90R7Gvzu4mF6fCBx6IFyg60gAdePWyox0j9ErCYauUTXkCuOUSH94E6w03mU1KD6Sor1uw04dgCe7vYvifCGQWPa3frcq9Ap5edUxQSi4g6xruhNvUxqoHUW/2gR/sK8UVVVGLaoPrC+2GPk1sTgfulggNX9L6JRs0gcC7xXUxT99ffNpf+CSZtYGSablK1cvNcdGsZfRYV6MqdTqSTGilN05EA9q6+wK+FR2Ny7pvlHl0tjcZleuheF5i2HT5Kwh50rrvA0fqtsatTQ==;
Received: from adi by ente.limmat.ch with local (Exim 4.84_2)
	(envelope-from <adi@ente.limmat.ch>)
	id 1jKpu0-00032y-KS; Sat, 04 Apr 2020 23:00:28 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Adrian Zaugg <adi@ente.limmat.ch>
To: Devuan Bug Tracking System <submit@bugs.devuan.org>
Subject: isc-dhcp-client: no ipv6 prefix set automatically
Message-ID: <20200404210028.27039.35048.reportbug@ente.limmat.ch>
X-Mailer: reportbug 6.6.3+devuan1.3
Date: Sat, 04 Apr 2020 23:00:28 +0200
X-MTA-Admin-Wish: Preserve the environment, save the climate.
X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS
	autolearn=disabled version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org
Package: isc-dhcp-client
Version: 4.3.5-3+deb9u1
Severity: important

Requesting an address over dhcp6 does not set the ipv6 prefix length. The address received seems always get 
a /128 prefix set, even if the dhcp6 server sends another one. 

I expect dhclient to set the prefix lenght, if the dhcp6 server sends one.

The code in /sbin/dhclient-script under "### DHCPv6 Handlers" is the same in ascii and Debian/unstable (4.4.1-2.1+b2). 

It has a mark "TODO: handle prefix change: ?based on ${old_ip6_prefix} and ${new_ip6_prefix}?"... In the code that 
does set the ipv6 address using iproute2 there is no prefix mentioned. See line 385 and the following:

    385     BOUND6|RENEW6|REBIND6)
    386         if [ "${new_ip6_address}" ]; then
    387             # set leased IP
    388             ip -6 addr add ${new_ip6_address} \
    389                 dev ${interface} scope global
    390         fi

This part has two problems: It should also be called upon reason REBOOT6 (see dhclient-script(8)) and it 
should set the prefix if one was given. I suggest to change this to:

    385     BOUND6|RENEW6|REBIND6|REBOOT6)
    386         if [ "${new_ip6_address}" ]; then
    387 
    388             # check wether a prefix was passed and add it to the address
    389             if [ -n "$new_ip6_prefixlen" ]; then
    390                 new_ip6_address_and_prefix="${new_ip6_address}/${new_ip6_prefixlen}"
    391             else
    392                 new_ip6_address_and_prefix="${new_ip6_address}"
    393             fi
    394 
    395             # set leased IP
    396             ip -6 addr add ${new_ip6_address_and_prefix} \
    397                 dev ${interface} scope global

According to my tests this resolves the problem. Please review.


Regards, Adrian.


-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 2.1 (ascii)
Release:	2.1
Codename:	ascii

Architecture: x86_64

Kernel: Linux 4.9.0-12-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages isc-dhcp-client depends on:
ii  debianutils       4.8.1.1
ii  iproute2          4.9.0-1+deb9u1
ii  libc6             2.24-11+deb9u4
ii  libdns-export162  1:9.10.3.dfsg.P4-12.3+deb9u5
ii  libisc-export160  1:9.10.3.dfsg.P4-12.3+deb9u5

Versions of packages isc-dhcp-client recommends:
ii  isc-dhcp-common  4.3.5-3+deb9u1

Versions of packages isc-dhcp-client suggests:
pn  avahi-autoipd         <none>
pn  isc-dhcp-client-ddns  <none>
ii  resolvconf            1.79

-- Configuration Files:
/etc/dhcp/debug changed [not included]

-- no debconf information

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Sat Apr 20 02:53:40 2024;