NetBSD Problem Report #50893

From www@NetBSD.org  Fri Mar  4 15:12:23 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2EDDC7ABF5
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  4 Mar 2016 15:12:23 +0000 (UTC)
Message-Id: <20160304151221.B7ECB7ACC8@mollari.NetBSD.org>
Date: Fri,  4 Mar 2016 15:12:21 +0000 (UTC)
From: bruce.lilly@gmail.com
Reply-To: bruce.lilly@gmail.com
To: gnats-bugs@NetBSD.org
Subject: dhcpd fails on carp(4) interfaces
X-Send-Pr-Version: www-1.0

>Number:         50893
>Category:       misc
>Synopsis:       dhcpd fails on carp(4) interfaces
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 04 15:15:00 +0000 2016
>Closed-Date:    Fri Jun 08 13:55:10 +0000 2018
>Last-Modified:  Fri Jun 08 13:55:10 +0000 2018
>Originator:     Bruce Lilly
>Release:        NetBSD 7.0
>Organization:
>Environment:
(you don't need the node name; here's ouput of uname -srmpio:)

NetBSD 7.0 amd64 x86_64 Intel 686-class NetBSD

Obviously, the kernel was rebuilt (from modified GENERIC) to enable carp.
>Description:
When dhcpd is started or restarted on a machine with active carp(4) interfaces using the supplied /etc/rc.d/dhcp script, dhcpd whines about multiple interfaces on the same subnet (viz. the physical interface and any corresponding carp interfaces), complains about (e.g.) 'Unsupported device type 248 for "carp0"', and exits.

The patch to /etc/rc.d/dhcpd (below) specifies the (settable, broadcast-capable, active) non-carp interfaces on the dhcpd command-line (see the synopsis in the dhcpd(8) man page).  Dhcpd still whines about the carp interface(s) ('Multiple interfaces match the same subnet' and 'Multiple interfaces match the same shared network'), but doesn't go belly-up.
>How-To-Repeat:
1. rebuild kernel with carp support, reboot.
2. install and configure dhcpd.
3. create a carp interface and assign a virtual IP address on the same subnet as a physical interface on which dhcpd is authoritative.
4. start or restart dhcpd.
5. examine logs.
>Fix:
Patch to /etc/rc.d/dhcpd:

*** etc/rc.d/dhcpd.orig Fri Sep 25 04:22:00 2015
--- etc/rc.d/dhcpd      Fri Mar  4 09:43:41 2016
***************
*** 12,17 ****
--- 12,20 ----
  name="dhcpd"
  rcvar=$name
  command="/usr/sbin/${name}"
