NetBSD Problem Report #47699

From christos@zoulas.com  Wed Mar 27 15:02:20 2013
Return-Path: <christos@zoulas.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 717DE63EB75
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 27 Mar 2013 15:02:20 +0000 (UTC)
Message-Id: <20130327150217.C6F0097129@rebar.astron.com>
Date: Wed, 27 Mar 2013 15:02:17 +0000 (UTC)
From: christos@zoulas.com
Reply-To: christos@zoulas.com
To: gnats-bugs@gnats.NetBSD.org
Subject: dhpcd incompatibility problems.
X-Send-Pr-Version: 3.95

>Number:         47699
>Category:       bin
>Synopsis:       dhcpcd behaves differently than dhclient
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 27 15:05:00 +0000 2013
>Closed-Date:    Sun Dec 07 17:06:23 +0000 2014
>Last-Modified:  Sun Dec 07 17:06:23 +0000 2014
>Originator:     Christos Zoulas
>Release:        NetBSD 5.99.59
>Organization:
	Grvmpivs Maximvs, LTD.
>Environment:
System: NetBSD rebar.astron.com 5.99.59 NetBSD 5.99.59 (GENERIC) #7: Fri Dec 30 15:19:49 EST 2011 christos@rebar.astron.com:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
1. dhcpcd adds an alias address if one is already set for IPv4. There should
   be an option to override the primary address like dhclient does.
2. something leaves behind network routes created for the interface when
   dhcpcd is killed. It should cleanup, because when moving between different
   networks makes one unreachable from another.
>How-To-Repeat:
start dhclient, get address, kill it. change to different network
(with different ip address). In the wireless world join net with different
ssid.
start dhcpcd...
>Fix:
1. add configuration option to override the primary address instead of creating
   aliases.
2. figure out what adds the route, and remove it.

>Release-Note:

>Audit-Trail:
From: Roy Marples <roy@marples.name>
To: <gnats-bugs@NetBSD.org>
Cc: 
Subject: RE: bin/47699
Date: Wed, 27 Mar 2013 16:51:20 +0000

 I've added to noalias dhcpcd.conf directive to dhcpcd trunk here:
 http://roy.marples.name/cgi-bin/gitweb.cgi?p=dhcpcd.git;a=commit;h=a5a2ea6679a5d9e5ef4a30dff84383618d77c121

 Thanks

 Roy

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/47699: dhpcd incompatibility problems.
Date: Wed, 27 Mar 2013 15:36:47 -0400

 On Mar 27,  3:05pm, gnats-admin@netbsd.org (gnats-admin@netbsd.org) wrote:
 -- Subject: Re: bin/47699: dhpcd incompatibility problems.


 Bring the interface up with wpa_supplicant(8):
 ------------------------------------------------------------------------
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G
         powersave off
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (autoselect mode 11g)
         status: no network
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 0 root:wheel/~# wpa_supplicant -B -c /etc/etc.current/wpa_conf.localnet/wpa_supplicant.conf -i iwn0
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G nwkey *****
         powersave off
         bssid 30:46:9a:01:ec:18 chan 11
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (DS1 mode 11g)
         status: active
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 ------------------------------------------------------------------------

 Now configure it with ifconfig(8):
 ------------------------------------------------------------------------
 0 root:wheel/~# ifconfig iwn0 10.0.0.8 0xffffff80
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G nwkey *****
         powersave off
         bssid 30:46:9a:01:ec:18 chan 11
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (DS1 mode 11g)
         status: active
         inet 10.0.0.8 netmask 0xffffff80 broadcast 10.0.0.127
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 10.0.0.0/25        link#2             U      
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 0 root:wheel/~# ifconfig iwn0 delete
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G nwkey *****
         powersave off
         bssid 30:46:9a:01:ec:18 chan 11
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (DS1 mode 11g)
         status: active
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 ------------------------------------------------------------------------

 Now configure with dhcpcd(8):
 ------------------------------------------------------------------------
 0 root:wheel/~# dhcpcd iwn0
 dhcpcd[3866]: version 5.6.7 starting
 dhcpcd[3866]: iwn0: sending IPv6 Router Solicitation
 dhcpcd[3866]: iwn0: rebinding lease of 10.0.0.8
 dhcpcd[3866]: iwn0: acknowledged 10.0.0.8 from 10.0.0.124
 dhcpcd[3866]: iwn0: checking for 10.0.0.8
 dhcpcd[3866]: iwn0: sending IPv6 Router Solicitation
 dhcpcd[3866]: iwn0: leased 10.0.0.8 for 43200 seconds
 dhcpcd[3866]: forked to background, child pid 3700
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G nwkey *****
         powersave off
         bssid 30:46:9a:01:ec:18 chan 11
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (DS2 mode 11g)
         status: active
         inet 10.0.0.8 netmask 0xffffff80 broadcast 10.0.0.127
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 default            10.0.0.124         UG     
 10.0.0.0/25        link#2             U      
 netgear            link#2             UHL    
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 0 root:wheel/~# pkill -fl dhcpcd
 3700 dhcpcd iwn0
 0 root:wheel/~# ifconfig iwn0
 iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         ssid localnet-2.4G nwkey *****
         powersave off
         bssid 30:46:9a:01:ec:18 chan 11
         address: xx:yy:zz:yy:xx:yy
         media: IEEE802.11 autoselect (DS2 mode 11g)
         status: active
         inet6 fe80::xxxx:xxxx:xxxx:xxxx%iwn0 prefixlen 64 scopeid 0x2
 0 root:wheel/~# route show
 Routing tables

 Internet:
 Destination        Gateway            Flags 
 10.0.0.0/25        link#2             U      
 netgear            link#2             UHL    
 localhost          127.0.0.1          UH     

 Internet6:
 Destination        Gateway            Flags 
 localhost          localhost          UH     
 fe80::%iwn0        link#2             U      
 fe80::%lo0         fe80::1%lo0        U      
 ff01:2::           link#2             U      
 ff01:3::           localhost          U      
 ff02::%iwn0        link#2             U      
 ff02::%lo0         localhost          U      
 ------------------------------------------------------------------------

 Now, perhaps one shouldn't stop dhcpcd(8) with a SIGTERM, but it still
 should DTRT if you do.

