From nobody@FreeBSD.org  Thu Feb 16 19:03:56 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C3C7516A420
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 19:03:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 92B6143D49
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 19:03:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1GJ3uOg092725
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 19:03:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k1GJ3uaQ092723;
	Thu, 16 Feb 2006 19:03:56 GMT
	(envelope-from nobody)
Message-Id: <200602161903.k1GJ3uaQ092723@www.freebsd.org>
Date: Thu, 16 Feb 2006 19:03:56 GMT
From: Andrew Webster <awebster@connectalk.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: CARP advskew not propagated to VRRP packets
X-Send-Pr-Version: www-2.3

>Number:         93448
>Category:       kern
>Synopsis:       [carp] CARP advskew not propagated to VRRP packets
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 16 19:10:03 GMT 2006
>Closed-Date:    Sun Mar 02 02:43:23 UTC 2008
>Last-Modified:  Sun Mar 02 02:43:23 UTC 2008
>Originator:     Andrew Webster
>Release:        5.4p8
>Organization:
ConnecTalk Inc.
>Environment:
FreeBSD carp1.connectalk.com 5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #0: Tue Dec 20 11:39:40 EST 2005     root@serialtest.connectalk.com:/usr/src/sys/i386/compile/CARP  i386              
>Description:
Carp advskew values of < 240 are ignored and set to 240.

Carp interface configured as follows:
# ifconfig em1
em1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        inet6 fe80::20c:29ff:fef1:9f4c%em1 prefixlen 64 scopeid 0x2 
        inet 10.10.1.2 netmask 0xffffff00 broadcast 10.10.1.255
        ether 00:0c:29:f1:9f:4c
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
# ifconfig carp0
carp0: flags=41<UP,RUNNING> mtu 1500
        inet 10.10.1.1 netmask 0xffffff00 
        carp: MASTER vhid 10 advbase 1 advskew 1

# tcpdump -n -i em1
13:58:14.738030 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 240, authtype none, intvl 1s, length 36
13:58:16.687548 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 240, authtype none, intvl 1s, length 36

Notice prio is 240, not 1.  If set to > 240, then it follows.

# ifconfig carp0 advskew 242
# tcpdump -n -i em1
13:59:07.529908 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 242, authtype none, intvl 1s, length 36
13:59:09.488462 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 242, authtype none, intvl 1s, length 36

Now it is 242.
>How-To-Repeat:
# ifconfig em1 10.10.1.2/24
# ifconfig carp0 create
# ifconfig carp0 vhid 10 advbase 1 advskew 1
# ifconfig carp0 10.10.1.1/24
# ifconfig carp0 up
# tcpdump -n -i em1              
>Fix:
Looks like carp_suppress_preempt is being incorrectly set to true.
Perhaps in static void carp_sc_state_locked(struct carp_softc *sc)              
Actual fix ?
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Feb 21 21:34:59 UTC 2006 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93448 
Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Sun Feb 26 11:12:48 UTC 2006 
Responsible-Changed-Why:  
I will look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93448 