+ # dhcpd fails on carp(4) interfaces: 'Unsupported device type 248 for "carp0"' ... 'exiting.'
+ interfaces=`ifconfig -lsub | sed -e "s/carp[0-9]*//"`
+ command_args="${interfaces}"
  start_precmd="dhcpd_precmd"
  pidfile="/var/run/${name}.pid"
  required_files="/etc/${name}.conf"

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, misc-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Fri, 4 Mar 2016 10:27:05 -0500

 On Mar 4,  3:15pm, bruce.lilly@gmail.com (bruce.lilly@gmail.com) wrote:
 -- Subject: misc/50893: dhcpd fails on carp(4) interfaces

 | >Number:         50893
 | >Category:       misc
 | >Synopsis:       dhcpd fails on carp(4) interfaces
 | >Confidential:   no
 | >Severity:       serious
 | >Priority:       medium
 | >Responsible:    misc-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Fri Mar 04 15:15:00 +0000 2016
 | >Originator:     Bruce Lilly
 | >Release:        NetBSD 7.0
 | >Organization:
 | >Environment:
 | (you don't need the node name; here's ouput of uname -srmpio:)
 | 

 Can you please try this?

 christos

 Index: bpf.c
 ===================================================================
 RCS file: /cvsroot/src/external/bsd/dhcp/dist/common/bpf.c,v
 retrieving revision 1.3
 diff -u -u -r1.3 bpf.c
 --- bpf.c	12 Jul 2014 12:09:37 -0000	1.3
 +++ bpf.c	4 Mar 2016 15:26:53 -0000
 @@ -623,6 +623,7 @@
  	 */
          switch (sa->sdl_type) {
                  case IFT_ETHER:
 +		case IFT_CARP:
                          hw->hlen = sa->sdl_alen + 1;
                          hw->hbuf[0] = HTYPE_ETHER;
                          memcpy(&hw->hbuf[1], LLADDR(sa), sa->sdl_alen);

From: John Nemeth <jnemeth@cue.bc.ca>
To: gnats-bugs@NetBSD.org, misc-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Cc: 
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Fri, 4 Mar 2016 10:07:16 -0800

 On Mar 4,  3:15pm, bruce.lilly@gmail.com wrote:
 }
 } >Number:         50893
 } >Category:       misc
 } >Synopsis:       dhcpd fails on carp(4) interfaces
 } >State:          open
 } >Arrival-Date:   Fri Mar 04 15:15:00 +0000 2016
 } >Originator:     Bruce Lilly
 } >Release:        NetBSD 7.0
 } >Environment:
 } (you don't need the node name; here's ouput of uname -srmpio:)
 } 
 } NetBSD 7.0 amd64 x86_64 Intel 686-class NetBSD
 } 
 } Obviously, the kernel was rebuilt (from modified GENERIC) to enable carp.
 } >Description:
 } When dhcpd is started or restarted on a machine with active carp(4) interfaces using the supplied /etc/rc.d/dhcp script, dhcpd whines about multiple interfaces on the same subnet (viz. the physical interface and any corresponding carp interfaces), complains about (e.g.) 'Unsupported device type 248 for "carp0"', and exits.
 } 
 } The patch to /etc/rc.d/dhcpd (below) specifies the (settable, broadcast-capable, active) non-carp interfaces on the dhcpd command-line (see the synopsis in the dhcpd(8) man page).  Dhcpd still whines about the carp interface(s) ('Multiple interfaces match the same subnet' and 'Multiple interfaces match the same shared network'), but doesn't go belly-up.
 } >How-To-Repeat:
 } 1. rebuild kernel with carp support, reboot.
 } 2. install and configure dhcpd.
 } 3. create a carp interface and assign a virtual IP address on the same subnet as a physical interface on which dhcpd is authoritative.
 } 4. start or restart dhcpd.
 } 5. examine logs.
 } >Fix:
 } Patch to /etc/rc.d/dhcpd:
 } 
 } *** etc/rc.d/dhcpd.orig Fri Sep 25 04:22:00 2015
 } --- etc/rc.d/dhcpd      Fri Mar  4 09:43:41 2016
 } ***************
 } *** 12,17 ****
 } --- 12,20 ----
 }   name="dhcpd"
 }   rcvar=$name
 }   command="/usr/sbin/${name}"
 } + # dhcpd fails on carp(4) interfaces: 'Unsupported device type 248 for "carp0"' ... 'exiting.'
 } + interfaces=`ifconfig -lsub | sed -e "s/carp[0-9]*//"`
 } + command_args="${interfaces}"
 }   start_precmd="dhcpd_precmd"
 }   pidfile="/var/run/${name}.pid"
 }   required_files="/etc/${name}.conf"

      There is no need to patch an rc.d file for something like
 this.  Simply add the interface that you want to run dhcpd on to
 dhcpd_flags in rc.conf.  See "man rc.conf" for details as noted at
 the top of rc.conf.

 }-- End of excerpt from bruce.lilly@gmail.com