From: "Roy Marples" <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47699 CVS commit: src/external/bsd/dhcpcd/dist
Date: Fri, 21 Jun 2013 19:33:08 +0000

 Module Name:	src
 Committed By:	roy
 Date:		Fri Jun 21 19:33:08 UTC 2013

 Update of /cvsroot/src/external/bsd/dhcpcd/dist
 In directory ivanova.netbsd.org:/tmp/cvs-serv6066

 Log Message:
 Import dhcpcd-6.0.0 with the following changes:
  * DHCPv6 support
  * wpa_supplicant hook script
  * route IPv4 addresses to 127.0.0.1 for machine centric traffic
  * DHCPv6 Prefix Delegation support
  * DHCPv6 FQDN support
  * Control existing IPv4 routes
  * less spamy to syslog by default
  * IPv6 protocols now wait for a valid LL address before starting
  * IPv6 DAD support now listens to kernel for more accurate timings
  * IPv4 code split out more cleanly so dhcpcd can be compiled for
    IPv4, IPv6 or IPv4 AND IPv6
  * MTU is no longer requested by default
  * a DUID is now generated in /etc/dhcpcd.duid and this is used as a 
    client ID for DHCPv4 and DHCPv6
    This does mean that you may get new DHCPv4 addresses

 Many bugs have also been fixed along the way and this release addresses
 the following PR's

 PR bin/47364
 PR bin/47502
 PR bin/47666
 PR bin/47699
 PR bin/47775
 PR bin/47776

 Status:

 Vendor Tag:	roy
 Release Tags:	dhcpcd_6_0_0

 U src/external/bsd/dhcpcd/dist/common.c
 U src/external/bsd/dhcpcd/dist/control.c
 U src/external/bsd/dhcpcd/dist/dhcpcd.c
 U src/external/bsd/dhcpcd/dist/duid.c
 U src/external/bsd/dhcpcd/dist/eloop.c
 U src/external/bsd/dhcpcd/dist/if-options.c
 U src/external/bsd/dhcpcd/dist/if-pref.c
 U src/external/bsd/dhcpcd/dist/net.c
 N src/external/bsd/dhcpcd/dist/script.c
 N src/external/bsd/dhcpcd/dist/dhcp-common.c
 U src/external/bsd/dhcpcd/dist/bpf.c
 U src/external/bsd/dhcpcd/dist/if-bsd.c
 U src/external/bsd/dhcpcd/dist/platform-bsd.c
 U src/external/bsd/dhcpcd/dist/arp.c
 C src/external/bsd/dhcpcd/dist/dhcp.c
 N src/external/bsd/dhcpcd/dist/ipv4.c
 U src/external/bsd/dhcpcd/dist/ipv4ll.c
 U src/external/bsd/dhcpcd/dist/ipv6.c
 U src/external/bsd/dhcpcd/dist/ipv6rs.c
 U src/external/bsd/dhcpcd/dist/ipv6ns.c
 N src/external/bsd/dhcpcd/dist/dhcp6.c
 C src/external/bsd/dhcpcd/dist/dhcpcd.conf
 C src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
 U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in
 C src/external/bsd/dhcpcd/dist/dhcpcd.8.in
 U src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
 U src/external/bsd/dhcpcd/dist/arp.h
 C src/external/bsd/dhcpcd/dist/bpf-filter.h
 U src/external/bsd/dhcpcd/dist/common.h
 U src/external/bsd/dhcpcd/dist/config.h
 U src/external/bsd/dhcpcd/dist/control.h
 U src/external/bsd/dhcpcd/dist/defs.h
 N src/external/bsd/dhcpcd/dist/dhcp-common.h
 U src/external/bsd/dhcpcd/dist/dhcp.h
 N src/external/bsd/dhcpcd/dist/dhcp6.h
 U src/external/bsd/dhcpcd/dist/dhcpcd.h
 U src/external/bsd/dhcpcd/dist/duid.h
 U src/external/bsd/dhcpcd/dist/eloop.h
 U src/external/bsd/dhcpcd/dist/if-options.h
 U src/external/bsd/dhcpcd/dist/if-pref.h
 N src/external/bsd/dhcpcd/dist/ipv4.h
 U src/external/bsd/dhcpcd/dist/ipv4ll.h
 U src/external/bsd/dhcpcd/dist/ipv6.h
 U src/external/bsd/dhcpcd/dist/ipv6ns.h
 U src/external/bsd/dhcpcd/dist/ipv6rs.h
 U src/external/bsd/dhcpcd/dist/net.h
 U src/external/bsd/dhcpcd/dist/platform.h
 N src/external/bsd/dhcpcd/dist/script.h
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu
 N src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant
 N src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf
 U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind

 5 conflicts created by this import.
 Use the following command to help the merge:

 	cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 07 Oct 2013 07:17:43 +0000
State-Changed-Why:
Roy imported a new version in June that cited this PR; is it fixed?


From: Roy Marples <roy@marples.name>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Subject: RE: bin/47699
Date: Fri, 28 Nov 2014 20:11:24 +0000

 > 1. dhcpcd adds an alias address if one is already set for IPv4. There 
 > should
 >    be an option to override the primary address like dhclient does.
 > 2. something leaves behind network routes created for the interface 
 > when
 >    dhcpcd is killed. It should cleanup, because when moving between 
 > different
 >    networks makes one unreachable from another.

 dhcpcd-6.6.4 has been imported now which addresses these concerns in a 
 different vein by reloading the last lease if the IP address for it 
 still exists on the interface.
 All options contained within the lease such as address, routing, etc are 
 cleaned up if needed when dhcpcd receives an event from the DHCP server 
 or times out.
 To get dhcpcd to remove everything at SIGTERM, simply remove the 
 persistent option from the default dhcpcd.conf file in /etc

 Roy

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 07 Dec 2014 17:06:23 +0000
State-Changed-Why:
feedback timeout.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.