From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Andrew Webster <awebster@connectalk.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93448
Date: Tue, 21 Mar 2006 17:40:51 +0300

   Hi, Andrew!
 
   Unfortunately, I can't reproduce the problem you described on HEAD.
 
 Look here:
 
 root@behemoth:~:|>ifconfig vlan999 create
 root@behemoth:~:|>ifconfig vlan999 vlan 999 vlandev fxp0 10.10.1.2/24
 root@behemoth:~:|>ifconfig carp0 create
 root@behemoth:~:|>ifconfig carp0 vhid 10 advskew 1 10.10.1.1/24
 root@behemoth:~:|>sleep 3
 root@behemoth:~:|>ifconfig vlan999
 vlan999: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
         inet 10.10.1.2 netmask 0xffffff00 broadcast 10.10.1.255
         ether 00:90:27:85:b8:b9
         media: Ethernet autoselect (100baseTX <full-duplex>)
         status: active
         vlan: 999 parent interface: fxp0
 root@behemoth:~:|>ifconfig carp0
 carp0: flags=49<UP,LOOPBACK,RUNNING> mtu 1500
         inet 10.10.1.1 netmask 0xffffff00 
         carp: MASTER vhid 10 advbase 1 advskew 1
 root@behemoth:~:|>tcpdump -n -i vlan999
 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
 listening on vlan999, link-type EN10MB (Ethernet), capture size 96 bytes
 17:40:27.640848 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 1, authtype none, intvl 1s, length 36
 17:40:28.645848 IP 10.10.1.2 > 224.0.0.18: VRRPv2, Advertisement, vrid 10, prio 1, authtype none, intvl 1s, length 36
 ^C
 2 packets captured
 2 packets received by filter
 0 packets dropped by kernel
 root@behemoth:~:|>
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE
State-Changed-From-To: open->feedback 
State-Changed-By: glebius 
State-Changed-When: Tue Mar 21 14:51:09 UTC 2006 
State-Changed-Why:  
Awaiting for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93448 

From: =?ISO-8859-1?Q?Johan_Str=F6m?= <johan@stromnet.se>
To: bug-followup@FreeBSD.org,
 awebster@connectalk.com
Cc:  
Subject: Re: kern/93448: [carp] CARP advskew not propagated to VRRP packets
Date: Fri, 22 Dec 2006 23:54:10 +0100

 I can reproduce on:
 
 FreeBSD gw-2.stromnet.se 6.1-RELEASE-p11 FreeBSD 6.1-RELEASE-p11 #4: =20
 Tue Dec 12 19:53:59 CET 2006     johan@elfi.stromnet.se:/usr/obj/usr/=20
 src/sys/ROUTER.POLLING  i386
 
 
 gw-2 # ifconfig vlan13
 vlan13: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> =20
 mtu 1500
          inet6 fe80::a00:20ff:fecb:6e7c%vlan13 prefixlen 64 scopeid 0xd
          inet 172.28.7.1 netmask 0xfffffff8 broadcast 172.28.7.7
          ether 08:00:20:cb:6e:7c
          media: Ethernet none
          status: active
          vlan: 13 parent interface: fec0
 gw-2 # ifconfig carp0 create
 gw-2 # ifconfig carp0 vhid 10 advskew 1 172.28.7.3/29
 gw-2 # ifconfig carp0 up
 gw-2 # sleep 3
 gw-2 # ifconfig carp0
 carp0: flags=3D49<UP,LOOPBACK,RUNNING> mtu 1500
          inet 172.28.7.3 netmask 0xfffffff8
          carp: MASTER vhid 10 advbase 1 advskew 1
 gw-2 #
 gw-2 # tcpdump -i vlan13 -n
 tcpdump: verbose output suppressed, use -v or -vv for full protocol =20
 decode
 listening on vlan13, link-type EN10MB (Ethernet), capture size 96 bytes
 23:51:51.867387 IP 172.28.7.1 > 224.0.0.18: VRRPv2, Advertisement, =20
 vrid 10, prio 240, authtype none, intvl 1s, length 36
 23:51:53.806407 IP 172.28.7.1 > 224.0.0.18: VRRPv2, Advertisement, =20
 vrid 10, prio 240, authtype none, intvl 1s, length 36
 ^C
 2 packets captured
 2 packets received by filter
 0 packets dropped by kernel
 
 
 Password doesnt seem to work either?
 
 gw-2 # ifconfig carp0 pass test
 gw-2 # ifconfig carp0
 carp0: flags=3D49<UP,LOOPBACK,RUNNING> mtu 1500
          inet 172.28.7.3 netmask 0xfffffff8
          carp: MASTER vhid 10 advbase 1 advskew 1
 
 dunno if it should show there, but tcpdump still gives
 
 23:53:14.635670 IP 172.28.7.1 > 224.0.0.18: VRRPv2, Advertisement, =20
 vrid 10, prio 240, authtype none, intvl 1s, length 36
 
 authtype none?
 
 Johan Str=F6m
 johan@stromnet.se
 http://www.stromnet.se/
 
 
 