From: Bruce Lilly <bruce.lilly@gmail.com>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Fri, 4 Mar 2016 14:45:37 -0500

 Modified dhcpd:

 # ls -l $(whence dhcpd)
 -r-xr-xr-x   1 root     wheel     724463 Mar  4 14:05 /usr/sbin/dhcpd

 Restart with carp interfaces active, patched /etc/rc.d/dhcpd:

 2016-03-04T14:33:52.084407-05:00 z400a.blilly.net dhcpd - - - Received
 signal 15, initiating shutdown.
 2016-03-04T14:33:54.138046-05:00 z400a.blilly.net dhcpd - - - Internet
 Systems Consortium DHCP Server 4.3.0
 2016-03-04T14:33:54.138386-05:00 z400a.blilly.net dhcpd - - -
 Copyright 2004-2014 Internet Systems Consortium.
 2016-03-04T14:33:54.138414-05:00 z400a.blilly.net dhcpd - - - All
 rights reserved.
 2016-03-04T14:33:54.138439-05:00 z400a.blilly.net dhcpd - - - For
 info, please visit https://www.isc.org/software/dhcp/
 2016-03-04T14:33:54.139769-05:00 z400a.blilly.net dhcpd - - - Wrote 0
 deleted host decls to leases file.
 2016-03-04T14:33:54.139839-05:00 z400a.blilly.net dhcpd - - - Wrote 0
 new dynamic host decls to leases file.
 2016-03-04T14:33:54.140029-05:00 z400a.blilly.net dhcpd - - - Wrote 8
 leases to leases file.
 2016-03-04T14:33:54.140530-05:00 z400a.blilly.net dhcpd - - - Multiple
 interfaces match the same subnet: bge0 carp0
 2016-03-04T14:33:54.140564-05:00 z400a.blilly.net dhcpd - - - Multiple
 interfaces match the same shared network: bge0 carp0
 2016-03-04T14:33:54.141023-05:00 z400a.blilly.net dhcpd - - - Server
 starting service.

 As before.

 Restart with original /etc/rc.d/dhcpd:

 2016-03-04T14:37:58.953806-05:00 z400a.blilly.net dhcpd - - - Received
 signal 15, initiating shutdown.
 2016-03-04T14:38:00.995491-05:00 z400a.blilly.net dhcpd - - - Internet
 Systems Consortium DHCP Server 4.3.0
 2016-03-04T14:38:00.995838-05:00 z400a.blilly.net dhcpd - - -
 Copyright 2004-2014 Internet Systems Consortium.
 2016-03-04T14:38:00.995872-05:00 z400a.blilly.net dhcpd - - - All
 rights reserved.
 2016-03-04T14:38:00.995905-05:00 z400a.blilly.net dhcpd - - - For
 info, please visit https://www.isc.org/software/dhcp/
 2016-03-04T14:38:00.996545-05:00 z400a.blilly.net dhcpd - - - Wrote 0
 deleted host decls to leases file.
 2016-03-04T14:38:00.996616-05:00 z400a.blilly.net dhcpd - - - Wrote 0
 new dynamic host decls to leases file.
 2016-03-04T14:38:00.996785-05:00 z400a.blilly.net dhcpd - - - Wrote 8
 leases to leases file.
 2016-03-04T14:38:00.997040-05:00 z400a.blilly.net dhcpd - - - Multiple
 interfaces match the same subnet: bge0 carp0
 2016-03-04T14:38:00.997072-05:00 z400a.blilly.net dhcpd - - - Multiple
 interfaces match the same shared network: bge0 carp0
 2016-03-04T14:38:00.997395-05:00 z400a.blilly.net dhcpd - - - Server
 starting service.

 That appears to have corrected the 'Unsupported device type 248 for
 "carp0"' and resulting bail-out of dhcpd; thanks.

 On Fri, Mar 4, 2016 at 10:30 AM, Christos Zoulas <christos@zoulas.com> wrote:
 > The following reply was made to PR misc/50893; it has been noted by GNATS.
 >
 > From: christos@zoulas.com (Christos Zoulas)
 > To: gnats-bugs@NetBSD.org, misc-bug-people@netbsd.org,
 >         gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Cc:
 > Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
 > Date: Fri, 4 Mar 2016 10:27:05 -0500
 >
 >  On Mar 4,  3:15pm, bruce.lilly@gmail.com (bruce.lilly@gmail.com) wrote:
 >  -- Subject: misc/50893: dhcpd fails on carp(4) interfaces
 >
 >  | >Number:         50893
 >  | >Category:       misc
 >  | >Synopsis:       dhcpd fails on carp(4) interfaces
 >  | >Confidential:   no
 >  | >Severity:       serious
 >  | >Priority:       medium
 >  | >Responsible:    misc-bug-people
 >  | >State:          open
 >  | >Class:          sw-bug
 >  | >Submitter-Id:   net
 >  | >Arrival-Date:   Fri Mar 04 15:15:00 +0000 2016
 >  | >Originator:     Bruce Lilly
 >  | >Release:        NetBSD 7.0
 >  | >Organization:
 >  | >Environment:
 >  | (you don't need the node name; here's ouput of uname -srmpio:)
 >  |
 >
 >  Can you please try this?
 >
 >  christos
 >
 >  Index: bpf.c
 >  ===================================================================
 >  RCS file: /cvsroot/src/external/bsd/dhcp/dist/common/bpf.c,v
 >  retrieving revision 1.3
 >  diff -u -u -r1.3 bpf.c
 >  --- bpf.c      12 Jul 2014 12:09:37 -0000      1.3
 >  +++ bpf.c      4 Mar 2016 15:26:53 -0000
 >  @@ -623,6 +623,7 @@
 >          */
 >           switch (sa->sdl_type) {
 >                   case IFT_ETHER:
 >  +              case IFT_CARP:
 >                           hw->hlen = sa->sdl_alen + 1;
 >                           hw->hbuf[0] = HTYPE_ETHER;
 >                           memcpy(&hw->hbuf[1], LLADDR(sa), sa->sdl_alen);
 >

From: Bruce Lilly <bruce.lilly@gmail.com>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Fri, 4 Mar 2016 14:51:23 -0500

 On Fri, Mar 4, 2016 at 1:05 PM, John Nemeth <jnemeth@cue.bc.ca> wrote:
 > The following reply was made to PR misc/50893; it has been noted by GNATS.
 >
 > From: John Nemeth <jnemeth@cue.bc.ca>
 > To: gnats-bugs@NetBSD.org, misc-bug-people@netbsd.org, gnats-admin@netbsd.org,
 >         netbsd-bugs@netbsd.org
 > Cc:
 > Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
 > Date: Fri, 4 Mar 2016 10:07:16 -0800
 [...]
 >       There is no need to patch an rc.d file for something like
 >  this.  Simply add the interface that you want to run dhcpd on to
 >  dhcpd_flags in rc.conf.  See "man rc.conf" for details as noted at
 >  the top of rc.conf.

 As long as we're comparing bike sheds...

 My proposed change to /etc/rc.d/dhcpd should work anywhere, regardless
 of physical interface naming.
 It can be rolled out unconditionally to a large number of machines.

 Manually editing rc.conf doesn't scale well.

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org,
        Hauke Fath <hf@spg.tu-darmstadt.de>
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Wed, 24 Aug 2016 14:55:04 +0200

 > There is no need to patch an rc.d file for something like this.
 > Simply add the interface that you want to run dhcpd on to dhcpd_flags
 > in rc.conf. See "man rc.conf" for details as noted at the top of
 > rc.conf.

 Even when you specify the interface list

 dhcpd=YES
                  dhcpd_flags="-q vlan7 vlan8 vlan9 vlan10 vlan11 vlan12"

 dhcpd will complain about what it perceives as an overlap (note vlan2 is 
 not listed above)::

 dhcpd: Multiple interfaces match the same subnet: vlan2 carp2
 dhcpd: Multiple interfaces match the same shared network: vlan2 carp2
 dhcpd: Multiple interfaces match the same subnet: vlan7 carp7
 dhcpd: Multiple interfaces match the same shared network: vlan7 carp7
 dhcpd: Multiple interfaces match the same subnet: vlan8 carp8
 dhcpd: Multiple interfaces match the same shared network: vlan8 carp8
 dhcpd: Multiple interfaces match the same subnet: vlan9 carp9
 dhcpd: Multiple interfaces match the same shared network: vlan9 carp9
 dhcpd: Multiple interfaces match the same subnet: vlan10 carp10
 dhcpd: Multiple interfaces match the same shared network: vlan10 carp10
 dhcpd: Multiple interfaces match the same subnet: vlan11 carp11
 dhcpd: Multiple interfaces match the same shared network: vlan11 carp11
 dhcpd: Multiple interfaces match the same subnet: vlan12 carp12
 dhcpd: Multiple interfaces match the same shared network: vlan12 carp12

 -- dhcpcd needs to learn carp interfaces are special.

 hauke

From: Bruce Lilly <bruce.lilly@gmail.com>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: misc/50893: dhcpd fails on carp(4) interfaces
Date: Thu, 31 May 2018 13:11:53 -0400

 Any chance of rolling Christos' patch into the standard distribution?
 As of 7.1.2 I'm still having to apply the patch manually and rebuild.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50893 CVS commit: src/external/mpl/dhcp/dist/common
Date: Thu, 31 May 2018 20:42:49 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Fri Jun  1 00:42:49 UTC 2018

 Modified Files:
 	src/external/mpl/dhcp/dist/common: bpf.c

 Log Message:
 PR/50893: Bruce Lilly: Handle carp interfaces.

 XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/dist/common/bpf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 08:20:26 +0000
State-Changed-Why:
This applies to -8 but in a different pathname (license changed). Needs to be pulled up.


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 04 Jun 2018 08:34:33 +0000
State-Changed-Why:
pullup-8 854, pullup-7 1611


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50893 CVS commit: [netbsd-7] src/external/bsd/dhcp/dist/common
Date: Wed, 6 Jun 2018 15:31:58 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Jun  6 15:31:58 UTC 2018

 Modified Files:
 	src/external/bsd/dhcp/dist/common [netbsd-7]: bpf.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #1611):

 	external/mpl/dhcp/dist/common/bpf.c: revision 1.3
 	(via patch, applied to src/external/bsd/dhcp/dist/common/bpf.c)

 PR/50893: Bruce Lilly: Handle carp interfaces.

 XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.3.2.1 src/external/bsd/dhcp/dist/common/bpf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50893 CVS commit: [netbsd-8] src/external/bsd/dhcp/dist/common
Date: Fri, 8 Jun 2018 10:18:36 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jun  8 10:18:36 UTC 2018

 Modified Files:
 	src/external/bsd/dhcp/dist/common [netbsd-8]: bpf.c

 Log Message:
 Pull up following revision(s) (requested by maya in ticket #854):

 	external/mpl/dhcp/dist/common/bpf.c: revision 1.3

 PR/50893: Bruce Lilly: Handle carp interfaces.
 XXX: pullup-8 (in src/external/bsd/dhcp/dist/common/bpf.c)


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.4.8.1 src/external/bsd/dhcp/dist/common/bpf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 08 Jun 2018 13:55:10 +0000
State-Changed-Why:
Pullups completed. Note netbsd-7 is not the same as netbsd-7-1, so it won't appear in 7.1.x, but 7.2.x or in stable builds of nyftp.netbsd.org.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.