From owner-freebsd-net@FreeBSD.ORG Mon Jan 17 21:30:41 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4694106566C; Mon, 17 Jan 2011 21:30:41 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A39BF8FC14; Mon, 17 Jan 2011 21:30:41 +0000 (UTC) Received: by pwi10 with SMTP id 10so1047957pwi.13 for ; Mon, 17 Jan 2011 13:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=0DCgXD0wBFmmg8hpYHWy2pn/HFZXO4mY7dN1EpPQFfk=; b=eymTwijjHwVjhXamwA7U0Q42pLml19gJAWfXbMXtId8zb6xsRXWgXYgw9/jp7o/iQD pRdG96bA1BjmvtaA7M4pgXLh04FRfjdYApy5ecNu02WVhyK5f3HUk2hQTEt7fLkTJnjS svk/YnYHLopCVxM6QekbV4x1lg62P6Q5s2Fjg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=re29GeMKAvxcqEeZ8Xn2Bn8pZ9Mghf2YdzEsGR6JAhgN0sbaQ81eR8A183vT/E0O/X qensrTJMZP99ZWb98qKFruCjmT5pnluh+rtW8ba9bDW8gs3KjOFZ38wE38RUqMTw/gYb fUvivPx6y5ZaI+KOX6KmlwaX9iWAJlOhepGlQ= Received: by 10.142.140.3 with SMTP id n3mr2387495wfd.276.1295299841146; Mon, 17 Jan 2011 13:30:41 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id x28sm4348158wfd.16.2011.01.17.13.30.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Jan 2011 13:30:39 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 17 Jan 2011 13:29:47 -0800 From: Pyun YongHyeon Date: Mon, 17 Jan 2011 13:29:47 -0800 To: Paul Schenkeveld Message-ID: <20110117212947.GA1210@michelle.cdnetworks.com> References: <20110116124122.GA63358@psconsult.nl> <20110117195615.GA18423@psconsult.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <20110117195615.GA18423@psconsult.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org, re@freebsd.org Subject: Re: sis(4) broken on 8.2 [Re: Carp seems completely broken on 8.2-RC2 and 8.2-PRERELEASE] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 21:30:42 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 17, 2011 at 08:56:15PM +0100, Paul Schenkeveld wrote: > On Sun, Jan 16, 2011 at 01:41:22PM +0100, Paul Schenkeveld wrote: > > Hi, > > > > Trying to upgrade two Soekris firewalls to 8-STABLE or 8.2-PRERELEASE > > it appears that carp doesn't work at all. I've set up carp like I've > > done on many firewall pairs before and they all work correctly. With > > google, nor in the mailing lists, I could find anything about changes > > in the way carp get configured but if I missed something I'd be happy > > to hear that it's my fault. > > > > Here's the setup: > > > > net5501 > > test3 > > 10.4.0.4/24 > > | > > -------------+------------- > > | | > > net4801 net4801 > > test1 test2 > > sis4: 10.4.0.2/24 sis4: 10.4.0.3/24 > > carp4:10.4.0.1/24 carp4:10.4.0.1/24 > > | | | | | | | | > > | | | | | | | | > > sis[0-3] connected to other networks, see > > explanation below. > > > > When I ping from test3 to 10.4.0.1, I see the following traffic using > > tcpdump: > > > > test3 # tcpdump -e -n -i vr3 not vrrp > > tcpdump: verbose output suppressed, use -v or -vv for full protocol decode > > listening on vr3, link-type EN10MB (Ethernet), capture size 96 bytes > > 12:09:35.121831 00:00:24:c9:30:ff > ff:ff:ff:ff:ff:ff, > > ethertype ARP (0x0806), length 60: > > Request who-has 10.4.0.1 tell 10.4.0.4, length 46 > > 12:09:35.122144 00:00:24:c3:49:91 > 00:00:24:c9:30:ff, > > ethertype ARP (0x0806), length 60: > > Reply 10.4.0.1 is-at 00:00:5e:00:01:68, length 46 > > 12:09:35.122173 00:00:24:c9:30:ff > 00:00:5e:00:01:68, > > ethertype IPv4 (0x0800), length 98: > > 10.4.0.4 > 10.4.0.1: ICMP echo request, > > id 40482, seq 0, length 64 > > > > test1 # tcpdump -e -n -i sis4 not vrrp > > tcpdump: verbose output suppressed, use -v or -vv for full protocol decode > > listening on sis4, link-type EN10MB (Ethernet), capture size 96 bytes > > 12:09:34.977570 00:00:24:c9:30:ff > ff:ff:ff:ff:ff:ff, > > ethertype ARP (0x0806), length 60: > > Request who-has 10.4.0.1 tell 10.4.0.4, length 46 > > 12:09:34.977705 00:00:24:c3:49:91 > 00:00:24:c9:30:ff, > > ethertype ARP (0x0806), length 42: > > Reply 10.4.0.1 is-at 00:00:5e:00:01:68, length 28 > > > > test2 # dump -e -n -i sis4 not vrrp > > tcpdump: verbose output suppressed, use -v or -vv for full protocol decode > > listening on sis4, link-type EN10MB (Ethernet), capture size 96 bytes > > 12:09:35.090050 00:00:24:c9:30:ff > ff:ff:ff:ff:ff:ff, > > ethertype ARP (0x0806), length 60: > > Request who-has 10.4.0.1 tell 10.4.0.4, length 46 > > > > There is an ARP request which is replied to by the carp master (test). > > the ping to the carp address does not even appear on the sis4 interface > > of test1. > > > > This is the kernel config for test1 and test2: > > > > include GENERIC > > device carp > > makeoptions MODULES_OVERRIDE="" > > > > The relevant rc.conf bits: > > > > on test1 > > hostname="test1" > > cloned_interfaces="carp1 carp2 carp3 carp4" > > ifconfig_sis0="xxx.xxx.xxx.41/26" > > ifconfig_sis1="10.1.0.2/24" > > ifconfig_sis2="10.2.0.2/24" > > ifconfig_sis3="10.3.0.2/24" > > ifconfig_sis4="10.4.0.2/24" > > ifconfig_carp1="10.1.0.1/24 vhid 101 pass abcd1234 advskew 0" > > ifconfig_carp2="10.2.0.1/24 vhid 102 pass abcd1234 advskew 0" > > ifconfig_carp3="10.3.0.1/24 vhid 103 pass abcd1234 advskew 0" > > ifconfig_carp4="10.4.0.1/24 vhid 104 pass abcd1234 advskew 0" > > > > on test2 > > hostname="test2" > > cloned_interfaces="carp1 carp2 carp3 carp4" > > ifconfig_sis0="xxx.xxx.xxx.42/26" > > ifconfig_sis1="10.1.0.3/24" > > ifconfig_sis2="10.2.0.3/24" > > ifconfig_sis3="10.3.0.3/24" > > ifconfig_sis4="10.4.0.3/24" > > ifconfig_carp1="10.1.0.1/24 vhid 101 pass abcd1234 advskew 100" > > ifconfig_carp2="10.2.0.1/24 vhid 102 pass abcd1234 advskew 100" > > ifconfig_carp3="10.3.0.1/24 vhid 103 pass abcd1234 advskew 100" > > ifconfig_carp4="10.4.0.1/24 vhid 104 pass abcd1234 advskew 100" > > > > In /etc/sysctl.conf: > > net.inet.carp.preempt=1 > > > > Ifconfig output: > > > > test1 # ifconfig sis4 > > sis4: flags=8943 metric 0 mtu 1500 > > options=83808 > > ether 00:00:24:c3:49:91 > > inet 10.4.0.2 netmask 0xffffff00 broadcast 10.4.0.255 > > media: Ethernet autoselect (100baseTX ) > > status: active > > test1 # ifconfig carp4 > > carp4: flags=49 metric 0 mtu 1500 > > inet 10.4.0.1 netmask 0xffffff00 > > carp: MASTER vhid 104 advbase 1 advskew 0 > > > > test2 # ifconfig sis4 > > sis4: flags=8943 metric 0 mtu 1500 > > options=83808 > > ether 00:00:24:c3:49:7d > > inet 10.4.0.3 netmask 0xffffff00 broadcast 10.4.0.255 > > media: Ethernet autoselect (100baseTX ) > > status: active > > test2 # ifconfig carp4 > > carp4: flags=49 metric 0 mtu 1500 > > inet 10.4.0.1 netmask 0xffffff00 > > carp: BACKUP vhid 104 advbase 1 advskew 100 > > > > There are no packet filters in place, sis1, sis2 and sis3 are wired > > through cross-cables from test1 to test2, so no traffic there except for > > carp. The sis4 interfaces and vr3 of test3 are on a dumb switch with no > > other stuff connected. > > > > Setting net.inet.carp.log=7 does not result in any console/dmesg/messages > > output. > > > > I see carp traffic on sis4 which appears normal except that I don't > > understand the addrs(7): part but that used to be there on 8.0/8.1 > > firewalls too: > > > > 12:26:52.387140 00:00:5e:00:01:68 > 01:00:5e:00:00:12, > > ethertype IPv4 (0x0800), length 70: > > (tos 0x10, ttl 255, id 61070, offset 0, flags [DF], > > proto VRRP (112), length 56) > > 10.4.0.2 > 224.0.0.18: VRRPv2, Advertisement, > > vrid 104, prio 0, authtype none, intvl 1s, length 36, > > addrs(7): 198.145.25.33,1.75.182.226,80.169.106.108, > > 170.107.157.42,147.165.174.125,42.254.15.27,182.184.82.166 > > > > 12:26:53.387903 00:00:5e:00:01:68 > 01:00:5e:00:00:12, > > ethertype IPv4 (0x0800), length 70: > > (tos 0x10, ttl 255, id 61479, offset 0, flags [DF], > > proto VRRP (112), length 56) > > 10.4.0.2 > 224.0.0.18: VRRPv2, Advertisement, > > vrid 104, prio 0, authtype none, intvl 1s, length 36, > > addrs(7): 101.233.35.135,163.243.214.16,230.125.241.59, > > 123.57.190.52,104.246.131.251,255.69.201.65,61.158.20.122 > > After taking apart two Soekris 4801 and replacing the lan1621 dual sis(4) > network card by an Intel PRO/100S (fxp) or a PRO/1000/MT (em) card, carp > works again on this interface. > > Apparently the problem is not with carp(4) but with sis(4). > > Since Soekris hardware (net45xx, net48xx, lan16xx) is quite popular for > firewalls and carp is quite often used together with this hardware, this > looks like a showstopper for 8.2 :-( > Since you didn't post dmesg output I'm not sure what kind of controller you have but I guess it would be NS8381[56]. I overhauled sis(4) to make it work on all architectures so one of change, probably r212119, could be cause of the issue. Due to lack of SiS controllers I didn't touch multicast handling part so some part of code still relies on old wrong behavior of driver. Would you try attached patch and let me know whether it makes any difference? > Regards, > > Paul Schenkeveld --fdj2RfSjLxBAspz7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sis.promisc.diff" Index: sys/dev/sis/if_sis.c =================================================================== --- sys/dev/sis/if_sis.c (revision 217490) +++ sys/dev/sis/if_sis.c (working copy) @@ -818,6 +818,8 @@ if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_PROMISC) + SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); return; } @@ -826,7 +828,8 @@ * on the NatSemi chip if we want to use it, which we do. */ SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI | + SIS_RXFILTCTL_ALLPHYS); filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); --fdj2RfSjLxBAspz7--