From: =?ISO-8859-1?Q?Johan_Str=F6m?= <johan@stromnet.se>
To: bug-followup@FreeBSD.org,
 awebster@connectalk.com
Cc:  
Subject: Re: kern/93448: [carp] CARP advskew not propagated to VRRP packets
Date: Sat, 23 Dec 2006 02:05:13 +0100

 Ok my bad for above followup.. advskew seems to be set to 240 if set =20
 to lower than 240 by admin.. This is not mentioned in docs however?
 
 As for the pass stuff, thats because fbsds tcpdump uses vrrp, not =20
 carp, when decoding.. Suggestion: copy print-carp.c (and whichever =20
 more files required) from openbsd's tcpdump?
 
 thanks
 
 Johan Str=F6m
 johan@stromnet.se
 http://www.stromnet.se/
 
 
 

From: Gleb Smirnoff <glebius@FreeBSD.org>
To: Johan Str?m <johan@stromnet.se>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93448: [carp] CARP advskew not propagated to VRRP packets
Date: Fri, 29 Dec 2006 14:16:30 +0300

 On Sat, Dec 23, 2006 at 12:10:20AM +0000, Johan Str?m wrote:
 J>  I can reproduce on:
 J>  
 J>  FreeBSD gw-2.stromnet.se 6.1-RELEASE-p11 FreeBSD 6.1-RELEASE-p11 #4: =20
 J>  Tue Dec 12 19:53:59 CET 2006     johan@elfi.stromnet.se:/usr/obj/usr/=20
 J>  src/sys/ROUTER.POLLING  i386
 J>  
 J>  
 J>  gw-2 # ifconfig vlan13
 J>  vlan13: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> =20
 J>  mtu 1500
 J>           inet6 fe80::a00:20ff:fecb:6e7c%vlan13 prefixlen 64 scopeid 0xd
 J>           inet 172.28.7.1 netmask 0xfffffff8 broadcast 172.28.7.7
 J>           ether 08:00:20:cb:6e:7c
 J>           media: Ethernet none
 J>           status: active
 J>           vlan: 13 parent interface: fec0
 J>  gw-2 # ifconfig carp0 create
 J>  gw-2 # ifconfig carp0 vhid 10 advskew 1 172.28.7.3/29
 J>  gw-2 # ifconfig carp0 up
 J>  gw-2 # sleep 3
 J>  gw-2 # ifconfig carp0
 J>  carp0: flags=3D49<UP,LOOPBACK,RUNNING> mtu 1500
 J>           inet 172.28.7.3 netmask 0xfffffff8
 J>           carp: MASTER vhid 10 advbase 1 advskew 1
 J>  gw-2 #
 J>  gw-2 # tcpdump -i vlan13 -n
 J>  tcpdump: verbose output suppressed, use -v or -vv for full protocol =20
 J>  decode
 J>  listening on vlan13, link-type EN10MB (Ethernet), capture size 96 bytes
 J>  23:51:51.867387 IP 172.28.7.1 > 224.0.0.18: VRRPv2, Advertisement, =20
 J>  vrid 10, prio 240, authtype none, intvl 1s, length 36
 J>  23:51:53.806407 IP 172.28.7.1 > 224.0.0.18: VRRPv2, Advertisement, =20
 J>  vrid 10, prio 240, authtype none, intvl 1s, length 36
 J>  ^C
 J>  2 packets captured
 J>  2 packets received by filter
 J>  0 packets dropped by kernel
 
 What is the value of net.inet.carp.suppress_preempt sysctl, when you
 see the problem?
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Mar 2 02:42:28 UTC 2008 
State-Changed-Why:  
Feedback timeout (> 1 year). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93448 
>Unformatted:
