From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 02:12:06 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEBA216A504 for ; Sun, 28 Sep 2003 02:12:06 -0700 (PDT) Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEA5744011 for ; Sun, 28 Sep 2003 02:12:05 -0700 (PDT) (envelope-from yannick.dambielle@free.fr) Received: from shibuya (nord-5-82-67-198-63.fbx.proxad.net [82.67.198.63]) by postfix3-2.free.fr (Postfix) with SMTP id AFC1EC359; Sun, 28 Sep 2003 11:11:53 +0200 (CEST) Message-ID: <001401c385a0$95536d00$3fc64352@shibuya> From: "Dambielle Yannick" To: "Giovanni P. Tirloni" , References: <001301c38545$27a15cf0$3fc64352@shibuya> <20030928045919.GB92528@pixies.tirloni.org> Date: Sun, 28 Sep 2003 11:11:53 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 09:12:06 -0000 When I sniff lo0, I have this result : 10:09:12 10.0.0.1 > 10.0.0.1: icmp: echo request 10:09:12 10.0.0.1 > 10.0.0.1: icmp: echo reply ... I've noticed that in dmesg: tap0: discard frame w/o leading ethernet header (len 2 pkt len2) I don't know anything about that (?!?) Does it works for you when you sniff a tap interface ? Yannick ----- Original Message ----- From: "Giovanni P. Tirloni" To: Sent: Sunday, September 28, 2003 6:59 AM Subject: Re: tcpdump - tun/tap virtual interfaces > * Dambielle Yannick (yannick.dambielle@free.fr) wrote: > > Hello everybody, > > > > I've tried to dump some paquets sent to a virtual interface without any > > success for a couple of hours so I ask for some helps to the list. > > I use a FreeBSD 5.0, my kernel has been rebuilt and installed with the > > following option in order to use a tap virtual interface : device tap > > The virtual interface has been created (tap0) and I've attached the IP > > adress 10.0.0.1. It seems ok, I can see it with ifconfig. > > All the tests are local tests. > > While I ping 10.0.0.1 (paquets are sent and not lost), I laught a tcpdump -i > > tap0 from another shell... Nothing is dumped (?!)... > > Well, if some of you has an idea, I'll be very happy. > > Try sniffing your loopback (lo0) interface. > > -- > Giovanni P. Tirloni > Fingerprint: 8C3F BEC5 79BD 3E9B EDB8 72F4 16E8 BA5E D031 5C26 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 09:41:04 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4587416A4B3 for ; Sun, 28 Sep 2003 09:41:04 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 620E643FE9 for ; Sun, 28 Sep 2003 09:41:03 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id h8SGeW7R039009; Sun, 28 Sep 2003 12:40:32 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h8SGeWUP039006; Sun, 28 Sep 2003 12:40:32 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 28 Sep 2003 12:40:32 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Dambielle Yannick In-Reply-To: <001301c38545$27a15cf0$3fc64352@shibuya> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 16:41:04 -0000 On Sun, 28 Sep 2003, Dambielle Yannick wrote: > I've tried to dump some paquets sent to a virtual interface without any > success for a couple of hours so I ask for some helps to the list. I > use a FreeBSD 5.0, my kernel has been rebuilt and installed with the > following option in order to use a tap virtual interface : device tap > The virtual interface has been created (tap0) and I've attached the IP > adress 10.0.0.1. It seems ok, I can see it with ifconfig. All the tests > are local tests. While I ping 10.0.0.1 (paquets are sent and not lost), > I laught a tcpdump -i tap0 from another shell... Nothing is dumped > (?!)... Well, if some of you has an idea, I'll be very happy. Do you see anything when you ping the broadcast address or other foreign address of the tap interface? Packets delivered to local IP addresses generally don't go out an interface. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 10:15:04 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCEC516A4B3; Sun, 28 Sep 2003 10:15:04 -0700 (PDT) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8DCD4400B; Sun, 28 Sep 2003 10:15:01 -0700 (PDT) (envelope-from yannick.dambielle@free.fr) Received: from shibuya (nord-5-82-67-198-63.fbx.proxad.net [82.67.198.63]) by postfix4-2.free.fr (Postfix) with SMTP id 2BBF5C47B; Sun, 28 Sep 2003 19:15:00 +0200 (CEST) Message-ID: <001401c385e4$0cfde770$3fc64352@shibuya> From: "Dambielle Yannick" To: "Robert Watson" References: Date: Sun, 28 Sep 2003 19:15:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 17:15:05 -0000 ----- Original Message ----- From: "Robert Watson" To: "Dambielle Yannick" Cc: Sent: Sunday, September 28, 2003 6:40 PM Subject: Re: tcpdump - tun/tap virtual interfaces > > On Sun, 28 Sep 2003, Dambielle Yannick wrote: > > > I've tried to dump some paquets sent to a virtual interface without any > > success for a couple of hours so I ask for some helps to the list. I > > use a FreeBSD 5.0, my kernel has been rebuilt and installed with the > > following option in order to use a tap virtual interface : device tap > > The virtual interface has been created (tap0) and I've attached the IP > > adress 10.0.0.1. It seems ok, I can see it with ifconfig. All the tests > > are local tests. While I ping 10.0.0.1 (paquets are sent and not lost), > > I laught a tcpdump -i tap0 from another shell... Nothing is dumped > > (?!)... Well, if some of you has an idea, I'll be very happy. > > Do you see anything when you ping the broadcast address or other foreign > address of the tap interface? Packets delivered to local IP addresses > generally don't go out an interface. > > Robert N M Watson FreeBSD Core Team, TrustedBSD Projects > robert@fledge.watson.org Network Associates Laboratories > When I try to ping the broadcast address I have the following results: # ping 10.0.0.255 ping: sendto: Permission denied ... Bellow is how I do for setting up a virtual interface : # echo 1 > /dev/tap1 # ifconfig tap1 up # ifconfig tap1 inet 10.0.10.1/24 add # ifconfig <-- show me that tap1 has 10.0.10.1 attached and is also running On the first shell, I ping 10.0.10.1 # ping 10.0.10.1 64 butes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.137ms 64 butes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.137ms ... On a second shell, I try to dump # tcpdump -i tap1 That wait... that wait... Nothing comes :/ Let's try to ping the broadcast address # ping 10.0.10.255 ping: sendto: Permission denied, same as before ... Well, any ideas are welcome. From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 10:24:18 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 468B816A4B3 for ; Sun, 28 Sep 2003 10:24:18 -0700 (PDT) Received: from pixies.tirloni.org (pixies.tirloni.org [200.203.183.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F40343FDD for ; Sun, 28 Sep 2003 10:24:16 -0700 (PDT) (envelope-from tirloni@tirloni.org) Received: from localhost (pixies [200.203.183.37]) by pixies.tirloni.org (Postfix) with ESMTP id E6DA81E146F for ; Sun, 28 Sep 2003 14:24:13 -0300 (BRT) Received: from pixies.tirloni.org ([200.203.183.37]) by localhost (pixies.tirloni.org [200.203.183.37]) (amavisd-new, port 10024) with ESMTP id 44409-07 for ; Sun, 28 Sep 2003 14:24:02 -0300 (BRT) Received: by pixies.tirloni.org (Postfix, from userid 1000) id 1E7051E141B; Sun, 28 Sep 2003 14:24:02 -0300 (BRT) Date: Sun, 28 Sep 2003 14:24:01 -0300 From: "Giovanni P. Tirloni" To: freebsd-net@freebsd.org Message-ID: <20030928172401.GC92528@pixies.tirloni.org> Mail-Followup-To: freebsd-net@freebsd.org References: <001301c38545$27a15cf0$3fc64352@shibuya> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Info: http://www.tirloni.org User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at tirloni.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 17:24:18 -0000 * Robert Watson (rwatson@freebsd.org) wrote: > Do you see anything when you ping the broadcast address or other foreign > address of the tap interface? Packets delivered to local IP addresses > generally don't go out an interface. About Ethernet frames not going out to the wire and being sent to the loopback.. The check seems to happen at line 291 in if_ethersubr.c and then it uses the if_simloop() function to copy the packet to the loopback interface. Is that right? The rcvif interface is set to the hardware device, how is this used in this case? What kind of checks are done to the rcvif usually? I haven't received my copy of Steven's Volume 2 yet so if it's explained there (as I hope) I will sit in my corner and wait to for it patiently :) -- Giovanni P. Tirloni Fingerprint: 8C3F BEC5 79BD 3E9B EDB8 72F4 16E8 BA5E D031 5C26 From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 10:59:57 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B787816A4B3 for ; Sun, 28 Sep 2003 10:59:57 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFB8944017 for ; Sun, 28 Sep 2003 10:59:56 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id h8SHxQ7R051357; Sun, 28 Sep 2003 13:59:26 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h8SHxQ9q051354; Sun, 28 Sep 2003 13:59:26 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 28 Sep 2003 13:59:25 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Dambielle Yannick In-Reply-To: <001401c385e4$0cfde770$3fc64352@shibuya> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 17:59:57 -0000 On Sun, 28 Sep 2003, Dambielle Yannick wrote: > When I try to ping the broadcast address I have the following results: > # ping 10.0.0.255 > ping: sendto: Permission denied > ... This is not the broadcast address for the network you've configured. It should be 10.0.10.255. > Bellow is how I do for setting up a virtual interface : > # echo 1 > /dev/tap1 This is the origin of your spurious console message: needless to say, '1' is not a valid ethernet frame. However, it should be sufficient to cause the tap interface to clone, etc. You might try instead "dd if=/dev/tap0 of=/dev/null bs=1500" which provides a sink for the packet data. Otherwise, you risk the tap interface being pulled out from under you. Note that if the device is not open, it could well be that tap quietly eats the packets, since they have nowhere to go. In this event, they might well not show up on the BPF device. > # ifconfig tap1 up > # ifconfig tap1 inet 10.0.10.1/24 add > # ifconfig <-- show me that tap1 has 10.0.10.1 attached and is also running > > On the first shell, I ping 10.0.10.1 > # ping 10.0.10.1 > 64 butes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.137ms > 64 butes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.137ms > ... This is fine -- you're ping the localhost, which the routing system knows does not need to go on the wire. > On a second shell, I try to dump > # tcpdump -i tap1 > That wait... that wait... Nothing comes :/ This will only show packets on the wire, the 10.0.10.1 packets won't go on the wire, so that's fine too. > Let's try to ping the broadcast address > # ping 10.0.10.255 > ping: sendto: Permission denied, same as before > ... > Well, any ideas are welcome. On my 5.x-CURRENT box: test1# ping 10.0.10.255 PING 10.0.10.255 (10.0.10.255): 56 data bytes 13:48:24.915656 0:bd:5b:fb:f:1 ff:ff:ff:ff:ff:ff 0800 98: 10.0.10.1 > 10.0.10.255: icmp: echo request RELENG_4: test2# ping 10.0.10.4 PING 10.0.10.4 (10.0.10.4): 56 data bytes 09:54:27.506679 0:bd:81:ae:10:0 ff:ff:ff:ff:ff:ff 0806 42: arp who-has 10.0.10.4 (0:0:0:0:0:2) tell 10.0.10.1 First, I notice that your example above uses 10.0.0.255 not 10.0.10.255. Check to make sure you're using the correct IP address. 10.0.10.4 causes an ARP lookup, which also appears fine in my configuration. Second, make sure any firewall rules don't prohibit traffic to the address range in question. This might explain the permission denied message. This might also be a result of the interface evaporating, see the next thing to try. Third, use dd or cat to keep the tap device open -- don't let it close, or it can be reclaimed and the packets will go out another interface trying to find the address range. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 11:05:57 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6DB916A4B3 for ; Sun, 28 Sep 2003 11:05:57 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C304244032 for ; Sun, 28 Sep 2003 11:05:56 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9p2/8.12.9) with ESMTP id h8SI5O7R052328; Sun, 28 Sep 2003 14:05:24 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h8SI5Oq0052325; Sun, 28 Sep 2003 14:05:24 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 28 Sep 2003 14:05:24 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: "Giovanni P. Tirloni" In-Reply-To: <20030928172401.GC92528@pixies.tirloni.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 18:05:57 -0000 On Sun, 28 Sep 2003, Giovanni P. Tirloni wrote: > * Robert Watson (rwatson@freebsd.org) wrote: > > > Do you see anything when you ping the broadcast address or other foreign > > address of the tap interface? Packets delivered to local IP addresses > > generally don't go out an interface. > > About Ethernet frames not going out to the wire and being sent to the > loopback.. > > The check seems to happen at line 291 in if_ethersubr.c and then it > uses the if_simloop() function to copy the packet to the loopback > interface. Is that right? > > The rcvif interface is set to the hardware device, how is this used in > this case? What kind of checks are done to the rcvif usually? > > I haven't received my copy of Steven's Volume 2 yet so if it's > explained there (as I hope) I will sit in my corner and wait to for it > patiently :) Ethernet loopback does occur, and BPF will pick those up. However, the loopback you're seeing is actually happening at the IP layer, as a result of routing rather than link layer behavior: 10 link#6 UC 1 0 tap0 10.0.10.1 00:bd:18:a1:11:00 UHLW 0 26 lo0 Local IP addresses have their packets routed to them over lo0, so the packets being looked for can be found by doing tcpdump on lo0: test1# tcpdump -eni lo0 & [2] 511 tcpdump: listening on lo0 test1# Sep 28 14:03:07 test1 kernel: lo0: promiscuous mode enabled test1# ping -c 1 10.0.10.1 PING 10.0.10.1 (10.0.10.1): 56 data bytes 64 bytes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.073 ms --- 10.0.10.1 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.073/0.073/0.073/0.000 ms test1# 14:03:12.713690 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo request 14:03:12.713724 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo reply Route command output appended below. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories route get 10.0.10.1 route to: 10.0.10.1 destination: 10.0.10.1 interface: lo0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 test1# route get 10.0.10.2 route to: 10.0.10.2 destination: 10.0.0.0 mask: 255.0.0.0 interface: tap0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 -100 From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 15:34:21 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E2A316A4B3; Sun, 28 Sep 2003 15:34:21 -0700 (PDT) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C66343FB1; Sun, 28 Sep 2003 15:34:20 -0700 (PDT) (envelope-from yannick.dambielle@free.fr) Received: from shibuya (nord-5-82-67-198-63.fbx.proxad.net [82.67.198.63]) by postfix4-2.free.fr (Postfix) with SMTP id 3E897C1B0; Mon, 29 Sep 2003 00:34:08 +0200 (CEST) Message-ID: <006201c38610$a8a0b910$3fc64352@shibuya> From: "Dambielle Yannick" To: "Robert Watson" , "Giovanni P. Tirloni" References: Date: Mon, 29 Sep 2003 00:34:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 22:34:21 -0000 Hello, Thank you very much for the details. I think I'm starting to understand the subject better. Well, I've did all again from the beggining and now I have the same results has you had. It works. 10.0.10.1 is routed via lo0, and 10.0.10.2 is routed via tap0. Icmp requests and replies could be seen with tcpdump on lo0 for 10.0.10.1, but for 10.0.10.2, the request were passing trough tap0 while the replies took lo0 (??). I don't know, if what I'm going to say is the right method for having both replies and requests passing through the same interface, so please, give me a better one. I did the following trick : # route add 10.0.10.1 10.0.10.2 and the result is : # route get 10.0.10.1 route to: 10.0.10.1 destination: 10.0.0.1 gateway: 10.0.0.1 interface: tap0 # route get 10.0.10.2 route to: 10.0.10.2 destination: 10.0.0.2 interface: tap0 # ping 10.0.0.1 # tcpdump -i lo0 <-- nothing # tcpdump -i tap0 blablabla.... icmp: echo request blablabla.... icmp: echo reply # ping 10.0.0.2 # tcpdump -i lo0 <-- nothing # tcpdump -i tap0 blablabla.... icmp: echo request blablabla.... icmp: echo reply Now I can go back to my jails and my little project :) Yannick ----- Original Message ----- From: "Robert Watson" To: "Giovanni P. Tirloni" Cc: Sent: Sunday, September 28, 2003 8:05 PM Subject: Re: tcpdump - tun/tap virtual interfaces > > On Sun, 28 Sep 2003, Giovanni P. Tirloni wrote: > > > * Robert Watson (rwatson@freebsd.org) wrote: > > > > > Do you see anything when you ping the broadcast address or other foreign > > > address of the tap interface? Packets delivered to local IP addresses > > > generally don't go out an interface. > > > > About Ethernet frames not going out to the wire and being sent to the > > loopback.. > > > > The check seems to happen at line 291 in if_ethersubr.c and then it > > uses the if_simloop() function to copy the packet to the loopback > > interface. Is that right? > > > > The rcvif interface is set to the hardware device, how is this used in > > this case? What kind of checks are done to the rcvif usually? > > > > I haven't received my copy of Steven's Volume 2 yet so if it's > > explained there (as I hope) I will sit in my corner and wait to for it > > patiently :) > > Ethernet loopback does occur, and BPF will pick those up. However, the > loopback you're seeing is actually happening at the IP layer, as a result > of routing rather than link layer behavior: > > 10 link#6 UC 1 0 tap0 > 10.0.10.1 00:bd:18:a1:11:00 UHLW 0 26 lo0 > > Local IP addresses have their packets routed to them over lo0, so the > packets being looked for can be found by doing tcpdump on lo0: > > test1# tcpdump -eni lo0 & > [2] 511 > tcpdump: listening on lo0 > test1# Sep 28 14:03:07 test1 kernel: lo0: promiscuous mode enabled > > test1# ping -c 1 10.0.10.1 > PING 10.0.10.1 (10.0.10.1): 56 data bytes > 64 bytes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.073 ms > > --- 10.0.10.1 ping statistics --- > 1 packets transmitted, 1 packets received, 0% packet loss > round-trip min/avg/max/stddev = 0.073/0.073/0.073/0.000 ms > test1# 14:03:12.713690 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo request > 14:03:12.713724 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo reply > > Route command output appended below. > > Robert N M Watson FreeBSD Core Team, TrustedBSD Projects > robert@fledge.watson.org Network Associates Laboratories > > route get 10.0.10.1 > route to: 10.0.10.1 > destination: 10.0.10.1 > interface: lo0 > flags: > recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu > expire > 0 0 0 0 0 0 1500 > 0 > test1# route get 10.0.10.2 > route to: 10.0.10.2 > destination: 10.0.0.0 > mask: 255.0.0.0 > interface: tap0 > flags: > recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu > expire > 0 0 0 0 0 0 1500 > -100 > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 15:57:40 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D87D16A4B3; Sun, 28 Sep 2003 15:57:40 -0700 (PDT) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A37343FF5; Sun, 28 Sep 2003 15:57:39 -0700 (PDT) (envelope-from yannick.dambielle@free.fr) Received: from shibuya (nord-5-82-67-198-63.fbx.proxad.net [82.67.198.63]) by postfix4-2.free.fr (Postfix) with SMTP id 15052C195; Mon, 29 Sep 2003 00:57:38 +0200 (CEST) Message-ID: <006c01c38613$eaa728f0$3fc64352@shibuya> From: "Dambielle Yannick" To: "Dambielle Yannick" , "Robert Watson" , "Giovanni P. Tirloni" References: <006201c38610$a8a0b910$3fc64352@shibuya> Date: Mon, 29 Sep 2003 00:57:39 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2003 22:57:40 -0000 Sorry for the mistakes (again)... need to sleep :/ Bellow are the right results with the right ip address... # route add 10.0.10.1 10.0.10.2 results are : # route get 10.0.10.1 route to: 10.0.10.1 destination: 10.0.10.1 gateway: 10.0.10.2 interface: tap0 # route get 10.0.10.2 route to: 10.0.10.2 destination: 10.0.10.2 interface: tap0 # ping 10.0.10.1 # tcpdump -i lo0 <-- nothing # tcpdump -i tap0 blablabla.... icmp: echo request blablabla.... icmp: echo reply # ping 10.0.10.2 # tcpdump -i lo0 <-- nothing # tcpdump -i tap0 blablabla.... icmp: echo request blablabla.... icmp: echo reply Yannick ----- Original Message ----- From: "Dambielle Yannick" To: "Robert Watson" ; "Giovanni P. Tirloni" Cc: Sent: Monday, September 29, 2003 12:34 AM Subject: Re: tcpdump - tun/tap virtual interfaces > Hello, > Thank you very much for the details. I think I'm starting to understand the > subject better. > Well, I've did all again from the beggining and now I have the same results > has you had. It works. > 10.0.10.1 is routed via lo0, and 10.0.10.2 is routed via tap0. > Icmp requests and replies could be seen with tcpdump on lo0 for 10.0.10.1, > but for 10.0.10.2, the request were passing trough tap0 while the replies > took lo0 (??). > I don't know, if what I'm going to say is the right method for having both > replies and requests passing through the same interface, so please, give me > a better one. > > I did the following trick : > > # route add 10.0.10.1 10.0.10.2 > > and the result is : > > # route get 10.0.10.1 > route to: 10.0.10.1 > destination: 10.0.0.1 > gateway: 10.0.0.1 > interface: tap0 > > # route get 10.0.10.2 > route to: 10.0.10.2 > destination: 10.0.0.2 > interface: tap0 > > # ping 10.0.0.1 > # tcpdump -i lo0 <-- nothing > # tcpdump -i tap0 > blablabla.... icmp: echo request > blablabla.... icmp: echo reply > > # ping 10.0.0.2 > # tcpdump -i lo0 <-- nothing > # tcpdump -i tap0 > blablabla.... icmp: echo request > blablabla.... icmp: echo reply > > Now I can go back to my jails and my little project :) > > Yannick > > ----- Original Message ----- > From: "Robert Watson" > To: "Giovanni P. Tirloni" > Cc: > Sent: Sunday, September 28, 2003 8:05 PM > Subject: Re: tcpdump - tun/tap virtual interfaces > > > > > > On Sun, 28 Sep 2003, Giovanni P. Tirloni wrote: > > > > > * Robert Watson (rwatson@freebsd.org) wrote: > > > > > > > Do you see anything when you ping the broadcast address or other > foreign > > > > address of the tap interface? Packets delivered to local IP addresses > > > > generally don't go out an interface. > > > > > > About Ethernet frames not going out to the wire and being sent to the > > > loopback.. > > > > > > The check seems to happen at line 291 in if_ethersubr.c and then it > > > uses the if_simloop() function to copy the packet to the loopback > > > interface. Is that right? > > > > > > The rcvif interface is set to the hardware device, how is this used in > > > this case? What kind of checks are done to the rcvif usually? > > > > > > I haven't received my copy of Steven's Volume 2 yet so if it's > > > explained there (as I hope) I will sit in my corner and wait to for it > > > patiently :) > > > > Ethernet loopback does occur, and BPF will pick those up. However, the > > loopback you're seeing is actually happening at the IP layer, as a result > > of routing rather than link layer behavior: > > > > 10 link#6 UC 1 0 tap0 > > 10.0.10.1 00:bd:18:a1:11:00 UHLW 0 26 lo0 > > > > Local IP addresses have their packets routed to them over lo0, so the > > packets being looked for can be found by doing tcpdump on lo0: > > > > test1# tcpdump -eni lo0 & > > [2] 511 > > tcpdump: listening on lo0 > > test1# Sep 28 14:03:07 test1 kernel: lo0: promiscuous mode enabled > > > > test1# ping -c 1 10.0.10.1 > > PING 10.0.10.1 (10.0.10.1): 56 data bytes > > 64 bytes from 10.0.10.1: icmp_seq=0 ttl=64 time=0.073 ms > > > > --- 10.0.10.1 ping statistics --- > > 1 packets transmitted, 1 packets received, 0% packet loss > > round-trip min/avg/max/stddev = 0.073/0.073/0.073/0.000 ms > > test1# 14:03:12.713690 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo request > > 14:03:12.713724 AF 2 84: 10.0.10.1 > 10.0.10.1: icmp: echo reply > > > > Route command output appended below. > > > > Robert N M Watson FreeBSD Core Team, TrustedBSD Projects > > robert@fledge.watson.org Network Associates Laboratories > > > > route get 10.0.10.1 > > route to: 10.0.10.1 > > destination: 10.0.10.1 > > interface: lo0 > > flags: > > recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu > > expire > > 0 0 0 0 0 0 1500 > > 0 > > test1# route get 10.0.10.2 > > route to: 10.0.10.2 > > destination: 10.0.0.0 > > mask: 255.0.0.0 > > interface: tap0 > > flags: > > recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu > > expire > > 0 0 0 0 0 0 1500 > > -100 > > > > > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sun Sep 28 21:33:41 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E69AA16A4B3 for ; Sun, 28 Sep 2003 21:33:41 -0700 (PDT) Received: from jchurch.neville-neil.com (jchurch.neville-neil.com [209.157.133.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D34E44048 for ; Sun, 28 Sep 2003 21:33:39 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from jchurch.neville-neil.com.neville-neil.com (localhost [127.0.0.1])h8T4XcTC004896 for ; Sun, 28 Sep 2003 21:33:38 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Sun, 28 Sep 2003 21:33:38 -0700 Message-ID: <87wubs2oyl.wl@jchurch.neville-neil.com.neville-neil.com> From: "George V. Neville-Neil" To: freebsd-net@freebsd.org User-Agent: Wanderlust/2.10.0 (Venus) SEMI/1.14.4 (Hosorogi) FLIM/1.14.4 (=?ISO-8859-4?Q?Kashiharajing=FE-mae?=) APEL/10.4 Emacs/21.2 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Subject: Receive packet processing. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 04:33:42 -0000 Hi, I'm tryinbg to follow packets flowing up from an ethernet device driver (if_fxp.c in this case) and as far as I can tell they are processed completely at device interrupt level unless deferred in netisr_dispatch(). Is that correct? Thanks, George From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 01:15:45 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D26D16A4B3 for ; Mon, 29 Sep 2003 01:15:45 -0700 (PDT) Received: from ns.giprovostokneft.ru (ns.giprovostokneft.ru [195.128.153.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4116944022 for ; Mon, 29 Sep 2003 01:15:44 -0700 (PDT) (envelope-from petr999@kengu.ru) Received: by ns.giprovostokneft.ru (Postfix, from userid 729) id DC63735F; Mon, 29 Sep 2003 08:14:13 +0000 (UTC) Date: Mon, 29 Sep 2003 13:14:13 +0500 From: Peter To: freebsd-net@freebsd.org Message-ID: <20030929081413.GA10445@least.beast> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Organization: ' Subject: iy(4) and 0x23 ex(4) panic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 08:15:45 -0000 Hello. I am newbie to BSD, so please be patient of a stupid question& =) I have a good card intel etherexpress 10 isa utp. It is based on 82595 chip as well as ee10pro card. So I supposed I can use it with ex(4) driver. But, the kernel says: ex0: ifmedia_set: no match for 0x23/0xffffffff. I tried to find out answer with no success in Google including groups. The best match for me was that TPE connector is unplugged, but this is NOT the case. I surely turned off PNP in card's configurator, as well as changed base-address/IRQ and powering off/on after this. Some guy on IRC told FBSD works poorly on intel ISA cards. But w95 does pretty at the same machine (with PNP turned in card, though), and, I am somewhy sure, Linux will? I am even wondering what does this 0x23 should mean? Also it makes me wonder that Free has no ifmedia_set(4) man page like Open does? And! I saw even iy(4) driver in Open but see no one in Free? could I see the third-party provided iy(4) anywhere? As I said I am newbie, but I had no troubles to setup my 3Com card with xl(4). We have expensive traffic here, in the middle of Russia, so it's too hard to change Free on Open to try. PLEASE HELP! From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 05:47:51 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF2C416A4B3; Mon, 29 Sep 2003 05:47:51 -0700 (PDT) Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id A342843FE5; Mon, 29 Sep 2003 05:47:50 -0700 (PDT) (envelope-from yannick.dambielle@free.fr) Received: from shibuya (nord-5-82-67-198-63.fbx.proxad.net [82.67.198.63]) by postfix3-2.free.fr (Postfix) with SMTP id 6A59CC455; Mon, 29 Sep 2003 14:47:38 +0200 (CEST) Message-ID: <004801c38687$e323d870$3fc64352@shibuya> From: "Dambielle Yannick" To: "Robert Watson" , "Giovanni P. Tirloni" References: Date: Mon, 29 Sep 2003 14:47:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-net@freebsd.org Subject: Re: tcpdump - tun/tap virtual interfaces (a full working exemple) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 12:47:52 -0000 Hello everybody, Well, here is the full exemple I've just done to deal with a tap0 interface. I didn't give you enaugh details in my last mail, so this time I've inserted all the step. Tap0 is now fully used in the sens that icmp requests and echos can be dumped from the virtual interface. As you will see in the following details, I had to attach 2 IP address to tap0 (10.0.0.1 and 10.0.0.2) and I had to make the route for 10.0.0.1 passing trough 10.0.0.2 as a gateway. Up today it is the only way I found for reaching that point, because altrought 10.0.0.1 was attached to tap0, it changed to lo0 once the address pinged . Any other change like "route add 10.0.0.1 -interface tap0" didn't have any effect and icmp requests and replies where always seen from lo0. According to wat you said (Mr. Watson - please correct me if I'm wrong), this is because 10.0.0.1 is always considered as a local address. But if I use another IP address (10.0.0.2) and if I attache it to tap0 and if I explicitly say to 10.0.0.1 to use 10.0.0.2 as the gateway, every paquets coming from 10.0.0.1 will go trough tap0. I hope my explication is understandable. Any comments or other method is really really really welcome. Here start the details : ----------------------------------------------------------------------- Before starting. Here is how everything is configured on FreeBSD box. ----------------------------------------------------------------------- shinjuku# ifconfig rl0: flags=8843 mtu 1500 inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 ether 00:08:02:05:51:e0 media: Ethernet autoselect (100baseTX) status: active lp0: flags=8810 mtu 1500 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 shinjuku# netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.0.1 UGSc 1 0 rl0 127.0.0.1 127.0.0.1 UH 0 27 lo0 192.168.0 link#1 UC 1 0 rl0 192.168.0.1 00:08:c7:08:16:d8 UHLW 2 42 rl0 1064 shinjuku# ----------------------------------------------------------------------- I create the sink for the paquet data and this time I let it stay open. I aslo configure 10.0.0.1 and 10.0.0.2 on tap0 ----------------------------------------------------------------------- shinjuku# dd if=/dev/tap0 of=/dev/null bs=1500 & [1] 601 shinjuku# ifconfig rl0: flags=8843 mtu 1500 inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 ether 00:08:02:05:51:e0 media: Ethernet autoselect (100baseTX) status: active lp0: flags=8810 mtu 1500 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 tap0: flags=8802 mtu 1500 ether 00:bd:99:13:01:00 Opened by PID 601 shinjuku# ifconfig tap0 up shinjuku# ifconfig tap0 inet 10.0.0.1/24 add shinjuku# ifconfig tap0 inet 10.0.0.2/32 add shinjuku# ifconfig rl0: flags=8843 mtu 1500 inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 ether 00:08:02:05:51:e0 media: Ethernet autoselect (100baseTX) status: active lp0: flags=8810 mtu 1500 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 tap0: flags=8843 mtu 1500 inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 inet 10.0.0.2 netmask 0xffffffff broadcast 10.0.0.2 ether 00:bd:99:13:01:00 Opened by PID 601 shinjuku# ----------------------------------------------------------------------- Below are the routes for 10.0.0.1 and 10.0.0.2, but once 10.0.0.1 is pinged, its interface is changed into lo0. According to what Mr Watson said before (please, correct me if I'm wrong), this is because 10.0.0.1 is considered as a local IP. So evenif the route for reaching the address was trough tap0, a local IP is re-routed on lo0... The same effect can also be seen with 10.0.0.2. A tcpdump on lo0 will dump all requests/replies from 10.0.01 and 10.0.0.2. Nothing is going to be seen trough tap0. ----------------------------------------------------------------------- shinjuku# route get 10.0.0.1 route to: 10.0.0.1 destination: 10.0.0.0 mask: 255.255.255.0 interface: tap0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 500 -55 shinjuku# shinjuku# route get 10.0.0.2 route to: 10.0.0.2 destination: 10.0.0.2 mask: 255.255.255.255 interface: tap0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 500 -75 shinjuku# shinjuku# ping 10.0.0.1 PING 10.0.0.1 (10.0.0.1): 56 data bytes 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.106 ms 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.079 ms ^C --- 10.0.0.1 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.079/0.092/0.106/0.014 ms shinjuku# ping 10.0.0.2 PING 10.0.0.2 (10.0.0.2): 56 data bytes 64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=0.155 ms 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.088 ms 64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.085 ms ^C --- 10.0.0.2 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.085/0.109/0.155/0.032 ms shinjuku# shinjuku# route get 10.0.0.1 route to: 10.0.0.1 destination: 10.0.0.1 interface: lo0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 shinjuku# shinjuku# route get 10.0.0.2 route to: 10.0.0.2 destination: 10.0.0.2 interface: lo0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 shinjuku# ----------------------------------------------------------------------- What happens if I explicitly say to 10.0.0.1 to pass through tap0... Nothing! ... the default route (lo0) always come back.. ----------------------------------------------------------------------- shinjuku# route add 10.0.0.1 -interface tap0 add host 10.0.0.1: gateway tap0 shinjuku# route get 10.0.0.1 route to: 10.0.0.1 destination: 10.0.0.1 interface: lo0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 shinjuku# ----------------------------------------------------------------------- And if I explicitly say to 10.0.0.2 to be reached through tap0... It works in the sens that icmp request will be dumped trough tap0 but icmp replies will go trough lo0. ----------------------------------------------------------------------- shinjuku# route add 10.0.0.2 -interface tap0 add host 10.0.0.2: gateway tap0 shinjuku# route get 10.0.0.2 route to: 10.0.0.2 destination: 10.0.0.2 interface: tap0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 shinjuku# shinjuku# ping -c 1 10.0.0.2 PING 10.0.0.2 (10.0.0.2): 56 data bytes 64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=0.115 ms --- 10.0.0.2 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.115/0.115/0.115/0.000 ms shinjuku# shinjuku# tcpdump -i lo0 tcpdump: listening on lo0 10:18:55.505577 10.0.0.2 > 10.0.0.1: icmp: echo reply shinjuku# tcpdump -i tap0 tcpdump: listening on tap0 10:18:55.505523 10.0.0.1 > 10.0.0.2: icmp: echo request ----------------------------------------------------------------------- Now if I explicitly say to 10.0.0.1 to use 10.0.0.2 as a gateway, the gateway will be inserted and the interface will be changes into tap0. ----------------------------------------------------------------------- shinjuku# route add 10.0.0.1 10.0.0.2 add host 10.0.0.1: gateway 10.0.0.2 shinjuku# route get 10.0.0.1 route to: 10.0.0.1 destination: 10.0.0.1 gateway: 10.0.0.2 interface: tap0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 shinjuku# ----------------------------------------------------------------------- And all paquets (requests and replies) will go trough tap0. Nothing pass trough lo0. ----------------------------------------------------------------------- shinjuku# ping -c 1 10.0.0.1 PING 10.0.0.1 (10.0.0.1): 56 data bytes 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=0.137 ms --- 10.0.0.1 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.137/0.137/0.137/0.000 ms shinjuku# shinjuku# tcpdump -i lo0 tcpdump: listening on lo0 shinjuku# tcpdump -i tap0 tcpdump: listening on tap0 10:29:10.540622 10.0.0.2 > 10.0.0.1: icmp: echo request 10:29:10.540680 10.0.0.1 > 10.0.0.2: icmp: echo reply ----------------------------------------------------------------------- We can also see that all requests/replies from 10.0.0.2 will be seen trough tap0 and not lo0. ----------------------------------------------------------------------- shinjuku# ping -c 1 10.0.0.2 PING 10.0.0.2 (10.0.0.2): 56 data bytes 64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=0.145 ms --- 10.0.0.2 ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.145/0.145/0.145/0.000 ms shinjuku# shinjuku# tcpdump -i lo0 tcpdump: listening on lo0 shinjuku# tcpdump -i tap0 tcpdump: listening on tap0 10:30:30.488313 10.0.0.1 > 10.0.0.2: icmp: echo request 10:30:30.488381 10.0.0.2 > 10.0.0.1: icmp: echo reply ----------------------------------------------------------------------- One big problem that I could have asked you before finishing all that tests is that I lose the intial address, I mean if I ping 10.0.0.2, the icmp requests are dumped as if they came from 10.0.0.1 and not from localhost or 127.0.0.1. You will tell me that it is normal because I use a gateway... But the thing I'll do further with the use of virtual interfaces will be dumping data going to and coming from a web server inside a jail and dumping data going to and coming from something else inside another jail. All that personnal research is not for beeing in a production environment as if it was I will have used more than one box. On my box with it's 2 jails, each virtual interface will have a snort listening for whatever could pass trough theim and I want to study that as if I could have enaugh money and as many box as I would... Well, any information is welcome. Sorry if this mail was a little bit too long Yannick From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 08:21:06 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80ADB16A4B3 for ; Mon, 29 Sep 2003 08:21:06 -0700 (PDT) Received: from smtp017.mail.yahoo.com (smtp017.mail.yahoo.com [216.136.174.114]) by mx1.FreeBSD.org (Postfix) with SMTP id E794643FDD for ; Mon, 29 Sep 2003 08:21:05 -0700 (PDT) (envelope-from q_dolan@yahoo.com.au) Received: from q.onthenet.com.au (HELO ?192.168.100.154?) (q?dolan@203.10.89.214 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 29 Sep 2003 15:17:41 -0000 From: Q To: freebsd-net@freebsd.org Message-Id: <1064848642.24274.37.camel@boxster> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 30 Sep 2003 01:17:23 +1000 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: nForce MCP network driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 15:21:06 -0000 Hi, I am in the final stages of porting the NVidia Linux nForce MCP network driver to FreeBSD-5.1 and am after some experienced users/developers with access to this hardware to do some testing to find out what breaks, and what doesn't work. My driver makes use of the Linux nvnetlib.o API library, and should therefore be compliant with the NVidia Linux distribution license. The driver currently appears to be stable on my hardware, although I haven't done much stress testing, nor do I have access to an nForce2 based motherboard. This is still very much a work in progress, but it has been stable enough for me to actually use productively so I thought I would share the wealth, so to speak, with the rest of the community. If you are interested in testing this, email me offline. I am also interested in how many people would like to see a FreeBSD-4.x version. PS: I am still waiting for NVidia to reply to any of my emails. :( -- Seeya...Q -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- _____ / Quinton Dolan q_dolan@yahoo.com.au __ __/ / / __/ / / / __ / _/ / / Gold Coast, QLD, Australia __/ __/ __/ ____/ / - / Ph: +61 419 729 806 _______ / _\ From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 09:59:11 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 133B616A4B3 for ; Mon, 29 Sep 2003 09:59:11 -0700 (PDT) Received: from smtp.uc3m.es (smtp01.uc3m.es [163.117.136.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2203143FB1 for ; Mon, 29 Sep 2003 09:59:09 -0700 (PDT) (envelope-from jrh@it.uc3m.es) Received: from smtp01.uc3m.es (localhost [127.0.0.1]) by smtp.uc3m.es (Postfix) with ESMTP id DF4F943131; Mon, 29 Sep 2003 18:59:07 +0200 (CEST) Received: from cimborrio.it.uc3m.es (cimborrio.it.uc3m.es [163.117.139.95]) by smtp01.uc3m.es (Postfix) with ESMTP id 7F6DF99E66; Mon, 29 Sep 2003 18:59:07 +0200 (CEST) From: Juan Rodriguez Hervella Organization: UC3M To: freebsd-net@freebsd.org Date: Mon, 29 Sep 2003 18:59:08 +0200 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309291859.09355.jrh@it.uc3m.es> cc: snap-users@kame.net Subject: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 16:59:11 -0000 Hello all: I'm using FreeBSD-4.8-RELEASE. (I've tested the same thing using a KAME snap, so I CCs to them :) I've got two routers sending RAs on the same link, so the host is configured with two IPv6 prefix on the same NIC. Watching the routing table I only see one default IPv6 route. When I try to ping the global IPv6 address of one router, if I'm lucky and the router is the same router which I've got installed on the default route, it will answer. The problem is that the host doesn't seem to realize that it is on two links at the same time, so it always sends packets to the default router.... For example, if there's only one RA, the autoconfiguration process ends up with a link-route like this: 2001:720:410:1001::/64 link#2 UC fxp0 On the other hand, when there are 2 RAs on the same link, this route doesn't exist ! Is this behaviour right ? I've observed the same thing on Linux... -- JFRH From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 10:23:04 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 75E5E16A4B3 for ; Mon, 29 Sep 2003 10:23:04 -0700 (PDT) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C3444401E for ; Mon, 29 Sep 2003 10:23:03 -0700 (PDT) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from ocean.jinmei.org (unknown [2001:4f8:3:bb:6014:c5d9:e37c:2a0b]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id ADE0E1525D; Tue, 30 Sep 2003 02:23:00 +0900 (JST) Date: Tue, 30 Sep 2003 02:22:57 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: Juan Rodriguez Hervella In-Reply-To: <200309291859.09355.jrh@it.uc3m.es> References: <200309291859.09355.jrh@it.uc3m.es> User-Agent: Wanderlust/2.10.0 (Venus) Emacs/21.3 Mule/5.0 (SAKAKI) Organization: Research & Development Center, Toshiba Corp., Kawasaki, Japan. MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: freebsd-net@freebsd.org cc: snap-users@kame.net Subject: Re: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 17:23:04 -0000 >>>>> On Mon, 29 Sep 2003 18:59:08 +0200, >>>>> Juan Rodriguez Hervella said: > I've got two routers sending RAs on the same link, so the > host is configured with two IPv6 prefix on the same NIC. > Watching the routing table I only see one default IPv6 route. > When I try to ping the global IPv6 address of one router, if > I'm lucky and the router is the same router which I've got > installed on the default route, it will answer. > The problem is that the host doesn't seem to realize that > it is on two links at the same time, so it always sends packets to the > default router.... > For example, if there's only one RA, the autoconfiguration process > ends up with a link-route like this: > 2001:720:410:1001::/64 link#2 UC fxp0 > On the other hand, when there are 2 RAs on the same link, this > route doesn't exist ! I don't quite understand the situation...could you depict the network configuration with concrete prefixes/addresses, and describe the concrete problem (if it's a problem) with exact output of some commands (such as netstat, ifconfig, etc)? Thanks, JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 11:02:06 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B37116A4B3 for ; Mon, 29 Sep 2003 11:02:06 -0700 (PDT) Received: from lariat.org (lariat.org [63.229.157.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5881443F85 for ; Mon, 29 Sep 2003 11:02:05 -0700 (PDT) (envelope-from brett@lariat.org) Received: (from brett@localhost) by lariat.org (8.9.3/8.9.3) id MAA24393 for net@freebsd.org; Mon, 29 Sep 2003 12:02:00 -0600 (MDT) Date: Mon, 29 Sep 2003 12:02:00 -0600 (MDT) From: Brett Glass Message-Id: <200309291802.MAA24393@lariat.org> To: net@freebsd.org Subject: Transparent cache/Bridge with FreeBSD X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 18:02:06 -0000 A client has asked me to build a transparent Web cache that acts as a bridge, not a router. I've never tried using FreeBSD as a bridge. How would I set this up? Would the firewall rule that forwards Web requests to the cache process be the same as on a system which is operating as a router? --Brett From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 13:08:37 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C98116A4B3 for ; Mon, 29 Sep 2003 13:08:37 -0700 (PDT) Received: from kirk.giovannelli.it (kirk.giovannelli.it [194.184.65.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E770C43FF7 for ; Mon, 29 Sep 2003 13:08:35 -0700 (PDT) (envelope-from gmarco@giovannelli.it) Received: from ppp-48-21.27-151.libero.it (ppp-48-21.27-151.libero.it [151.27.21.48])h8TK9lTf004249; Mon, 29 Sep 2003 22:09:48 +0200 (CEST) (envelope-from gmarco@giovannelli.it) From: Gianmarco Giovannelli To: Brett Glass , net@freebsd.org Date: Mon, 29 Sep 2003 22:04:09 +0200 User-Agent: KMail/1.5.4 References: <200309291802.MAA24393@lariat.org> In-Reply-To: <200309291802.MAA24393@lariat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309292204.09316.gmarco@giovannelli.it> X-RAVMilter-Version: 8.3.1(snapshot 20020109) (kirk.giovannelli.it) Subject: Re: Transparent cache/Bridge with FreeBSD X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 20:08:37 -0000 On Monday 29 September 2003 20:02, Brett Glass wrote: > A client has asked me to build a transparent Web cache that acts as > a bridge, not a router. I've never tried using FreeBSD as a bridge. > How would I set this up? Would the firewall rule that forwards > Web requests to the cache process be the same as on a system which > is operating as a router? Luigi just committed some changes to the ipfw code so it can forwards packets also when acting as a bridge. Check the ipfw- list (a message of Luigi of 22 September). Ciaoooo From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 13:12:31 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7CB416A4B3 for ; Mon, 29 Sep 2003 13:12:31 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2708E43FE1 for ; Mon, 29 Sep 2003 13:12:31 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.3) with ESMTP id h8TKCUsd076256; Mon, 29 Sep 2003 13:12:30 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id h8TKCUEI076255; Mon, 29 Sep 2003 13:12:30 -0700 (PDT) (envelope-from rizzo) Date: Mon, 29 Sep 2003 13:12:30 -0700 From: Luigi Rizzo To: Gianmarco Giovannelli Message-ID: <20030929131230.A76047@xorpc.icir.org> References: <200309291802.MAA24393@lariat.org> <200309292204.09316.gmarco@giovannelli.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200309292204.09316.gmarco@giovannelli.it>; from gmarco@giovannelli.it on Mon, Sep 29, 2003 at 10:04:09PM +0200 cc: Brett Glass cc: net@freebsd.org Subject: Re: Transparent cache/Bridge with FreeBSD X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 20:12:31 -0000 On Mon, Sep 29, 2003 at 10:04:09PM +0200, Gianmarco Giovannelli wrote: > On Monday 29 September 2003 20:02, Brett Glass wrote: > > A client has asked me to build a transparent Web cache that acts as > > a bridge, not a router. I've never tried using FreeBSD as a bridge. > > How would I set this up? Would the firewall rule that forwards > > Web requests to the cache process be the same as on a system which > > is operating as a router? > > Luigi just committed some changes to the ipfw code so it can forwards packets > also when acting as a bridge. i actually have not committed yet that code, but the patch to ip_fw2.c is trivial and you can grab it from the list archive. cheers luigi > Check the ipfw- list (a message of Luigi of 22 September). > > Ciaoooo > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 15:33:01 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFA8716A4BF for ; Mon, 29 Sep 2003 15:33:01 -0700 (PDT) Received: from blacklamb.mykitchentable.net (207-173-226-17.bras01.elk.ca.frontiernet.net [207.173.226.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73DBC44028 for ; Mon, 29 Sep 2003 15:33:00 -0700 (PDT) (envelope-from drew@mykitchentable.net) Received: from L035522 (unknown [165.107.22.101]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by blacklamb.mykitchentable.net (Postfix) with ESMTP id 359363BF36A for ; Mon, 29 Sep 2003 15:32:59 -0700 (PDT) Message-ID: <00bd01c386d9$a1dff4a0$65166ba5@lc.ca.gov> From: "Drew Tomlinson" To: Date: Mon, 29 Sep 2003 15:32:54 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: D-Link NIC Won't Talk To Bridge X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 22:33:02 -0000 I asked on -questions but was unable to resolve. I'm hoping there's an expert here that is willing and able to help. :) I'm trying to get a Linksys WET11 Wireless Ethernet Bridge (http://www.linksys.com/products/product.asp?prid=432&scid=36) working with a D-Link 530TX+ NIC that uses the rl driver. I have configured the bridge and gotten it to work with a Windows XP box. However I can not get it working on my 4.8 FBSD gateway box. I am trying to set things up so I can use my neighbor's Internet connection as a backup link. He has a Linksys Wireless Access Point/Router in his home. Instead of installing a wireless card in my FBSD box, I bought the WET11 so I could install it by a window to get a better signal. The Linksys bridge connects via ethernet cable to the NIC in my FBSD box. Here's a diagram of the setup: Internet | Public IP | ADSL Modem/Router 192.168.10.1 | dc0 192.168.10.2 | FBSD 4.8 --------- rl0 | 192.168.100.2 dc1 | 192.168.1.2 192.168.100.225 | Wireless Bridge Internal LAN | 192.168.100.1 Neighbor's AP I have added the following to the beginning of my ipfw2 rules to verify that traffic is going out the correct interface: ipfw add allow log ip from any to any via rl0 When attempting a connection to anything on the 100 subnet, I see entries like this in the firewall log: Sep 29 14:58:05 blacksheep /kernel: ipfw: 50 Accept ICMP:8.0 192.168.100.2 192.168.100.1 out via rl0 Sep 29 14:43:47 blacksheep /kernel: ipfw: 50 Accept TCP 192.168.100.2:2626 192.168.100.225:80 out via rl0 However no response comes back. I'm sure ipfw2 is not blocking return packets because I log all denied packets. I have also tried with all ipfw2 rules flushed and have the same result. There may be a clue in the arp tables. After trying connections to the 100 subnet, I have entries like these in the arp tables: ? (192.168.100.1) at (incomplete) on rl0 [ethernet] ? (192.168.100.2) at 00:05:5d:d0:ba:67 on rl0 permanent [ethernet] ? (192.168.100.225) at (incomplete) on rl0 [ethernet] So I thought maybe adding static entries to the arp table might help but it did not. Does anyone have any idea on what I need to do to get this working? I'm willing to read and learn but at this point I'm so stuck I don't know where to turn next. Thanks, Drew From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 18:01:33 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 908EC16A4B3; Mon, 29 Sep 2003 18:01:33 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id E33E343FFD; Mon, 29 Sep 2003 18:01:32 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8U11Sgg031863; Mon, 29 Sep 2003 18:01:28 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8U11SML031862; Mon, 29 Sep 2003 18:01:28 -0700 Date: Mon, 29 Sep 2003 18:01:28 -0700 From: Brooks Davis To: arch@freebsd.org, net@freebsd.org Message-ID: <20030930010128.GA31222@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Subject: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 01:01:33 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Six years and eight months ago, net/if.h was split into if.h and if_var.h. At the time, if_var.h was included at the end if if.h as follows (this is the current code, but it's equivalent): #ifdef _KERNEL struct thread; /* XXX - this should go away soon. */ #include #endif Unfortunately, "soon" hasn't happened yet and it is now tripping me up. To add the if_dev member to struct ifnet (see the forthcoming post on that subject), it is necessary for sys/bus.h to be included in net/if_var.h which in turn requires that if_var.h NOT be included in genassym.c. Since if.h must be included for nfsdiskless support, this means we need to finish the job and remove the include if_var.h from if.h. It involves editing a large number of files, but over all it's pretty mechanical as it simple includes adding and include of if_var.h after the if.h include in files that break after the change. Does this sound reasonable? -- Brooks P.S. The alternative is to add a second typedef of device_t to if_var.h. It's an ugly solution since it and the definition in sys/bus.h would have to look like the one below, but it would be a heck of a lot easier. #ifndef _DEVICE_T_DECLARED typedef struct device *device_t; #define _DEVICE_T_DECLARED #endif --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/eNXlXY6L6fI4GtQRArpKAJ9renTX9Wzn1Ui/mMg0wKCGANXpngCfQhu1 ACJ4kydQbKRn3SJuqNmFtRY= =eusb -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK-- From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 18:03:44 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 346C816A4B3; Mon, 29 Sep 2003 18:03:44 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7405344003; Mon, 29 Sep 2003 18:03:43 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8U13dgg032414; Mon, 29 Sep 2003 18:03:39 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8U13deH032400; Mon, 29 Sep 2003 18:03:39 -0700 Date: Mon, 29 Sep 2003 18:03:39 -0700 From: Brooks Davis To: arch@freebsd.org, net@freebsd.org Message-ID: <20030930010327.GB31222@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XF85m9dhOBO43t/C" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Subject: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 01:03:44 -0000 --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Previously posted to -net in another form.] I propose to add an if_dev member to struct ifnet. It would be of type device_t and be defined to point to the device for the interface or NULL if there is no device (or if there was not an easy way to get access to one). This change would codify the the relationship between an interface and the underlying physical device. It also would get rid of the existing abuses of if_name to look up the driver associated with an interface and simplify a number of messy cases in the conversion from if_unit and if_name to if_xname. Does this seem like a reasonable thing to do? -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --XF85m9dhOBO43t/C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/eNY0XY6L6fI4GtQRAvgoAKDB7TmwAKtFcJiIA0DdfHM1GSrciACdFisT 0J9J5j/DNVyvh3P9BDxu8jI= =UIKO -----END PGP SIGNATURE----- --XF85m9dhOBO43t/C-- From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 19:39:13 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FBEE16A4B3; Mon, 29 Sep 2003 19:39:13 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A6A04400F; Mon, 29 Sep 2003 19:39:12 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.9p1/8.12.9) with ESMTP id h8U2dAAD083646; Mon, 29 Sep 2003 20:39:11 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 29 Sep 2003 20:39:12 -0600 (MDT) Message-Id: <20030929.203912.32174985.imp@bsdimp.com> To: brooks@one-eyed-alien.net From: "M. Warner Losh" In-Reply-To: <20030930010128.GA31222@Odin.AC.HMC.Edu> References: <20030930010128.GA31222@Odin.AC.HMC.Edu> X-Mailer: Mew version 2.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 02:39:13 -0000 In message: <20030930010128.GA31222@Odin.AC.HMC.Edu> Brooks Davis writes: : Six years and eight months ago, net/if.h was split into if.h and : if_var.h. At the time, if_var.h was included at the end if if.h as : follows (this is the current code, but it's equivalent): ... : Does this sound reasonable? I'd go ahead and finish the split. Warner From owner-freebsd-net@FreeBSD.ORG Mon Sep 29 23:45:11 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F3F116A4B3; Mon, 29 Sep 2003 23:45:11 -0700 (PDT) Received: from mwinf0603.wanadoo.fr (smtp3.wanadoo.fr [193.252.22.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E1BD43FA3; Mon, 29 Sep 2003 23:45:10 -0700 (PDT) (envelope-from vjardin@wanadoo.fr) Received: from venus.vincentjardin.net (AVelizy-102-1-2-196.w217-128.abo.wanadoo.fr [217.128.206.196]) by mwinf0603.wanadoo.fr (SMTP Server) with ESMTP id 8EE93240010C; Tue, 30 Sep 2003 08:45:08 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" From: Vincent Jardin To: Brooks Davis , arch@freebsd.org, net@freebsd.org Date: Tue, 30 Sep 2003 10:45:15 +0200 User-Agent: KMail/1.4.3 References: <20030930010327.GB31222@Odin.AC.HMC.Edu> In-Reply-To: <20030930010327.GB31222@Odin.AC.HMC.Edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200309301045.15776.vjardin@wanadoo.fr> Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 06:45:11 -0000 Le Mardi 30 Septembre 2003 03:03, Brooks Davis a =E9crit : > [Previously posted to -net in another form.] > > I propose to add an if_dev member to struct ifnet. It would be of type > device_t and be defined to point to the device for the interface or NUL= L > if there is no device (or if there was not an easy way to get access to > one). > > This change would codify the the relationship between an interface and > the underlying physical device. It also would get rid of the existing > abuses of if_name to look up the driver associated with an interface > and simplify a number of messy cases in the conversion from if_unit and > if_name to if_xname. > > Does this seem like a reasonable thing to do? Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover= it=20 sounds a good idea to have the if_dev field into the ifnet structure. Regards, Vincent From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 00:10:59 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D19816A4B3; Tue, 30 Sep 2003 00:10:59 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA96043FA3; Tue, 30 Sep 2003 00:10:57 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h8U7AsOP008476; Tue, 30 Sep 2003 09:10:54 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Vincent Jardin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Sep 2003 10:45:15 +0200." <200309301045.15776.vjardin@wanadoo.fr> Date: Tue, 30 Sep 2003 09:10:54 +0200 Message-ID: <8475.1064905854@critter.freebsd.dk> cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 07:10:59 -0000 In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes: >Le Mardi 30 Septembre 2003 03:03, Brooks Davis a écrit : >> [Previously posted to -net in another form.] >> >> I propose to add an if_dev member to struct ifnet. It would be of type >> device_t and be defined to point to the device for the interface or NULL >> if there is no device (or if there was not an easy way to get access to >> one). >> >> This change would codify the the relationship between an interface and >> the underlying physical device. It also would get rid of the existing >> abuses of if_name to look up the driver associated with an interface >> and simplify a number of messy cases in the conversion from if_unit and >> if_name to if_xname. >> >> Does this seem like a reasonable thing to do? > >Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it >sounds a good idea to have the if_dev field into the ifnet structure. Somebody please explain how this would work for non-hardware interfaces like if_loop, if_tun, if_tap etc ? device_t is what we use to hitch drivers to hardware. ifnet is what we use to hitch drivers to the netstack. They should not be tangled. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 00:27:37 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B2E816A4B3 for ; Tue, 30 Sep 2003 00:27:37 -0700 (PDT) Received: from smtp.uc3m.es (smtp03.uc3m.es [163.117.136.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id C774444032 for ; Tue, 30 Sep 2003 00:27:20 -0700 (PDT) (envelope-from jrh@it.uc3m.es) Received: from smtp03.uc3m.es (localhost [127.0.0.1]) by smtp.uc3m.es (Postfix) with ESMTP id B781D43354; Tue, 30 Sep 2003 09:27:19 +0200 (CEST) Received: from cimborrio.it.uc3m.es (cimborrio.it.uc3m.es [163.117.139.95]) by smtp03.uc3m.es (Postfix) with ESMTP id 0686B2B674; Tue, 30 Sep 2003 09:27:19 +0200 (CEST) From: Juan Rodriguez Hervella Organization: UC3M To: JINMEI Tatuya / =?utf-8?q?=E7=A5=9E=E6=98=8E=E9=81=94=E5=93=89?= Date: Tue, 30 Sep 2003 09:27:17 +0200 User-Agent: KMail/1.5 References: <200309291859.09355.jrh@it.uc3m.es> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_WBTe/pGb0IuMFI3" Message-Id: <200309300927.18850.jrh@it.uc3m.es> cc: freebsd-net@freebsd.org cc: snap-users@kame.net Subject: Re: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 07:27:37 -0000 --Boundary-00=_WBTe/pGb0IuMFI3 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Monday 29 September 2003 19:22, JINMEI Tatuya / 神明é”哉 wrote: > >>>>> On Mon, 29 Sep 2003 18:59:08 +0200, > >>>>> Juan Rodriguez Hervella said: > > > > I've got two routers sending RAs on the same link, so the > > host is configured with two IPv6 prefix on the same NIC. > > > > Watching the routing table I only see one default IPv6 route. > > > > When I try to ping the global IPv6 address of one router, if > > I'm lucky and the router is the same router which I've got > > installed on the default route, it will answer. > > > > The problem is that the host doesn't seem to realize that > > it is on two links at the same time, so it always sends packets to the > > default router.... > > > > For example, if there's only one RA, the autoconfiguration process > > ends up with a link-route like this: > > > > 2001:720:410:1001::/64 link#2 UC > > fxp0 > > > > On the other hand, when there are 2 RAs on the same link, this > > route doesn't exist ! > > I don't quite understand the situation...could you depict the network > configuration with concrete prefixes/addresses, and describe the > concrete problem (if it's a problem) with exact output of some > commands (such as netstat, ifconfig, etc)? > Well, attached I depict the topology plus "ifconfig" and "netstat -rn" outputs. [ time to see the topology ] After seeing the topology (uh Im a bit asleep)... the situation is quite simple, 2 routers (site exit routers), giving access to the internet using different ISPs. There is only 1 link, so the host only have 1 NIC. The problem is that I can ping one of the routers, though both the host and the router belong to the same network. I guess the packets are always forwarded to the default router, and I think that's not the expected behaviour, right ? Cheers. PS: I really love FreeBSD :) -- JFRH --Boundary-00=_WBTe/pGb0IuMFI3 Content-Type: text/plain; charset="iso-8859-1"; name="topology.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="topology.txt" (Im really keen on ASCI art) (of course, Im kidding) Host X X XXXXXXXXXXXXXXXXXXXXXXX <-- wired link X X Switch 3Com X X X X X X X X Router1 Router2 X X X X X X ISP1 ISP2 ISP1 delegated prefix: 2001:720:410:1000::/60 ISP2 delegated prefix: 2001:800:40:2470::/60 RA of Router1: 2001:720:410:100b::/64 RA of Router2: 2001:800:40:2471::/64 =>>>>> Output of "ifconfig" jrh@pepitogrillo:~$ ifconfig rl0: flags=8843 mtu 1500 inet 163.117.140.44 netmask 0xffffff00 broadcast 163.117.140.255 inet6 fe80::2c0:26ff:fea3:5df6%rl0 prefixlen 64 scopeid 0x1 ether 00:c0:26:a3:5d:f6 media: Ethernet autoselect (100baseTX ) status: active rl1: flags=8843 mtu 1500 inet6 fe80::2c0:26ff:fea3:7d19%rl1 prefixlen 64 scopeid 0x2 inet6 2001:800:40:2471:2c0:26ff:fea3:7d19 prefixlen 64 autoconf inet6 2001:720:410:100b:2c0:26ff:fea3:7d19 prefixlen 64 autoconf ether 00:c0:26:a3:7d:19 media: Ethernet autoselect (100baseTX) status: active [snipped] The NIC I'm talking about is rl1, I use rl0 (IPv4) for configuration purposes but I plan to remove IPv4 on the short term. =>>>>> Output of "netstat -rn": jrh@pepitogrillo:~$ netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 163.117.140.2 UGSc 1 2 rl0 127.0.0.1 127.0.0.1 UH 0 220 lo0 163.117.140/24 link#1 UC 2 0 rl0 163.117.140.2 00:02:1b:f4:01:13 UHLW 2 0 rl0 1200 163.117.140.166 00:90:27:86:09:3d UHLW 0 377 rl0 1060 Internet6: Destination Gateway Flags Netif Expire default fe80::20b:5fff:fe77:dcc0%rl1 UGc rl1 ::1 ::1 UH lo0 2001:720:410:100b:2c0:26ff:fea3:7d19 00:c0:26:a3:7d:19 UHL lo0 2001:800:40:2471:2c0:26ff:fea3:7d19 00:c0:26:a3:7d:19 UHL lo0 fe80::%rl0/64 link#1 UC rl0 fe80::2c0:26ff:fea3:5df6%rl0 00:c0:26:a3:5d:f6 UHL lo0 fe80::%rl1/64 link#2 UC rl1 fe80::20b:5fff:fe77:dcc0%rl1 00:0b:5f:77:dc:c0 UHLW rl1 fe80::20b:5fff:fe77:de61%rl1 00:0b:5f:77:de:61 UHLW rl1 fe80::2c0:26ff:fea3:7d19%rl1 00:c0:26:a3:7d:19 UHL lo0 fe80::%lo0/64 fe80::1%lo0 Uc lo0 fe80::1%lo0 link#8 UHL lo0 ff01::%rl0/32 link#1 UC rl0 ff01::%rl1/32 link#2 UC rl1 ff01::%lo0/32 ::1 UC lo0 ff02::%rl0/32 link#1 UC rl0 ff02::%rl1/32 link#2 UC rl1 ff02::%lo0/32 ::1 UC lo0 jrh@pepitogrillo:~$ --Boundary-00=_WBTe/pGb0IuMFI3-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 00:42:42 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D11EA16A4BF for ; Tue, 30 Sep 2003 00:42:42 -0700 (PDT) Received: from smtp.uc3m.es (smtp02.uc3m.es [163.117.136.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1782744015 for ; Tue, 30 Sep 2003 00:42:41 -0700 (PDT) (envelope-from jrh@it.uc3m.es) Received: from smtp02.uc3m.es (localhost [127.0.0.1]) by smtp.uc3m.es (Postfix) with ESMTP id EEB8343241; Tue, 30 Sep 2003 09:42:39 +0200 (CEST) Received: from cimborrio.it.uc3m.es (cimborrio.it.uc3m.es [163.117.139.95]) by smtp02.uc3m.es (Postfix) with ESMTP id AF27299FCB; Tue, 30 Sep 2003 09:42:39 +0200 (CEST) From: Juan Rodriguez Hervella Organization: UC3M To: JINMEI Tatuya / =?utf-8?q?=E7=A5=9E=E6=98=8E=E9=81=94=E5=93=89?= Date: Tue, 30 Sep 2003 09:42:39 +0200 User-Agent: KMail/1.5 References: <200309291859.09355.jrh@it.uc3m.es> <200309300927.18850.jrh@it.uc3m.es> In-Reply-To: <200309300927.18850.jrh@it.uc3m.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200309300942.40834.jrh@it.uc3m.es> cc: freebsd-net@freebsd.org Subject: Re: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 07:42:43 -0000 On Tuesday 30 September 2003 09:27, Juan Rodriguez Hervella wrote: > On Monday 29 September 2003 19:22, JINMEI Tatuya / 神明é”哉 wrote: > > >>>>> On Mon, 29 Sep 2003 18:59:08 +0200, > > >>>>> Juan Rodriguez Hervella said: > > > > > > I've got two routers sending RAs on the same link, so the > > > host is configured with two IPv6 prefix on the same NIC. > > > > > > Watching the routing table I only see one default IPv6 route. > > > > > > When I try to ping the global IPv6 address of one router, if > > > I'm lucky and the router is the same router which I've got > > > installed on the default route, it will answer. > > > > > > The problem is that the host doesn't seem to realize that > > > it is on two links at the same time, so it always sends packets to the > > > default router.... > > > > > > For example, if there's only one RA, the autoconfiguration process > > > ends up with a link-route like this: > > > > > > 2001:720:410:1001::/64 link#2 UC > > > fxp0 > > > > > > On the other hand, when there are 2 RAs on the same link, this > > > route doesn't exist ! > > > > I don't quite understand the situation...could you depict the network > > configuration with concrete prefixes/addresses, and describe the > > concrete problem (if it's a problem) with exact output of some > > commands (such as netstat, ifconfig, etc)? > > Well, attached I depict the topology plus "ifconfig" and > "netstat -rn" outputs. > > [ time to see the topology ] > > After seeing the topology (uh Im a bit asleep)... > the situation is quite simple, 2 routers (site exit routers), > giving access to the internet using different ISPs. There is > only 1 link, so the host only have 1 NIC. > > The problem is that I can ping one of the routers, though > both the host and the router belong to the same network. > I guess the packets are always forwarded to the default > router, and I think that's not the expected behaviour, right ? > > Cheers. > > PS: I really love FreeBSD :) After having breakfast, Im ready to show you what I can not do with this configuration. Sorry I fogot to tell you this in my previous mail....(Im not SPAM, ok ? :) Address of Router1: 2001:720:410:100b::3 Address of Router2: 2001:800:40:2471::4 These address are added manually, though both of them have got autoconfigured addresses. They are cisco2600 routers... I'm now on the host, I try to ping Router1: jrh@pepitogrillo:~$ ping6 2001:720:410:100b::3 PING6(56=40+8+8 bytes) 2001:720:410:100b:2c0:26ff:fea3:7d19 --> 2001:720:410:100b::3 This ping doesn't work.. Then I try to ping Router2: jrh@pepitogrillo:~$ ping6 2001:800:40:2471::4 PING6(56=40+8+8 bytes) 2001:800:40:2471:2c0:26ff:fea3:7d19 --> 2001:800:40:2471::4 16 bytes from 2001:800:40:2471::4, icmp_seq=0 hlim=64 time=2.357 ms This one works ! I can ping both routers using ff02::1%rl1, and I've found out that the router which I can ping is the same router that is autoconfigured as "default" on the IPv6 routing table.... Problem: the other router is on the same link as the host, so the host should be able to ping both routers *directly", without using "default" route, right ? Thanks PS: Windows is also cute :) -- JFRH From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 01:24:12 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53F4F16A4B3; Tue, 30 Sep 2003 01:24:12 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA83743F93; Tue, 30 Sep 2003 01:24:06 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id SAA04609; Tue, 30 Sep 2003 18:23:57 +1000 Date: Tue, 30 Sep 2003 18:22:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Brooks Davis In-Reply-To: <20030930010128.GA31222@Odin.AC.HMC.Edu> Message-ID: <20030930172536.U3713@gamplex.bde.org> References: <20030930010128.GA31222@Odin.AC.HMC.Edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 08:24:12 -0000 On Mon, 29 Sep 2003, Brooks Davis wrote: > Six years and eight months ago, net/if.h was split into if.h and > if_var.h. At the time, if_var.h was included at the end if if.h as > follows (this is the current code, but it's equivalent): > > #ifdef _KERNEL > struct thread; > > /* XXX - this should go away soon. */ > #include > #endif > > Unfortunately, "soon" hasn't happened yet and it is now tripping me > up. To add the if_dev member to struct ifnet (see the forthcoming > post on that subject), it is necessary for sys/bus.h to be included in > net/if_var.h That would be namespace pollution, so it is not permitted :-). Requiring all files that include (and especially to include would be interface breakage so it is even less permitted. > which in turn requires that if_var.h NOT be included in > genassym.c. Do you mean in userland? There don't seem to be any immediate problems for genassym.c or any other file in the kernel from including unconditionally in . However, the pollution may be harmful for userland. In fact, including would just not work for userland, since the declaration of device_t is only made in the _KERNEL case, so use of it in struct ifnet (which is exported to userland for some reason) would be a syntax error in userland whether or not is included. Oops, doesn't include in the !_KERNEL case, so the problem is a little different... > Since if.h must be included for nfsdiskless support, this > means we need to finish the job and remove the include if_var.h from > if.h. It involves editing a large number of files, but over all it's > pretty mechanical as it simple includes adding and include of if_var.h > after the if.h include in files that break after the change. Mechanical removal wouldn't help userland. It has already been done for userland, but too mechanically to actually address the problem of abusing kernel interfaces in in userland. E.g., struct ifnet is (ab)used in netstat at least, so struct ifnet is outside of the _KERNEL ifdef in and adding a device_t to struct ifnet would expose even more kernel internals to userland. Since correctly doesn't declare device-t in the !_KERNEL case, clients like netstat would have to become aware of new magic to declare device_t if doesn't do it itself by some means other than including > P.S. The alternative is to add a second typedef of device_t to if_var.h. > It's an ugly solution since it and the definition in sys/bus.h would > have to look like the one below, but it would be a heck of a lot easier. > > #ifndef _DEVICE_T_DECLARED > typedef struct device *device_t; > #define _DEVICE_T_DECLARED > #endif That's one alternative. (Far too) many places already use the simple alternative of just using "struct device *". Grep shows 68 lines containing "struct device" in *.h and 32 in *.c. For "device_t", the numbers are 2140 in *.h and 5089 in *.c. This is in a sys tree with about 1000 matches of "device_t" in generated files. There are non-bogus uses of "struct device" to avoid namespace pollution in . Most other uses are just bogus (modulo the existence of device_t being non-bogus -- its opaqueness is negative since anything that wants to use it must include and thus can see its internals. style(9) says to not use negatively opaque typedefs). exports lots more kernel internals to userland than 6 years ago. It now exports labels, mutexes and locks. I have only fixed part of this: %%% Index: if_var.h =================================================================== RCS file: /home/ncvs/src/sys/net/if_var.h,v retrieving revision 1.58 diff -u -2 -r1.58 if_var.h --- if_var.h 1 Jan 2003 18:48:54 -0000 1.58 +++ if_var.h 7 Aug 2003 16:47:54 -0000 @@ -46,7 +46,8 @@ * received from its medium. * - * Output occurs when the routine if_output is called, with three parameters: + * Output occurs when the routine if_output is called: * (*ifp->if_output)(ifp, m, dst, rt) - * Here m is the mbuf chain to be sent and dst is the destination address. + * Here m is the mbuf chain to be sent, dst is the destination address, + * and rt is XXX. * The output routine encapsulates the supplied datagram if necessary, * and then transmits it on its medium. @@ -63,25 +64,23 @@ */ -#ifdef __STDC__ -/* - * Forward structure declarations for function prototypes [sic]. - */ -struct mbuf; -struct thread; +struct ether_header; struct rtentry; struct rt_addrinfo; struct socket; -struct ether_header; -#endif +struct thread; -#include /* struct label */ -#include /* get TAILQ macros */ +#include /* XXX XXX */ +#include #ifdef _KERNEL -#include -#endif /* _KERNEL */ -#include /* XXX */ -#include /* XXX */ -#include /* XXX */ +#include /* XXX */ +#include /* XXX XXX */ +#include /* XXX XXX */ +#include /* XXX XXX */ +#else +#include /* XXX */ +#include /* XXX */ +#include /* XXX */ +#endif TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ @@ -116,5 +115,5 @@ * struct ifnet ac_if; * ... - * } ; + * } ; * ... * }; @@ -125,5 +124,4 @@ * Unfortunately devices' softc are opaque, so we depend on this layout * to locate the struct ifnet from the softc in the generic code. - * */ struct ifnet { %%% This only significantly reduces pollution in the !_KERNEL case. Reducing it in the _KERNEL case is much harder. Bruce From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 07:33:41 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D7AF16A4BF for ; Tue, 30 Sep 2003 07:33:41 -0700 (PDT) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11CAB43F75 for ; Tue, 30 Sep 2003 07:33:39 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1033 invoked from network); 30 Sep 2003 14:33:38 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 14:33:38 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UEXY6Y058230; Tue, 30 Sep 2003 10:33:35 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030930172536.U3713@gamplex.bde.org> Date: Tue, 30 Sep 2003 10:33:40 -0400 (EDT) From: John Baldwin To: Bruce Evans X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 14:33:41 -0000 On 30-Sep-2003 Bruce Evans wrote: > On Mon, 29 Sep 2003, Brooks Davis wrote: > >> Six years and eight months ago, net/if.h was split into if.h and >> if_var.h. At the time, if_var.h was included at the end if if.h as >> follows (this is the current code, but it's equivalent): >> >> #ifdef _KERNEL >> struct thread; >> >> /* XXX - this should go away soon. */ >> #include >> #endif >> >> Unfortunately, "soon" hasn't happened yet and it is now tripping me >> up. To add the if_dev member to struct ifnet (see the forthcoming >> post on that subject), it is necessary for sys/bus.h to be included in >> net/if_var.h > > That would be namespace pollution, so it is not permitted :-). Requiring > all files that include (and especially to > include would be interface breakage so it is even less > permitted. Well, if if.h stops including if_var.h, then only kernel files that include net/if_var.h would need sys/bus.h. I think that's manageable. >> which in turn requires that if_var.h NOT be included in >> genassym.c. > > Do you mean in userland? There don't seem to be any immediate problems > for genassym.c or any other file in the kernel from including > unconditionally in . However, the pollution may be harmful > for userland. In fact, including would just not work for > userland, since the declaration of device_t is only made in the _KERNEL > case, so use of it in struct ifnet (which is exported to userland for > some reason) would be a syntax error in userland whether or not > is included. Oops, doesn't include > in the !_KERNEL case, so the problem is a little different... The problem is that the newbus foo_if.h files don't exist when genassym is compiled and used. sys/bus.h needs bus_if.h and device_if.h, hence the breakage. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 07:33:48 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69E0216A4BF for ; Tue, 30 Sep 2003 07:33:48 -0700 (PDT) Received: from mail.speakeasy.net (mail9.speakeasy.net [216.254.0.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCCFD43F93 for ; Tue, 30 Sep 2003 07:33:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 28020 invoked from network); 30 Sep 2003 14:33:46 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 14:33:46 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UEXg6Y058235; Tue, 30 Sep 2003 10:33:43 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <8475.1064905854@critter.freebsd.dk> Date: Tue, 30 Sep 2003 10:33:48 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 14:33:48 -0000 On 30-Sep-2003 Poul-Henning Kamp wrote: > In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes: >>Le Mardi 30 Septembre 2003 03:03, Brooks Davis a écrit : >>> [Previously posted to -net in another form.] >>> >>> I propose to add an if_dev member to struct ifnet. It would be of type >>> device_t and be defined to point to the device for the interface or NULL >>> if there is no device (or if there was not an easy way to get access to >>> one). >>> >>> This change would codify the the relationship between an interface and >>> the underlying physical device. It also would get rid of the existing >>> abuses of if_name to look up the driver associated with an interface >>> and simplify a number of messy cases in the conversion from if_unit and >>> if_name to if_xname. >>> >>> Does this seem like a reasonable thing to do? >> >>Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it >>sounds a good idea to have the if_dev field into the ifnet structure. > > Somebody please explain how this would work for non-hardware > interfaces like if_loop, if_tun, if_tap etc ? > > device_t is what we use to hitch drivers to hardware. > > ifnet is what we use to hitch drivers to the netstack. > > They should not be tangled. You mean like dev_t and device_t shouldn't be tangled like we do with si_drv1? Oh, wait... -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 08:08:38 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA93816A4B3; Tue, 30 Sep 2003 08:08:38 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8529744017; Tue, 30 Sep 2003 08:08:37 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h8UF8YOP011375; Tue, 30 Sep 2003 17:08:35 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Sep 2003 10:33:48 EDT." Date: Tue, 30 Sep 2003 17:08:34 +0200 Message-ID: <11374.1064934514@critter.freebsd.dk> cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 15:08:39 -0000 In message , John Baldwin writes: >>>Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it >>>sounds a good idea to have the if_dev field into the ifnet structure. >> >> Somebody please explain how this would work for non-hardware >> interfaces like if_loop, if_tun, if_tap etc ? >> >> device_t is what we use to hitch drivers to hardware. >> >> ifnet is what we use to hitch drivers to the netstack. >> >> They should not be tangled. > >You mean like dev_t and device_t shouldn't be tangled like we do >with si_drv1? Oh, wait... I don't think any correctly written driver stores it's device_t in a dev_t. It should store it's softc structure, which should contain pointers to both. Even if there is a driver which does do that, it happens inside the device driver, and it does not handicap the remaining device drivers with its choice. If you stick a newbus requirement on "struct ifnet" you suddenly make demands that a lot of our network drivers cannot satisfy. The problem with propagating newbus above the device drivers is that we start postulating a specific relationship between logical devices and physical (ie: a ifnet has exactly one device_t). There is nothing in the "data-model" of the kernel that says that a network interface corresponds to exactly one hardware device and more importantly: there shouldn't be either. If_tun _has_ no physical device, and it would be totally insane to invent a device_t for if_tun, considering that it would not serve any purpose at all, apart from satisfying some peoples craving to have device_t in all data structures in the system. Demanding such a relationship will only make our life more difficult when we get to deal with all the non-standard devices like if_sl, if_ppp, if_ng, if_tun, if_tap which have no device_t, or musycc, a network card where you have to juggle two device_t's, one for the framer and one for the line encoder. As it is now, device_t and newbus provides a good model for our attachment of device drivers to hardware, it's not quite perfect, but it is good enough that nobody can be bothered to sit down and write something perfect. We have "struct ifnet" which describes a network interface, it describes it based on the access model, and it does in fact not care a hoot what implements that interface, hardware, software or bongo drums, it doesn't matter. Similarly, we have "dev_t" to descripe filesystem accessed devices, and it describes those in the terms of the access model, not in terms of what is behind them, hardware, software or bongo drums. If all you want is an extra field in "struct ifnet" to hang driver information on, then by all means add that field. As long as you give it type "void *" and make it private to the driver I have no problem with that. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 08:30:46 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B657D16A4BF; Tue, 30 Sep 2003 08:30:46 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0F9344013; Tue, 30 Sep 2003 08:30:41 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id BAA17679; Wed, 1 Oct 2003 01:30:30 +1000 Date: Wed, 1 Oct 2003 01:29:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: John Baldwin In-Reply-To: Message-ID: <20031001011119.U1245@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 15:30:46 -0000 On Tue, 30 Sep 2003, John Baldwin wrote: > On 30-Sep-2003 Bruce Evans wrote: > > On Mon, 29 Sep 2003, Brooks Davis wrote: > >> Unfortunately, "soon" hasn't happened yet and it is now tripping me > >> up. To add the if_dev member to struct ifnet (see the forthcoming > >> post on that subject), it is necessary for sys/bus.h to be included in > >> net/if_var.h > > > > That would be namespace pollution, so it is not permitted :-). Requiring > > all files that include (and especially to > > include would be interface breakage so it is even less > > permitted. > > Well, if if.h stops including if_var.h, then only kernel files that > include net/if_var.h would need sys/bus.h. I think that's manageable. All userland files that include net/if_var.h would also need it (except they would only need device_t). > >> which in turn requires that if_var.h NOT be included in > >> genassym.c. > > > > Do you mean in userland? There don't seem to be any immediate problems > > for genassym.c or any other file in the kernel from including > > unconditionally in . However, the pollution may be harmful > ... > The problem is that the newbus foo_if.h files don't exist when genassym > is compiled and used. sys/bus.h needs bus_if.h and device_if.h, hence > the breakage. I see. This is a bug in the dependencies for genassym.o and .depend. "make depend" creates *_if.h but it also creates genassym.o. There aren't enough dependencies so the order is mostly accidental. genassym.o happens to get created first, so it doesn't compile unless *_if.h already exist. Bruce From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:14:34 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76D0E16A4B3 for ; Tue, 30 Sep 2003 10:14:34 -0700 (PDT) Received: from mail.speakeasy.net (mail9.speakeasy.net [216.254.0.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09A0843FE9 for ; Tue, 30 Sep 2003 10:14:33 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13174 invoked from network); 30 Sep 2003 17:14:32 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 17:14:32 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UHES6Y058924; Tue, 30 Sep 2003 13:14:29 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20031001011119.U1245@gamplex.bde.org> Date: Tue, 30 Sep 2003 13:14:34 -0400 (EDT) From: John Baldwin To: Bruce Evans X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:14:34 -0000 On 30-Sep-2003 Bruce Evans wrote: > On Tue, 30 Sep 2003, John Baldwin wrote: > >> On 30-Sep-2003 Bruce Evans wrote: >> > On Mon, 29 Sep 2003, Brooks Davis wrote: >> >> Unfortunately, "soon" hasn't happened yet and it is now tripping me >> >> up. To add the if_dev member to struct ifnet (see the forthcoming >> >> post on that subject), it is necessary for sys/bus.h to be included in >> >> net/if_var.h >> > >> > That would be namespace pollution, so it is not permitted :-). Requiring >> > all files that include (and especially to >> > include would be interface breakage so it is even less >> > permitted. >> >> Well, if if.h stops including if_var.h, then only kernel files that >> include net/if_var.h would need sys/bus.h. I think that's manageable. > > All userland files that include net/if_var.h would also need it (except > they would only need device_t). Is struct ifnet exposed to userland? Ugh, why do we export such things? I guess because ifconfig grovels around in the kernel due to a lack of APIs between the kernel and userland. *sigh* >> >> which in turn requires that if_var.h NOT be included in >> >> genassym.c. >> > >> > Do you mean in userland? There don't seem to be any immediate problems >> > for genassym.c or any other file in the kernel from including >> > unconditionally in . However, the pollution may be harmful >> ... >> The problem is that the newbus foo_if.h files don't exist when genassym >> is compiled and used. sys/bus.h needs bus_if.h and device_if.h, hence >> the breakage. > > I see. This is a bug in the dependencies for genassym.o and .depend. > "make depend" creates *_if.h but it also creates genassym.o. There aren't > enough dependencies so the order is mostly accidental. genassym.o happens > to get created first, so it doesn't compile unless *_if.h already exist. I think that genassym shouldn't need anything that includes *_if.h headers, and that if we find ourselves in that situation, perhaps some huge header needs to be split up instead. :) We shouldn't be going near new-bus or kobj in assembly files. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:14:39 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FED816A4B3 for ; Tue, 30 Sep 2003 10:14:39 -0700 (PDT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id E330C43FAF for ; Tue, 30 Sep 2003 10:14:37 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 5310 invoked from network); 30 Sep 2003 17:14:37 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 17:14:37 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UHEX6Y058932; Tue, 30 Sep 2003 13:14:34 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <11374.1064934514@critter.freebsd.dk> Date: Tue, 30 Sep 2003 13:14:39 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:14:39 -0000 On 30-Sep-2003 Poul-Henning Kamp wrote: > In message , John Baldwin writes: > >>>>Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it >>>>sounds a good idea to have the if_dev field into the ifnet structure. >>> >>> Somebody please explain how this would work for non-hardware >>> interfaces like if_loop, if_tun, if_tap etc ? >>> >>> device_t is what we use to hitch drivers to hardware. >>> >>> ifnet is what we use to hitch drivers to the netstack. >>> >>> They should not be tangled. >> >>You mean like dev_t and device_t shouldn't be tangled like we do >>with si_drv1? Oh, wait... > > I don't think any correctly written driver stores it's device_t in > a dev_t. It should store it's softc structure, which should contain > pointers to both. Even if there is a driver which does do that, > it happens inside the device driver, and it does not handicap the > remaining device drivers with its choice. Fair enough. I think that Brooks planned to use a NULL device_t for interfaces w/o a backing new-bus device. However, that means you still need if_name for all the non-newbus devices, so this seems somewhat pointless if if_name is the only reason. Another counterpoint is that the new-bus namespace and the netif namespace aren't the same anyway and that seemed to be the point of this linkage. The dev_t <> softc <> device_t linkages aren't about unifying namespaces. > There is nothing in the "data-model" of the kernel that says that > a network interface corresponds to exactly one hardware device > and more importantly: there shouldn't be either. Agreed. > If all you want is an extra field in "struct ifnet" to hang driver > information on, then by all means add that field. As long as you > give it type "void *" and make it private to the driver I have no > problem with that. Fair enough, though I don't think this is what Brooks was after. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:25:59 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40D1116A4B3; Tue, 30 Sep 2003 10:25:59 -0700 (PDT) Received: from mail.qubesoft.com (gate.qubesoft.com [217.169.36.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ACEF4400E; Tue, 30 Sep 2003 10:25:55 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from bluebottle.qubesoft.com (bluebottle.qubesoft.com [192.168.1.2]) by mail.qubesoft.com (8.12.9/8.12.9) with ESMTP id h8UHPpFH049801; Tue, 30 Sep 2003 18:25:52 +0100 (BST) (envelope-from dfr@nlsystems.com) Received: from builder02.qubesoft.com (builder02.qubesoft.com [192.168.1.8]) h8UHPcAc097455; Tue, 30 Sep 2003 18:25:50 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: Bruce Evans In-Reply-To: <20030930172536.U3713@gamplex.bde.org> References: <20030930010128.GA31222@Odin.AC.HMC.Edu> <20030930172536.U3713@gamplex.bde.org> Content-Type: text/plain Message-Id: <1064942737.14476.8.camel@builder02.qubesoft.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 30 Sep 2003 18:25:38 +0100 Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:25:59 -0000 On Tue, 2003-09-30 at 09:22, Bruce Evans wrote: > That's one alternative. (Far too) many places already use the simple > alternative of just using "struct device *". Grep shows 68 lines > containing "struct device" in *.h and 32 in *.c. For "device_t", the > numbers are 2140 in *.h and 5089 in *.c. This is in a sys tree with > about 1000 matches of "device_t" in generated files. There are non-bogus > uses of "struct device" to avoid namespace pollution in . > Most other uses are just bogus (modulo the existence of device_t being > non-bogus -- its opaqueness is negative since anything that wants to > use it must include and thus can see its internals. style(9) > says to not use negatively opaque typedefs). The internals of struct device are not contained in - it is completely opaque to users outside subr_bus.c. The main 'bug' here is the idea that its a good thing to export kernel data structures (struct ifnet) to userland. The layout of struct ifnet is an implementation detail - it shouldn't form part of the userland api. From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:48:25 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFAB516A4BF; Tue, 30 Sep 2003 10:48:25 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id C674D43FE9; Tue, 30 Sep 2003 10:48:24 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UHmKDH024717; Tue, 30 Sep 2003 10:48:20 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UHmKua024715; Tue, 30 Sep 2003 10:48:20 -0700 Date: Tue, 30 Sep 2003 10:48:19 -0700 From: Brooks Davis To: John Baldwin Message-ID: <20030930174815.GC31908@Odin.AC.HMC.Edu> References: <11374.1064934514@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="96YOpH+ONegL0A3E" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@freebsd.org cc: Poul-Henning Kamp cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:48:26 -0000 --96YOpH+ONegL0A3E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 01:14:39PM -0400, John Baldwin wrote: >=20 > Fair enough. I think that Brooks planned to use a NULL device_t for > interfaces w/o a backing new-bus device. However, that means you > still need if_name for all the non-newbus devices, so this seems > somewhat pointless if if_name is the only reason. Another counterpoint > is that the new-bus namespace and the netif namespace aren't the same > anyway and that seemed to be the point of this linkage. The > dev_t <> softc <> device_t linkages aren't about unifying namespaces. The idea here is that virtually all uses of if_name/if_unit that aren't just there for the users benefit are actually references to the underlying driver not name of the interface. Currently they are the same (i.e. ifname is nearly always device_get_name(dev) or a bug prone manual version there of), but I would like to separate them so we can rename interfaces. Since device_t is as close to a repository of driver/instance information as we've got, I though using it would be a reasonable way to go. As a side benefit, most drivers have a copy of it in their softc already so you'd have a standard place to put it. I suppose a usable alternative would be to revive if_name and if_unit as something like if_drvname and if_drvunit. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --96YOpH+ONegL0A3E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ecHeXY6L6fI4GtQRAoM3AKCoaXbVJIwWuCegOL01REpap2jrfwCgiNiO vPGLE0NwLisRNtuK8jp0e2g= =S9HB -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:52:49 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53D7516A4B3; Tue, 30 Sep 2003 10:52:49 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D2C943FB1; Tue, 30 Sep 2003 10:52:48 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:smmsp@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UHpLDV025768; Tue, 30 Sep 2003 10:52:32 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UHUYfq018048; Tue, 30 Sep 2003 10:30:34 -0700 Date: Tue, 30 Sep 2003 10:30:33 -0700 From: Brooks Davis To: John Baldwin Message-ID: <20030930173033.GB31908@Odin.AC.HMC.Edu> References: <20031001011119.U1245@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:52:49 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 01:14:34PM -0400, John Baldwin wrote: >=20 > On 30-Sep-2003 Bruce Evans wrote: > > On Tue, 30 Sep 2003, John Baldwin wrote: > >=20 > >> On 30-Sep-2003 Bruce Evans wrote: > >> > On Mon, 29 Sep 2003, Brooks Davis wrote: > >> >> Unfortunately, "soon" hasn't happened yet and it is now tripping me > >> >> up. To add the if_dev member to struct ifnet (see the forthcoming > >> >> post on that subject), it is necessary for sys/bus.h to be included= in > >> >> net/if_var.h > >> > > >> > That would be namespace pollution, so it is not permitted :-). Requ= iring > >> > all files that include (and especially to > >> > include would be interface breakage so it is even less > >> > permitted. > >> > >> Well, if if.h stops including if_var.h, then only kernel files that > >> include net/if_var.h would need sys/bus.h. I think that's manageable. > >=20 > > All userland files that include net/if_var.h would also need it (except > > they would only need device_t). >=20 > Is struct ifnet exposed to userland? Ugh, why do we export such things? > I guess because ifconfig grovels around in the kernel due to a lack of > APIs between the kernel and userland. *sigh* ifconfig is actually OK, it uses sysctl. netstat and ifmcstat do go grovling around in there as do 4-5 ports. If someone fixed our userland that would provide the template to fix the ports since they are all just netstat in some form or another. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/eb20XY6L6fI4GtQRApTwAJ0ZGFspAr0NJYMOOCghsYurtntxlACeKILY 4kch6VFEGstPNOfkb/ZFr38= =jHza -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:53:04 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EE5316A4B3; Tue, 30 Sep 2003 10:53:04 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95E1C43F85; Tue, 30 Sep 2003 10:53:02 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:smmsp@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UHpLDX025768; Tue, 30 Sep 2003 10:52:48 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UHFa4c011339; Tue, 30 Sep 2003 10:15:36 -0700 Date: Tue, 30 Sep 2003 10:15:36 -0700 From: Brooks Davis To: Poul-Henning Kamp Message-ID: <20030930171535.GA31908@Odin.AC.HMC.Edu> References: <200309301045.15776.vjardin@wanadoo.fr> <8475.1064905854@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <8475.1064905854@critter.freebsd.dk> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:53:04 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 09:10:54AM +0200, Poul-Henning Kamp wrote: > In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes: > >Le Mardi 30 Septembre 2003 03:03, Brooks Davis a =E9crit : > >> [Previously posted to -net in another form.] > >> > >> I propose to add an if_dev member to struct ifnet. It would be of type > >> device_t and be defined to point to the device for the interface or NU= LL > >> if there is no device (or if there was not an easy way to get access to > >> one). > >> > >> This change would codify the the relationship between an interface and > >> the underlying physical device. It also would get rid of the existing > >> abuses of if_name to look up the driver associated with an interface > >> and simplify a number of messy cases in the conversion from if_unit and > >> if_name to if_xname. > >> > >> Does this seem like a reasonable thing to do? > > > >Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreove= r it=20 > >sounds a good idea to have the if_dev field into the ifnet structure. >=20 > Somebody please explain how this would work for non-hardware > interfaces like if_loop, if_tun, if_tap etc ? if_dev would be NULL when a device_t was not available. Code which used this feature would be required to either check that if_dev was non-NULL before trying to use it or have special knowldege that it only gets called with struct ifnet instances which have a non-NULL if_dev member. For instance, driver routines which take a struct ifnet would know that they are only called on their own ifnet so they could assume they had filled it in. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --wac7ysb48OaltWcw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ebnzXY6L6fI4GtQRAlveAJ9ZoFSGyyHg317JC6z+Wrgp2K+/2QCdGID2 ttlbZccT/fcmYswywjaqA1o= =HbMf -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:56:46 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6279C16A4B3; Tue, 30 Sep 2003 10:56:46 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C0F944011; Tue, 30 Sep 2003 10:56:45 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h8UHufOP013248; Tue, 30 Sep 2003 19:56:42 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Brooks Davis From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Sep 2003 10:15:36 PDT." <20030930171535.GA31908@Odin.AC.HMC.Edu> Date: Tue, 30 Sep 2003 19:56:41 +0200 Message-ID: <13247.1064944601@critter.freebsd.dk> cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 17:56:46 -0000 In message <20030930171535.GA31908@Odin.AC.HMC.Edu>, Brooks Davis writes: >> Somebody please explain how this would work for non-hardware >> interfaces like if_loop, if_tun, if_tap etc ? > >if_dev would be NULL when a device_t was not available. Code which used >this feature would be required to either check that if_dev was non-NULL >before trying to use it or have special knowldege that it only gets >called with struct ifnet instances which have a non-NULL if_dev member. >For instance, driver routines which take a struct ifnet would know that >they are only called on their own ifnet so they could assume they had >filled it in. So you'd still have to keep the if_name + if_unit around for the drivers which do not have a device_t ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 11:23:06 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 392C516A4BF for ; Tue, 30 Sep 2003 11:23:06 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91EE24400D for ; Tue, 30 Sep 2003 11:23:04 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13306 invoked from network); 30 Sep 2003 18:23:03 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Sep 2003 18:23:03 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h8UIMv6Y059221; Tue, 30 Sep 2003 14:22:58 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030930174815.GC31908@Odin.AC.HMC.Edu> Date: Tue, 30 Sep 2003 14:23:02 -0400 (EDT) From: John Baldwin To: Brooks Davis X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: arch@freebsd.org cc: Poul-Henning Kamp cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 18:23:06 -0000 On 30-Sep-2003 Brooks Davis wrote: > On Tue, Sep 30, 2003 at 01:14:39PM -0400, John Baldwin wrote: >> >> Fair enough. I think that Brooks planned to use a NULL device_t for >> interfaces w/o a backing new-bus device. However, that means you >> still need if_name for all the non-newbus devices, so this seems >> somewhat pointless if if_name is the only reason. Another counterpoint >> is that the new-bus namespace and the netif namespace aren't the same >> anyway and that seemed to be the point of this linkage. The >> dev_t <> softc <> device_t linkages aren't about unifying namespaces. > > The idea here is that virtually all uses of if_name/if_unit that aren't > just there for the users benefit are actually references to the > underlying driver not name of the interface. Currently they are the > same (i.e. ifname is nearly always device_get_name(dev) or a bug prone > manual version there of), but I would like to separate them so we can > rename interfaces. > > Since device_t is as close to a repository of driver/instance > information as we've got, I though using it would be a reasonable way > to go. As a side benefit, most drivers have a copy of it in their softc > already so you'd have a standard place to put it. > > I suppose a usable alternative would be to revive if_name and if_unit > as something like if_drvname and if_drvunit. Are these uses all within the driver itself? If so, then just giving ifnet a void * that is private to the driver would allow ifnet devices hung off of new-bus devices to cache their device_t w/o requiring the rest of the kernel to know what that private variable is. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 11:24:03 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49BCE16A4BF; Tue, 30 Sep 2003 11:24:03 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7589D43FB1; Tue, 30 Sep 2003 11:24:02 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UIO0DH005560; Tue, 30 Sep 2003 11:24:00 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UINxci005559; Tue, 30 Sep 2003 11:23:59 -0700 Date: Tue, 30 Sep 2003 11:23:59 -0700 From: Brooks Davis To: Poul-Henning Kamp Message-ID: <20030930182359.GD31908@Odin.AC.HMC.Edu> References: <20030930171535.GA31908@Odin.AC.HMC.Edu> <13247.1064944601@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d9ADC0YsG2v16Js0" Content-Disposition: inline In-Reply-To: <13247.1064944601@critter.freebsd.dk> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 18:24:03 -0000 --d9ADC0YsG2v16Js0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 07:56:41PM +0200, Poul-Henning Kamp wrote: > In message <20030930171535.GA31908@Odin.AC.HMC.Edu>, Brooks Davis writes: >=20 > >> Somebody please explain how this would work for non-hardware > >> interfaces like if_loop, if_tun, if_tap etc ? > > > >if_dev would be NULL when a device_t was not available. Code which used > >this feature would be required to either check that if_dev was non-NULL > >before trying to use it or have special knowldege that it only gets > >called with struct ifnet instances which have a non-NULL if_dev member. > >For instance, driver routines which take a struct ifnet would know that > >they are only called on their own ifnet so they could assume they had > >filled it in. >=20 > So you'd still have to keep the if_name + if_unit around for the > drivers which do not have a device_t ? Not today, since none of them get used in the paths that do this. In general the network code doesn't care what you call an interface. There are a few corners where it does, but nothing that isn't specific to a certain set of drivers. Additionally, it is necessary to not have members called if_name and if_unit if we have if_xname as the primary driver name. It's also worth noting that one of the things I want to do is break the driver+unit mapping for certain types of pseudo devices. Specifically vlan devices should be allocatable by creating an interface with a name like fxp0.100 so while you could synthesize a unit number, it wouldn't have any useful meaning. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --d9ADC0YsG2v16Js0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/eco2XY6L6fI4GtQRAuwDAKCe31Th8L2pVT14zAG+ZhB6LcnLtgCfZwWC S7NMTkdh6BZHwpbsmj/FSL8= =7Rec -----END PGP SIGNATURE----- --d9ADC0YsG2v16Js0-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 11:29:08 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BEF616A4B3; Tue, 30 Sep 2003 11:29:08 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64B9F43FF9; Tue, 30 Sep 2003 11:29:06 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UIT2DH006492; Tue, 30 Sep 2003 11:29:03 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UIT26w006491; Tue, 30 Sep 2003 11:29:02 -0700 Date: Tue, 30 Sep 2003 11:29:02 -0700 From: Brooks Davis To: John Baldwin Message-ID: <20030930182902.GE31908@Odin.AC.HMC.Edu> References: <20030930174815.GC31908@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MIdTMoZhcV1D07fI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@FreeBSD.org cc: Poul-Henning Kamp cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 18:29:08 -0000 --MIdTMoZhcV1D07fI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 02:23:02PM -0400, John Baldwin wrote: >=20 > On 30-Sep-2003 Brooks Davis wrote: > > On Tue, Sep 30, 2003 at 01:14:39PM -0400, John Baldwin wrote: > >>=20 > >> Fair enough. I think that Brooks planned to use a NULL device_t for > >> interfaces w/o a backing new-bus device. However, that means you > >> still need if_name for all the non-newbus devices, so this seems > >> somewhat pointless if if_name is the only reason. Another counterpoint > >> is that the new-bus namespace and the netif namespace aren't the same > >> anyway and that seemed to be the point of this linkage. The > >> dev_t <> softc <> device_t linkages aren't about unifying namespaces. > >=20 > > The idea here is that virtually all uses of if_name/if_unit that aren't > > just there for the users benefit are actually references to the > > underlying driver not name of the interface. Currently they are the > > same (i.e. ifname is nearly always device_get_name(dev) or a bug prone > > manual version there of), but I would like to separate them so we can > > rename interfaces. > >=20 > > Since device_t is as close to a repository of driver/instance > > information as we've got, I though using it would be a reasonable way > > to go. As a side benefit, most drivers have a copy of it in their softc > > already so you'd have a standard place to put it. > >=20 > > I suppose a usable alternative would be to revive if_name and if_unit > > as something like if_drvname and if_drvunit. >=20 > Are these uses all within the driver itself? If so, then just giving > ifnet a void * that is private to the driver would allow ifnet devices > hung off of new-bus devices to cache their device_t w/o requiring the > rest of the kernel to know what that private variable is. All are within other code. One example is in dev/mii/brgphy.c which a phy feature is not enabled when it is attached to some MACs. A messier example is in the new ATM code where interfaces are looked up by name. In all cases, usage is limited to a narrow set of code, but it's not generally in the driver itself (in those cases, the softc is often already used, say to hold the unit). -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --MIdTMoZhcV1D07fI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ecttXY6L6fI4GtQRAjiVAJsFh1JBTe0MwR1XSCM5Jw+01j1lpgCghipY 9jOMGlXMubzG5yARuH2mFsw= =KO8S -----END PGP SIGNATURE----- --MIdTMoZhcV1D07fI-- From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 13:30:44 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C82E516A4B3 for ; Tue, 30 Sep 2003 13:30:44 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD57343FF3 for ; Tue, 30 Sep 2003 13:30:42 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost.nic.fr [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h8UKUfgk050388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Tue, 30 Sep 2003 16:30:41 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id h8UKUeBh050385; Tue, 30 Sep 2003 16:30:40 -0400 (EDT) (envelope-from wollman) Date: Tue, 30 Sep 2003 16:30:40 -0400 (EDT) From: Garrett Wollman Message-Id: <200309302030.h8UKUeBh050385@khavrinen.lcs.mit.edu> To: Doug Rabson In-Reply-To: <1064942737.14476.8.camel@builder02.qubesoft.com> References: <20030930010128.GA31222@Odin.AC.HMC.Edu> <20030930172536.U3713@gamplex.bde.org> <1064942737.14476.8.camel@builder02.qubesoft.com> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.37 cc: net@freebsd.org Subject: Re: finishing the if.h/if_var.h split X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 20:30:44 -0000 < said: > The internals of struct device are not contained in Unfortunately, the internals of `device_t' are. That's why style(9) discourages such types. -GAWollman From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 15:58:44 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D58B116A4C1; Tue, 30 Sep 2003 15:58:44 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22B9143FDF; Tue, 30 Sep 2003 15:58:43 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UMwcDH007509; Tue, 30 Sep 2003 15:58:38 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UMwbJu007508; Tue, 30 Sep 2003 15:58:37 -0700 Date: Tue, 30 Sep 2003 15:58:37 -0700 From: Brooks Davis To: Brooks Davis Message-ID: <20030930225826.GD14082@Odin.AC.HMC.Edu> References: <20030930010327.GB31222@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FFoLq8A0u+X9iRU8" Content-Disposition: inline In-Reply-To: <20030930010327.GB31222@Odin.AC.HMC.Edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2003 22:58:45 -0000 --FFoLq8A0u+X9iRU8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Since there are some objections to this proposal, I have an alternative one for consideration. I would add two new members to ifnet, if_dname and if_dunit, containing the driver name and unit which would be similar to the current if_name and if_unit with the exception that if_dunit would be an int to match unit in device_t. Negative values of unit would mean "no unit" for pseudo devices where units don't really make sense. Because this would add annoying overhead to the init routine, I would also propose adding an if_initname() function that would hide the initialization of these variables and (if MFC'd) aid portability between 4 and 5. Is this a better or worse idea then adding if_dev? -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --FFoLq8A0u+X9iRU8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/egqGXY6L6fI4GtQRAppjAKDhX7AxkI82GY1tOTTuuBEpkhLLlwCggWbp jKuVQDNjutcNd/F/caXYX+Y= =D74r -----END PGP SIGNATURE----- --FFoLq8A0u+X9iRU8-- From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 03:56:12 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEB5016A4BF for ; Wed, 1 Oct 2003 03:56:12 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 774BF43FAF for ; Wed, 1 Oct 2003 03:56:11 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 8889E65298 for ; Wed, 1 Oct 2003 11:56:10 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 69886-05 for ; Wed, 1 Oct 2003 11:56:10 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id A848565292 for ; Wed, 1 Oct 2003 11:55:58 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id BFBA01F; Wed, 1 Oct 2003 11:55:53 +0100 (BST) Date: Wed, 1 Oct 2003 11:55:53 +0100 From: Bruce M Simpson To: freebsd-net@freebsd.org Message-ID: <20031001105553.GA10462@saboteur.dek.spc.org> Mail-Followup-To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="98e8jtXdkpgskNou" Content-Disposition: inline Subject: Review requested: revised patch for bin/41647 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 10:56:13 -0000 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, It should be possible to set the link layer address of an interface whilst also setting the IP address. Here's a revised patch for ifconfig(8) to add this functionality (against HEAD) based on the one in the PR. There is a problem in that applying this patch modifies syntax such that statements of the form 'ifconfig xl0 ether' to view the ethernet address of an interface will no longer work. Using ifconfig(8) on its own or with the -a switch will dump this information however. Feedback anyone? BMS --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lladdr.diff" --- ifconfig.c.orig Tue Sep 30 03:25:53 2003 +++ ifconfig.c Wed Oct 1 11:45:54 2003 @@ -170,7 +170,7 @@ c_func setip6eui64; #endif c_func setifipdst; -c_func setifflags, setifmetric, setifmtu, setifcap; +c_func setifflags, setiflladdr, setifmetric, setifmtu, setifcap; c_func clone_destroy; @@ -234,6 +234,6 @@ { "-link2", -IFF_LINK2, setifflags }, { "monitor", IFF_MONITOR, setifflags }, { "-monitor", -IFF_MONITOR, setifflags }, #ifdef USE_IF_MEDIA { "media", NEXTARG, setmedia }, { "mode", NEXTARG, setmediamode }, @@ -286,6 +286,9 @@ { "compress", IFF_LINK0, setifflags }, { "noicmp", IFF_LINK1, setifflags }, { "mtu", NEXTARG, setifmtu }, + { "ether", NEXTARG, setiflladdr }, + { "link", NEXTARG, setiflladdr }, + { "lladdr", NEXTARG, setiflladdr }, { 0, 0, setifaddr }, { 0, 0, setifdstaddr }, }; @@ -339,12 +342,6 @@ #endif { "atalk", AF_APPLETALK, at_status, at_getaddr, NULL, SIOCDIFADDR, SIOCAIFADDR, C(addreq), C(addreq) }, - { "link", AF_LINK, link_status, link_getaddr, NULL, - 0, SIOCSIFLLADDR, NULL, C(ridreq) }, - { "ether", AF_LINK, link_status, link_getaddr, NULL, - 0, SIOCSIFLLADDR, NULL, C(ridreq) }, - { "lladdr", AF_LINK, link_status, link_getaddr, NULL, - 0, SIOCSIFLLADDR, NULL, C(ridreq) }, #if 0 /* XXX conflicts with the media command */ #ifdef USE_IF_MEDIA { "media", AF_UNSPEC, media_status, NULL, NULL, }, /* XXX not real!! */ @@ -1036,4 +1033,17 @@ warn("ioctl (set mtu)"); } +void +setiflladdr(val, dummy, s, afp) + const char *val; + int dummy __unused; + int s; + const struct afswtch *afp; +{ + strncpy(ridreq.ifr_name, name, sizeof(ridreq.ifr_name)); + link_getaddr(val, ADDR); + if (ioctl(s, SIOCSIFLLADDR, (caddr_t)&ridreq) < 0) + warn("ioctl(SIOCSIFLLADDR)"); +} + #define IFFBITS \ --98e8jtXdkpgskNou-- From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 09:26:17 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C71D16A4B3 for ; Wed, 1 Oct 2003 09:26:17 -0700 (PDT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D7D843FE3 for ; Wed, 1 Oct 2003 09:26:15 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h91GQCNn030856 for ; Wed, 1 Oct 2003 19:26:13 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F7B0022.1050000@he.iki.fi> Date: Wed, 01 Oct 2003 19:26:10 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030916 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: IP_TOS and ipv6 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 16:26:17 -0000 What is the right way to set the TRAFFIC CLASS field in ipv6 packets sent from an application? I´m looking for function similar to setsockopt IP_TOS with IPv4. Pete From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 09:40:46 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 019DA16A4B3; Wed, 1 Oct 2003 09:40:46 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C0C743FF2; Wed, 1 Oct 2003 09:40:45 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h91GebDH005761; Wed, 1 Oct 2003 09:40:37 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h91Gea9C005760; Wed, 1 Oct 2003 09:40:36 -0700 Date: Wed, 1 Oct 2003 09:40:36 -0700 From: Brooks Davis To: Harti Brandt Message-ID: <20031001164036.GA1263@Odin.AC.HMC.Edu> References: <20030930174815.GC31908@Odin.AC.HMC.Edu> <20030930182902.GE31908@Odin.AC.HMC.Edu> <20031001093334.S113@beagle.fokus.fraunhofer.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20031001093334.S113@beagle.fokus.fraunhofer.de> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 16:40:46 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 01, 2003 at 09:34:22AM +0200, Harti Brandt wrote: > On Tue, 30 Sep 2003, Brooks Davis wrote: >=20 > BD>All are within other code. One example is in dev/mii/brgphy.c which a > BD>phy feature is not enabled when it is attached to some MACs. A messier > BD>example is in the new ATM code where interfaces are looked up by name. >=20 > Where is this? One example would be in sys/netatm/atm_if.c around line 1081. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --DocE+STaALJfprDB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ewOEXY6L6fI4GtQRAkTlAKCQDJ+ecD3jUCeH1YA+D1Iuen3qrACgg1nL 6lrYQ3dwuti2dhEgSaRq3W4= =X5ax -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 09:42:53 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1790916A4B3 for ; Wed, 1 Oct 2003 09:42:53 -0700 (PDT) Received: from cheer.mahoroba.org (flets19-166.kamome.or.jp [218.45.19.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3833943FEA for ; Wed, 1 Oct 2003 09:42:51 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from lyrics.mahoroba.org (IDENT:cGowVvdrCm013v1FZ78cQHmHoA4qjNVWfqNoTADJQFcX1KrJx3HEBYVbTABYyOnI@lyrics.mahoroba.org [IPv6:3ffe:501:185b:8010:280:88ff:fe03:4841]) (user=ume mech=CRAM-MD5 bits=0)h91Ggjps055378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Oct 2003 01:42:45 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 02 Oct 2003 01:42:45 +0900 Message-ID: From: Hajimu UMEMOTO To: Petri Helenius In-Reply-To: <3F7B0022.1050000@he.iki.fi> References: <3F7B0022.1050000@he.iki.fi> User-Agent: xcite1.38> Wanderlust/2.11.3 (Wonderwall) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386--freebsd) MULE/5.0 (=?ISO-2022-JP?B?GyRCOC1MWhsoQg==?=) X-Operating-System: FreeBSD 5.1-CURRENT MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on cheer.mahoroba.org cc: freebsd-net@freebsd.org Subject: Re: IP_TOS and ipv6 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 16:42:53 -0000 Hi, >>>>> On Wed, 01 Oct 2003 19:26:10 +0300 >>>>> Petri Helenius said: pete> What is the right way to set the TRAFFIC CLASS field in pete> ipv6 packets sent from an application? I=B4m looking for pete> function similar to setsockopt IP_TOS with IPv4. TCLASS is not supported in current FreeBSD. It will merged into FreeBSD during next KAME merge. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 10:09:06 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B28BA16A4B3 for ; Wed, 1 Oct 2003 10:09:06 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id D43F743FB1 for ; Wed, 1 Oct 2003 10:09:03 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id E9D8E65493; Wed, 1 Oct 2003 18:09:02 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 73553-01-14; Wed, 1 Oct 2003 18:09:02 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 94A4F65492; Wed, 1 Oct 2003 18:08:58 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 704CE9; Wed, 1 Oct 2003 18:08:56 +0100 (BST) Date: Wed, 1 Oct 2003 18:08:56 +0100 From: Bruce M Simpson To: Gianmarco Giovannelli Message-ID: <20031001170856.GJ13612@saboteur.dek.spc.org> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> cc: esperti@gufi.org cc: net@freebsd.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 17:09:06 -0000 On Sun, Jun 15, 2003 at 06:55:28AM +0200, Gianmarco Giovannelli wrote: > 1) Any viable solution with FreeBSD for doing that kinds (PPPoA or RFC > 1483) of encapsulation. Using xDSL will be difficult. There is a driver I have picked up for the Lanai chip (Efficient Networks SpeedStream 30x0 series), using an Alcatel PHY, but it's nowhere near ready for primetime yet, and I have no timeline for working on it (or funding/resources). > 2) Why FreeBSD doesn't support PPPoA in the same way it support PPPoE ? > Which are the difficulties of doing this ? > The "experts" that came to sell this migration said that PPPoA is a far > more efficient and better than PPPoE, is it true ? Not necessarily. It just might be easier for telcos to carry traffic over their backbones using ATM - more efficient for them, not necessarily more efficient for end-users. You'll have better luck with an external router for now, but help is on the way from others, that is all I can say right now. BMS From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 10:12:02 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9352016A4B3; Wed, 1 Oct 2003 10:12:02 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7906A43FE5; Wed, 1 Oct 2003 10:12:01 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id AB301654DD; Wed, 1 Oct 2003 18:12:00 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 73553-01-21; Wed, 1 Oct 2003 18:12:00 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id CF9A2654C7; Wed, 1 Oct 2003 18:11:58 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 252599; Wed, 1 Oct 2003 18:11:58 +0100 (BST) Date: Wed, 1 Oct 2003 18:11:58 +0100 From: Bruce M Simpson To: Petri Helenius Message-ID: <20031001171158.GK13612@saboteur.dek.spc.org> Mail-Followup-To: Petri Helenius , Edwin Groothuis , freebsd-net@freebsd.org, Josh Brooks , fenner@freebsd.org References: <20030917182850.Q52432-100000@mail.econolodgetulsa.com> <20030918014203.GA59403@k7.mavetju> <3F694D56.9040609@he.iki.fi> <20030918124311.GC3431@saboteur.dek.spc.org> <3F6A1CA9.5030701@he.iki.fi> <20030918210538.GB2720@saboteur.dek.spc.org> <3F6A2710.5090000@he.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3F6A2710.5090000@he.iki.fi> cc: freebsd-net@freebsd.org cc: Josh Brooks cc: fenner@freebsd.org Subject: Re: I would like to tcpdump and get all the packets... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 17:12:02 -0000 On Fri, Sep 19, 2003 at 12:43:44AM +0300, Petri Helenius wrote: > >Shurely you mean tcpdump 3.7.2, which is already imported (by fenner, with > >additional hacks)? > I mean libpcap, which also tcpdump uses, if I´m not mistaken. Look in > contrib/libpcap This is coming up more often. Perhaps we should consider net/libpcap-devel and net/tcpdump-devel ports for people who wish to track CVS and/or snapshots of these tools? This might relieve some of the pressure on Bill to update the vendor branch so often. BMS From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 11:18:02 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA29916A4B3 for ; Wed, 1 Oct 2003 11:18:02 -0700 (PDT) Received: from pit.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55EF243F93 for ; Wed, 1 Oct 2003 11:18:00 -0700 (PDT) (envelope-from barney@pit.databus.com) Received: from pit.databus.com (localhost [127.0.0.1]) by pit.databus.com (8.12.9/8.12.9) with ESMTP id h91IHxTI041833; Wed, 1 Oct 2003 14:17:59 -0400 (EDT) (envelope-from barney@pit.databus.com) Received: (from barney@localhost) by pit.databus.com (8.12.9/8.12.9/Submit) id h91IHxBn041804; Wed, 1 Oct 2003 14:17:59 -0400 (EDT) (envelope-from barney) Date: Wed, 1 Oct 2003 14:17:59 -0400 From: Barney Wolff To: Bruce M Simpson Message-ID: <20031001181759.GA65157@pit.databus.com> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001170856.GJ13612@saboteur.dek.spc.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031001170856.GJ13612@saboteur.dek.spc.org> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.36 cc: net@freebsd.org cc: esperti@gufi.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:18:03 -0000 On Wed, Oct 01, 2003 at 06:08:56PM +0100, Bruce M Simpson wrote: > On Sun, Jun 15, 2003 at 06:55:28AM +0200, Gianmarco Giovannelli wrote: > > 1) Any viable solution with FreeBSD for doing that kinds (PPPoA or RFC > > 1483) of encapsulation. > > Using xDSL will be difficult. There is a driver I have picked up for the > Lanai chip (Efficient Networks SpeedStream 30x0 series), using an Alcatel > PHY, but it's nowhere near ready for primetime yet, and I have no timeline > for working on it (or funding/resources). > > > 2) Why FreeBSD doesn't support PPPoA in the same way it support PPPoE ? > > Which are the difficulties of doing this ? > > The "experts" that came to sell this migration said that PPPoA is a far > > more efficient and better than PPPoE, is it true ? > > Not necessarily. It just might be easier for telcos to carry traffic over > their backbones using ATM - more efficient for them, not necessarily more > efficient for end-users. > > You'll have better luck with an external router for now, but help is on > the way from others, that is all I can say right now. I'm a little confused. My ISP (AceDSL in the NYC metro area) uses, I believe, 1483, and I need no extra features to have my fbsd system talk directly to the dsl modem (Westell) over ethernet with no extra protocol layers and full 1500 mtu. I have a static IP address and a /29, and just need a default route to the ISP router's addr. The dsl modem is acting as a bridge, not a router. The routing and firewalling is done by my fbsd system. Are you talking about running the phone line directly to the fbsd box with no dsl modem? -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net. From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 11:24:52 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28F4916A4B3 for ; Wed, 1 Oct 2003 11:24:52 -0700 (PDT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA17F43F3F for ; Wed, 1 Oct 2003 11:24:49 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h91IOkNn031353; Wed, 1 Oct 2003 21:24:48 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F7B1BED.7020602@he.iki.fi> Date: Wed, 01 Oct 2003 21:24:45 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030916 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hajimu UMEMOTO References: <3F7B0022.1050000@he.iki.fi> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: IP_TOS and ipv6 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:24:52 -0000 Hajimu UMEMOTO wrote: > >TCLASS is not supported in current FreeBSD. It will merged into >FreeBSD during next KAME merge. > > > Is this planned before or after 5.2? Pete From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 11:25:13 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8558C16A4BF for ; Wed, 1 Oct 2003 11:25:13 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A0DB43FB1 for ; Wed, 1 Oct 2003 11:25:12 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id B3A2365449; Wed, 1 Oct 2003 19:25:10 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 74363-01; Wed, 1 Oct 2003 19:25:10 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 7A502653AC; Wed, 1 Oct 2003 19:25:09 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 3AE849; Wed, 1 Oct 2003 19:25:08 +0100 (BST) Date: Wed, 1 Oct 2003 19:25:07 +0100 From: Bruce M Simpson To: Barney Wolff Message-ID: <20031001182507.GA24453@saboteur.dek.spc.org> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001170856.GJ13612@saboteur.dek.spc.org> <20031001181759.GA65157@pit.databus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031001181759.GA65157@pit.databus.com> cc: esperti@gufi.org cc: net@freebsd.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:25:13 -0000 On Wed, Oct 01, 2003 at 02:17:59PM -0400, Barney Wolff wrote: > Are you talking about running the phone line directly to the fbsd box > with no dsl modem? Yes. Also, PPPoA in FreeBSD is currently only implemented if you use ngatm, because of the signalling involved. RFC 1483 framing is a simple bolt-on to the existing HARP drivers, but those don't support xDSL PHYs. BMS From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 11:27:32 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A95EE16A4B3 for ; Wed, 1 Oct 2003 11:27:32 -0700 (PDT) Received: from cheer.mahoroba.org (flets19-166.kamome.or.jp [218.45.19.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C00843FAF for ; Wed, 1 Oct 2003 11:27:31 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from lyrics.mahoroba.org (IDENT:u+HX6WEtWftfkSWBViM9HOEKruverD4Z8OtFkdbPlWgF78Hd9/oTe2ikknMQiCdJ@lyrics.mahoroba.org [IPv6:3ffe:501:185b:8010:280:88ff:fe03:4841]) (user=ume mech=CRAM-MD5 bits=0)h91IRQps055792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Oct 2003 03:27:26 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 02 Oct 2003 03:27:26 +0900 Message-ID: From: Hajimu UMEMOTO To: Petri Helenius In-Reply-To: <3F7B1BED.7020602@he.iki.fi> References: <3F7B0022.1050000@he.iki.fi> <3F7B1BED.7020602@he.iki.fi> User-Agent: xcite1.38> Wanderlust/2.11.3 (Wonderwall) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386--freebsd) MULE/5.0 (=?ISO-2022-JP?B?GyRCOC1MWhsoQg==?=) X-Operating-System: FreeBSD 5.1-CURRENT MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on cheer.mahoroba.org cc: freebsd-net@freebsd.org cc: Hajimu UMEMOTO Subject: Re: IP_TOS and ipv6 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:27:32 -0000 Hi, >>>>> On Wed, 01 Oct 2003 21:24:45 +0300 >>>>> Petri Helenius said: >TCLASS is not supported in current FreeBSD. It will merged into >FreeBSD during next KAME merge. pete> Is this planned before or after 5.2? I wish to merge in time for 5.2-RELEASE. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 11:46:03 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3C8E16A4B3; Wed, 1 Oct 2003 11:46:03 -0700 (PDT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A66343FF5; Wed, 1 Oct 2003 11:46:02 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h81.vuokselantie10.fi [193.64.42.129]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h91Ik0Nn031477; Wed, 1 Oct 2003 21:46:00 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F7B20E5.6010301@he.iki.fi> Date: Wed, 01 Oct 2003 21:45:57 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030916 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce M Simpson References: <20030917182850.Q52432-100000@mail.econolodgetulsa.com> <20030918014203.GA59403@k7.mavetju> <3F694D56.9040609@he.iki.fi> <20030918124311.GC3431@saboteur.dek.spc.org> <3F6A1CA9.5030701@he.iki.fi> <20030918210538.GB2720@saboteur.dek.spc.org> <3F6A2710.5090000@he.iki.fi> <20031001171158.GK13612@saboteur.dek.spc.org> In-Reply-To: <20031001171158.GK13612@saboteur.dek.spc.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-net@freebsd.org cc: Josh Brooks cc: fenner@freebsd.org Subject: Re: I would like to tcpdump and get all the packets... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:46:03 -0000 Bruce M Simpson wrote: > >This is coming up more often. Perhaps we should consider net/libpcap-devel >and net/tcpdump-devel ports for people who wish to track CVS and/or >snapshots of these tools? This might relieve some of the pressure on Bill >to update the vendor branch so often. > > > How often is "so often"? The vendor branch is over a year old and the bug that seems to annoy most real users of bpf has been known for quite a while longer and took a while to get into the origin and now it only would need to be imported once. Or is there some larger issues I´m missing or is everybody asking the same thing for the same reason and a single update would "calm down" the chatter? Pete From owner-freebsd-net@FreeBSD.ORG Wed Oct 1 17:19:31 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C2DB16A4B3; Wed, 1 Oct 2003 17:19:31 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 334E043FB1; Wed, 1 Oct 2003 17:19:30 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 69FB465497; Thu, 2 Oct 2003 01:19:29 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 76922-02; Thu, 2 Oct 2003 01:19:28 +0100 (BST) Received: from saboteur.dek.spc.org (lardystuffer.demon.co.uk [212.228.40.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 705D26530E; Thu, 2 Oct 2003 01:19:25 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 935441A; Thu, 2 Oct 2003 01:19:20 +0100 (BST) Date: Thu, 2 Oct 2003 01:19:20 +0100 From: Bruce M Simpson To: Petri Helenius Message-ID: <20031002001920.GF660@saboteur.dek.spc.org> Mail-Followup-To: Petri Helenius , Edwin Groothuis , freebsd-net@freebsd.org, Josh Brooks , fenner@freebsd.org References: <20030917182850.Q52432-100000@mail.econolodgetulsa.com> <20030918014203.GA59403@k7.mavetju> <3F694D56.9040609@he.iki.fi> <20030918124311.GC3431@saboteur.dek.spc.org> <3F6A1CA9.5030701@he.iki.fi> <20030918210538.GB2720@saboteur.dek.spc.org> <3F6A2710.5090000@he.iki.fi> <20031001171158.GK13612@saboteur.dek.spc.org> <3F7B20E5.6010301@he.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3F7B20E5.6010301@he.iki.fi> cc: freebsd-net@freebsd.org cc: Josh Brooks cc: fenner@freebsd.org Subject: Re: I would like to tcpdump and get all the packets... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 00:19:31 -0000 On Wed, Oct 01, 2003 at 09:45:57PM +0300, Petri Helenius wrote: > How often is "so often"? The vendor branch is over a year old and the > bug that seems to annoy > most real users of bpf has been known for quite a while longer and took > a while to get into > the origin and now it only would need to be imported once. > > Or is there some larger issues I´m missing or is everybody asking the > same thing for > the same reason and a single update would "calm down" the chatter? Well, I'm thinking I'd like to be able to use ports to install a package of a recent tcpdump snapshot, as code of my own is in there now and I use it regularly with a project I'm working on. ports support would be beneficial (no need to mess around with cvs checkouts all the time, use a known good snapshot to build a package, unless hacking on tcpdump/pcap). tcpdump/pcap reside in vendor branches which other committers can't touch, the rules of the road are that re@ have the final say, and specific people have responsibility for the vendor branches. ports would seem to be an acceptable halfway house, though, for people who want to use pcap/tcpdump of a more recent vintage, than has been determined to be suitable for a FreeBSD release. does it not? BMS From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 00:45:23 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 870C716A4B3; Thu, 2 Oct 2003 00:45:23 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9F5543FBD; Thu, 2 Oct 2003 00:45:21 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h927jH627125; Thu, 2 Oct 2003 09:45:18 +0200 (MEST) Date: Thu, 2 Oct 2003 09:45:17 +0200 (CEST) From: Harti Brandt To: Brooks Davis In-Reply-To: <20031001164036.GA1263@Odin.AC.HMC.Edu> Message-ID: <20031002093437.S11328@beagle.fokus.fraunhofer.de> References: <20030930174815.GC31908@Odin.AC.HMC.Edu> <20031001093334.S113@beagle.fokus.fraunhofer.de> <20031001164036.GA1263@Odin.AC.HMC.Edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: net@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 07:45:23 -0000 On Wed, 1 Oct 2003, Brooks Davis wrote: BD>On Wed, Oct 01, 2003 at 09:34:22AM +0200, Harti Brandt wrote: BD>> On Tue, 30 Sep 2003, Brooks Davis wrote: BD>> BD>> BD>All are within other code. One example is in dev/mii/brgphy.c which a BD>> BD>phy feature is not enabled when it is attached to some MACs. A messier BD>> BD>example is in the new ATM code where interfaces are looked up by name. BD>> BD>> Where is this? BD> BD>One example would be in sys/netatm/atm_if.c around line 1081. Well, that's the old ATM code (HARP). An this place is not a problem, because HARP physical interfaces live in their own name space - they don't have a struct ifnet. A worse example is around line 1125. But, I suppose we could just use the usual way to lookup an interface via it's name and after that check that it is an HARP nif. A more serious problem is how HARP allocates NIFs: the user specifies a prefix and a number N. HARP then generates interfaces with names from prefix0 to prefixN. This is the only place, where HARP really needs a name and a unit number, but this is only to create a name for new interfaces - the names are not parsed after that, so it should be no problem to keep this stuff, except that we stuff the complete name into if_xname. All the other uses of if_name seem to be (...."%s%d", if_name, if_unit)... harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 00:53:14 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 074C516A4B3 for ; Thu, 2 Oct 2003 00:53:14 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id C529143F85 for ; Thu, 2 Oct 2003 00:53:12 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h927r8629834; Thu, 2 Oct 2003 09:53:08 +0200 (MEST) Date: Thu, 2 Oct 2003 09:53:08 +0200 (CEST) From: Harti Brandt To: Bruce M Simpson In-Reply-To: <20031001182507.GA24453@saboteur.dek.spc.org> Message-ID: <20031002095224.L11328@beagle.fokus.fraunhofer.de> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001181759.GA65157@pit.databus.com> <20031001182507.GA24453@saboteur.dek.spc.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Barney Wolff cc: net@freebsd.org cc: esperti@gufi.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 07:53:14 -0000 On Wed, 1 Oct 2003, Bruce M Simpson wrote: BMS>On Wed, Oct 01, 2003 at 02:17:59PM -0400, Barney Wolff wrote: BMS>> Are you talking about running the phone line directly to the fbsd box BMS>> with no dsl modem? BMS> BMS>Yes. Also, PPPoA in FreeBSD is currently only implemented if you use ngatm, BMS>because of the signalling involved. RFC 1483 framing is a simple bolt-on BMS>to the existing HARP drivers, but those don't support xDSL PHYs. Does PPPoA really need signalling? I tried to find any pointers to PPPoA specification, but this seems to be not easy to find. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 00:53:28 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7585D16A4B3 for ; Thu, 2 Oct 2003 00:53:28 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4234843FBD for ; Thu, 2 Oct 2003 00:53:27 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h927pG629288; Thu, 2 Oct 2003 09:51:16 +0200 (MEST) Date: Thu, 2 Oct 2003 09:51:16 +0200 (CEST) From: Harti Brandt To: Bruce M Simpson In-Reply-To: <20031001170856.GJ13612@saboteur.dek.spc.org> Message-ID: <20031002094605.A11328@beagle.fokus.fraunhofer.de> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001170856.GJ13612@saboteur.dek.spc.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: net@freebsd.org cc: esperti@gufi.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 07:53:28 -0000 On Wed, 1 Oct 2003, Bruce M Simpson wrote: BMS>On Sun, Jun 15, 2003 at 06:55:28AM +0200, Gianmarco Giovannelli wrote: BMS>> 1) Any viable solution with FreeBSD for doing that kinds (PPPoA or RFC BMS>> 1483) of encapsulation. BMS> BMS>Using xDSL will be difficult. There is a driver I have picked up for the BMS>Lanai chip (Efficient Networks SpeedStream 30x0 series), using an Alcatel BMS>PHY, but it's nowhere near ready for primetime yet, and I have no timeline BMS>for working on it (or funding/resources). BMS> BMS>> 2) Why FreeBSD doesn't support PPPoA in the same way it support PPPoE ? BMS>> Which are the difficulties of doing this ? BMS>> The "experts" that came to sell this migration said that PPPoA is a far BMS>> more efficient and better than PPPoE, is it true ? If PPPeA is the same protocol as PPPoE you just need to plug ng_pppoe on top of ng_atm with the VCC opened that carries the traffic and you're done. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 01:14:57 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CF3916A4B3 for ; Thu, 2 Oct 2003 01:14:57 -0700 (PDT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2E8643FE1 for ; Thu, 2 Oct 2003 01:14:55 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (localhost [127.0.0.1]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h928ElNn035503; Thu, 2 Oct 2003 11:14:50 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F7BDE77.90801@he.iki.fi> Date: Thu, 02 Oct 2003 11:14:47 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030923 X-Accept-Language: English [en],Finnish [fi] MIME-Version: 1.0 To: Harti Brandt References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001181759.GA65157@pit.databus.com> <20031001182507.GA24453@saboteur.dek.spc.org> <20031002095224.L11328@beagle.fokus.fraunhofer.de> In-Reply-To: <20031002095224.L11328@beagle.fokus.fraunhofer.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Barney Wolff cc: esperti@gufi.org cc: net@freebsd.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 08:14:57 -0000 Harti Brandt wrote: >On Wed, 1 Oct 2003, Bruce M Simpson wrote: > >BMS>On Wed, Oct 01, 2003 at 02:17:59PM -0400, Barney Wolff wrote: >BMS>> Are you talking about running the phone line directly to the fbsd box >BMS>> with no dsl modem? >BMS> >BMS>Yes. Also, PPPoA in FreeBSD is currently only implemented if you use ngatm, >BMS>because of the signalling involved. RFC 1483 framing is a simple bolt-on >BMS>to the existing HARP drivers, but those don't support xDSL PHYs. > >Does PPPoA really need signalling? I tried to find any pointers to PPPoA >specification, but this seems to be not easy to find. > > Usually it does not, one just runs PPP over AAL5SNAP or AAL5VCMUX PVC. However most providers seem to go for RFC1483B because it practically eliminates CPE configuration issues. Pete From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 01:16:32 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CDDD16A4B3 for ; Thu, 2 Oct 2003 01:16:32 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id C374643FA3 for ; Thu, 2 Oct 2003 01:16:23 -0700 (PDT) (envelope-from ru@sunbay.com) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h928GIZ4090040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Oct 2003 11:16:18 +0300 (EEST) (envelope-from ru@sunbay.com) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9p2/8.12.8/Submit) id h928GIHO090035 for freebsd-net@freebsd.org; Thu, 2 Oct 2003 11:16:18 +0300 (EEST) (envelope-from ru) Date: Thu, 2 Oct 2003 11:16:18 +0300 From: Ruslan Ermilov To: freebsd-net@freebsd.org Message-ID: <20031002081618.GA88940@sunbay.com> References: <20031001105553.GA10462@saboteur.dek.spc.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: <20031001105553.GA10462@saboteur.dek.spc.org> User-Agent: Mutt/1.5.4i Subject: Re: Review requested: revised patch for bin/41647 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 08:16:32 -0000 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 01, 2003 at 11:55:53AM +0100, Bruce M Simpson wrote: > Hi, >=20 > It should be possible to set the link layer address of an interface whilst > also setting the IP address. Here's a revised patch for ifconfig(8) to > add this functionality (against HEAD) based on the one in the PR. >=20 > There is a problem in that applying this patch modifies syntax such that > statements of the form 'ifconfig xl0 ether' to view the ethernet address > of an interface will no longer work. Using ifconfig(8) on its own or with > the -a switch will dump this information however. >=20 > Feedback anyone? > BMS Please don't, this would be backwards. Please see the commit log for ifconfig/ifconfig.c,v 1.73. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/e97SUkv4P6juNwoRAnDnAJ9YtSTQBIn/+hZp7bqZ/v95SWp+kgCeKmEY 7j0qOLdmAMhSw5jcnuO0bz8= =2WfU -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF-- From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 01:18:43 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 674C716A4B3; Thu, 2 Oct 2003 01:18:43 -0700 (PDT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D7A943FEA; Thu, 2 Oct 2003 01:18:41 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (localhost [127.0.0.1]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h928IcNn035533; Thu, 2 Oct 2003 11:18:39 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F7BDF5E.9060704@he.iki.fi> Date: Thu, 02 Oct 2003 11:18:38 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030923 X-Accept-Language: English [en],Finnish [fi] MIME-Version: 1.0 To: Bruce M Simpson References: <20030917182850.Q52432-100000@mail.econolodgetulsa.com> <20030918014203.GA59403@k7.mavetju> <3F694D56.9040609@he.iki.fi> <20030918124311.GC3431@saboteur.dek.spc.org> <3F6A1CA9.5030701@he.iki.fi> <20030918210538.GB2720@saboteur.dek.spc.org> <3F6A2710.5090000@he.iki.fi> <20031001171158.GK13612@saboteur.dek.spc.org> <3F7B20E5.6010301@he.iki.fi> <20031002001920.GF660@saboteur.dek.spc.org> In-Reply-To: <20031002001920.GF660@saboteur.dek.spc.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org cc: Josh Brooks cc: fenner@freebsd.org Subject: Re: I would like to tcpdump and get all the packets... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 08:18:43 -0000 Bruce M Simpson wrote: >ports would seem to be an acceptable halfway house, though, for people who >want to use pcap/tcpdump of a more recent vintage, than has been determined >to be suitable for a FreeBSD release. does it not? > > On general case, I agree with you. However libpcap does not change that often, tcpdump changes somewhat more often but the major issue here is that pcap is in direct conflict of FreeBSD release kernel code by breaking the bpf_bufsize and bpf_maxbufsize tunables from functioning. Pete From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 01:37:30 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0AE5616A4B3 for ; Thu, 2 Oct 2003 01:37:30 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C45143FF5 for ; Thu, 2 Oct 2003 01:37:28 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h928bO616305; Thu, 2 Oct 2003 10:37:24 +0200 (MEST) Date: Thu, 2 Oct 2003 10:37:24 +0200 (CEST) From: Harti Brandt To: Petri Helenius In-Reply-To: <3F7BDE77.90801@he.iki.fi> Message-ID: <20031002102922.L11328@beagle.fokus.fraunhofer.de> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001182507.GA24453@saboteur.dek.spc.org> <3F7BDE77.90801@he.iki.fi> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Barney Wolff cc: net@freebsd.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 08:37:30 -0000 On Thu, 2 Oct 2003, Petri Helenius wrote: PH>Harti Brandt wrote: PH> PH>>On Wed, 1 Oct 2003, Bruce M Simpson wrote: PH>> PH>>BMS>On Wed, Oct 01, 2003 at 02:17:59PM -0400, Barney Wolff wrote: PH>>BMS>> Are you talking about running the phone line directly to the fbsd box PH>>BMS>> with no dsl modem? PH>>BMS> PH>>BMS>Yes. Also, PPPoA in FreeBSD is currently only implemented if you use ngatm, PH>>BMS>because of the signalling involved. RFC 1483 framing is a simple bolt-on PH>>BMS>to the existing HARP drivers, but those don't support xDSL PHYs. PH>> PH>>Does PPPoA really need signalling? I tried to find any pointers to PPPoA PH>>specification, but this seems to be not easy to find. PH>> PH>> PH>Usually it does not, one just runs PPP over AAL5SNAP or AAL5VCMUX PVC. PH>However most providers seem to go for RFC1483B because it practically PH>eliminates PH>CPE configuration issues. In that case just stacking of ng_ppp (or ng_pppoe, what's the difference?) on top of ng_atm and enabling the right VCC should do it. Well, you also need to get rid of the LLC/SNAP header in between (I'm think of creating an ng_llc node). This configuration stuff could be built in into atmconfig. If someone is able to test this (has an xDSL mode, a connection and a driver for the modem) I would try to help to get this up. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 03:08:18 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC87516A4B3 for ; Thu, 2 Oct 2003 03:08:18 -0700 (PDT) Received: from xelwa2.xelerated.com (mail.xelerated.com [62.119.74.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0A0B43F75 for ; Thu, 2 Oct 2003 03:08:17 -0700 (PDT) (envelope-from Gunnar.Olsson@xelerated.com) X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 2 Oct 2003 12:08:16 +0200 Message-ID: <5F9DD2FD8EA23147AAF03A453FE58BCD788AAB@xelwa2.xelerated.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: IPv6 and ndp command Thread-Index: AcOIzRlE/7qEULUCR6ObrINDK647Wg== From: "Gunnar Olsson" To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: IPv6 and ndp command X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 10:08:18 -0000 Hi, I'm trying to force an ethernet address to an IPv6 node, with the ndp command, but getting following message:=20 xelfc1# ndp -s fe80::2bd:d4ff:fe77:8 00:ca:ad:04:00:00 writing to routing socket: No such process fe80::2bd:d4ff:fe77:8: No such process xelfc1# (I have no problem to read entries via ndp -a) If someone has an answer to my problem, please mail me! I do have tried to search for an answer in the mail archive, but with no success. Best Regards Gunnar=20 From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 04:03:43 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B923F16A4B3 for ; Thu, 2 Oct 2003 04:03:43 -0700 (PDT) Received: from alicia.nttmcl.com (alicia.nttmcl.com [216.69.69.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4366543FAF for ; Thu, 2 Oct 2003 04:03:42 -0700 (PDT) (envelope-from ab@astralblue.net) Received: from astralblue.net (dhcp245.nttmcl.com [216.69.69.245]) by alicia.nttmcl.com (8.12.9/8.12.5) with ESMTP id h92B3THB037501; Thu, 2 Oct 2003 04:03:41 -0700 (PDT) (envelope-from ab@astralblue.net) Message-ID: <3F7C05E7.8060302@astralblue.net> Date: Thu, 02 Oct 2003 04:03:03 -0700 From: "Eugene M. Kim" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030925 X-Accept-Language: en-us, en, ko-kr, ko MIME-Version: 1.0 To: Gunnar Olsson References: <5F9DD2FD8EA23147AAF03A453FE58BCD788AAB@xelwa2.xelerated.com> In-Reply-To: <5F9DD2FD8EA23147AAF03A453FE58BCD788AAB@xelwa2.xelerated.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: IPv6 and ndp command X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 11:03:43 -0000 Link-local addresses are ambiguous; you will have to further qualify the address by appending '%interface' onto it (e.g. fe80::2bd:d4ff:fe77:8%fxp0). Eugene Gunnar Olsson wrote: >Hi, >I'm trying to force an ethernet address to an IPv6 node, with the ndp >command, but getting following message: > >xelfc1# ndp -s fe80::2bd:d4ff:fe77:8 00:ca:ad:04:00:00 >writing to routing socket: No such process >fe80::2bd:d4ff:fe77:8: No such process >xelfc1# > >(I have no problem to read entries via ndp -a) > >If someone has an answer to my problem, please mail me! >I do have tried to search for an answer in the mail archive, but with no >success. > >Best Regards >Gunnar >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 04:53:56 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C08F16A4B3 for ; Thu, 2 Oct 2003 04:53:56 -0700 (PDT) Received: from xmxpita.excite.com (nn2.excitenetwork.com [207.159.120.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id E17DB43FCB for ; Thu, 2 Oct 2003 04:53:53 -0700 (PDT) (envelope-from jarthel@excite.com) Received: by xmxpita.excite.com (Postfix, from userid 110) id C5F3ABFB3; Thu, 2 Oct 2003 07:53:51 -0400 (EDT) To: freebsd-net@freebsd.org Received: from [202.45.121.254] by xprdmailfe13.nwk.excite.com via HTTP; Thu, 02 Oct 2003 07:53:51 EST X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: ID = cfd4d5fb461afac27928db6a5c77fb23 From: "Jayel" MIME-Version: 1.0 X-Sender: jarthel@excite.com X-Mailer: PHP Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Message-Id: <20031002115351.C5F3ABFB3@xmxpita.excite.com> Date: Thu, 2 Oct 2003 07:53:51 -0400 (EDT) Subject: slow speed on a winxp PC behind FreeBSD 4.8 and 5.1 firewall/gateway X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jarthel@excite.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 11:53:56 -0000 I've tried both and speeds aren't amazing. I get full speed (my adsl plan is 512/128) on the FBSD box when downloading for a local FTP server. On the WinXP PC, downloading from the same FTP and speed is struggling at 30kbytes/sec (max speed in the FBSD box is 50kbytes/sec) and it sometimes goes down. When I transferred the ADSL modem and connected the WinXP directly to it, I'm getting full speed from the same FTP server. Thanks for the replies. Jayel ------------- Important info regarding my setup------------ I have 3 NICs xl=connected to ethernet modem xl1=192.168.1.1 xl2=192.168.2.1 in my kernel, I added the following that may relate to internet connection: options IPFILTER options IPFILTER_LOG options IPFILTER_DEFAULT_BLOCK options IPSTEALTH options TCP_DROP_SYNFIN options NETGRAPH options NETGRAPH_ETHER options NETGRAPH_PPPOE options NETGRAPH_SOCKET Here are my ipnat and ipf rules. -----------ipnat------------------- #getting access to FTP servers map tun0 192.168.1.0/23 -> 0/32 proxy port 21 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 21 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 210 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 1511 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 2121 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 4165 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 11111 ftp/tcp map tun0 192.168.2.0/23 -> 0/32 proxy port 29024 ftp/tcp #map LAN to internet map tun0 192.168.1.0/24 -> 0/32 portmap tcp/udp 10001:20000 map tun0 192.168.1.0/24 -> 0/32 #map DMZ map tun0 192.168.2.0/24 -> 0/32 portmap tcp/udp 20001:30000 map tun0 192.168.2.0/24 -> 0/32 #Squid rdr tun0 0.0.0.0/0 port 80 -> 127.0.0.1 port 19980 rdr tun0 0.0.0.0/0 port 80 -> 127.0.0.1 port 19980 #DCC send/accept rdr tun0 0.0.0.0/0 port 59 -> 192.168.2.2 port 59 rdr tun0 0.0.0.0/0 port 19990 -> 192.168.2.2 port 19990 rdr tun0 0.0.0.0/0 port 19991 -> 192.168.2.2 port 19991 rdr tun0 0.0.0.0/0 port 19992 -> 192.168.2.2 port 19992 rdr tun0 0.0.0.0/0 port 19993 -> 192.168.2.2 port 19993 rdr tun0 0.0.0.0/0 port 19994 -> 192.168.2.2 port 19994 #Emule rdr tun0 0.0.0.0/0 port 4662 -> 192.168.2.2 port 4662 rdr tun0 0.0.0.0/0 port 4672 -> 192.168.2.2 port 4672 ----------IPF----------------- allow loopback pass in quick on lo0 from any to any pass out quick on lo0 from any to any #drop incomplete packets block in log quick from any to any with frag block in log quick from any to any with ipopt block in log quick from any to any with short #kill windows dust block in quick proto udp from any to any port = netbios-ns block in quick proto udp from any to any port = netbios-dgm block in quick proto udp from any to any port = netbios-ssn #block Windows exploits block in quick proto tcp from any to any port = 135 #allow access from egweneAV subnet to nynaeveAM firewall block in quick on xl1 all head 100 #ssh to nynaeveAM firewall pass in quick on xl1 proto tcp from 192.168.1.0/24 to 192.168.1.1/32 port = 22 flags S keep state group 100 #egweneAV subnet to internet #DNS pass in quick on xl1 proto udp from 192.168.1.0/24 to 210.15.254.240 port = 53 keep state group 100 pass in quick on xl1 proto udp from 192.168.1.0/24 to 210.15.254.241 port = 53 keep state group 100 #HTTP pass in quick on xl1 proto tcp from 192.168.1.0/24 to 127.0.0.1/32 port = 19980 flags S keep state group 100 #FTP servers pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 21 flags S keep state group 100 #Usenet pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 119 flags S keep state group 100 #IRC pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6665 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6666 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6667 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6668 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6669 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 7000 flags S keep state group 100 #Chikka pass in quick on xl1 proto tcp from 192.168.1.0/24 to 209.10.203.102 port = 6301 flags S keep state group 100 #MSN pass in quick on xl1 proto tcp from 192.168.1.0/24 to 207.46.104.20 port = 1863 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6891 flags S keep state group 100 pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 6892 flags S keep state group 100 #ICQ pass in quick on xl1 proto tcp from 192.168.1.0/24 to 205.188.179.233 port = 5190 flags S keep state group 100 #Yahoo pass in quick on xl1 proto tcp from 192.168.1.0/24 to 216.136.173.168 port = 5050 flags S keep state group 100 #VNC pass in quick on xl1 proto tcp from 192.168.1.0/24 to !192.168.1.1/32 port = 5900 flags S keep state group 100 #allow pings pass in quick on xl1 proto icmp from 192.168.1.0/24 to !192.168.1.1/32 icmp-type 8 keep state group 100 block in log first quick on xl1 all group 100 #allow access from internet to egweneAV subet block out quick on xl1 all head 150 #allow VNC to 192.168.1.1/32 pass out quick on xl1 proto tcp from 192.168.1.1/32 to 192.168.1.2/32 port = 5900 flags S keep state group 150 #allow HTTP to pass to 192.168.1.0/24 pass out quick on xl1 proto tcp from 127.0.0.1/32 port = 19980 to 192.168.1.0/24 keep state group 150 block in log first on xl1 all group 150 #traffic from firewall to the internet block out quick on tun0 all head 200 #DNS pass out quick on tun0 proto udp from any to 210.15.254.240 port = 53 keep state group 200 #HTTP pass out quick on tun0 proto tcp from any to any port = 80 flags S keep state group 200 #SSH pass out quick on tun0 proto tcp from any to any port = 22 keep state group 200 #FTP pass out quick on tun0 proto tcp from any to any port = 21 flags S keep state group 200 #Allow nynaeveAM to sync time with time servers (time.nist.gov) pass out quick on tun0 proto tcp from any to any port = 37 flags S keep state group 200 #allow Ping to go out pass out quick on tun0 proto icmp from any to any icmp-type 8 keep state group 200 block out log first quick on tun0 all group 200 #allow traffic from internet to nynaeveAM firewall block in quick on tun0 all head 250 #SSH pass in quick on tun0 proto tcp from any to any port = 22 flags S keep state group 250 #allow ports 20001 to 20101 to pass through to 192.168.2.2/32 for FTP connection pass in quick on tun0 proto tcp from any to 192.168.2.2/32 port 20000 >< 20102 keep state group 250 #allows the following ports to pass through 192.168.2.2/32 for DCC connections pass in quick on tun0 proto tcp from any to 192.168.2.2/32 port = 59 flags S keep state group 250 pass in quick on tun0 proto tcp from any to 192.168.2.2/32 port 19989 >< 19995 flags S keep state group 250 #allow emule connection to come into nynaeveAM pass in quick on tun0 proto tcp from any to 192.168.2.2/32 port = 4662 flags S keep state group 250 pass in quick on tun0 proto udp from any to 192.168.2.2/32 port = 4672 keep state group 250 #allow FTP data connections into nynaeveAM pass in quick on tun0 proto tcp from any port = 20 to any flags S keep state group 250 block in log first quick on tun0 all group 250 #allow access from elayneT subnet to internet block in quick on xl2 all head 300 #DNS pass in quick on xl2 proto udp from 192.168.2.0/24 to 210.15.254.240 port = 53 keep state group 300 pass in quick on xl2 proto udp from 192.168.2.0/24 to 210.15.254.241 port = 53 keep state group 300 #FTP servers pass in quick on xl2 proto tcp from 192.168.2.0/24 to !192.168.2.1/32 port = 21 flags S keep state group 300 pass in quick on xl2 proto tcp from 192.168.2.0/24 to !192.168.2.1/32 port = 210 flags S keep state group 300 #Usenet pass in quick on xl2 proto tcp from 192.168.2.0/24 to !192.168.1.1/32 port = 119 flags S keep state group 300 #allow ports 1025 and above to pass through to 192.168.2.2/32 (should alllow IRC, DCC receive and FTP access to servers not using port=21) pass in quick on xl2 proto tcp from 192.168.2.2/32 to !192.168.2.1/32 port 1024 >< 65535 flags S keep state group 300 #HTTP pass in quick on xl2 proto tcp from 192.168.2.0/24 to 127.0.0.1/32 port = 19980 flags S keep state group 300 pass in quick on xl2 proto tcp from 192.168.2.0/24 to !192.168.2.1/32 port = 443 flags S keep state group 300 #allow pings pass in quick on xl2 proto icmp from 192.168.2.0/24 to any icmp-type 8 keep state group 300 #delete later pass in quick on xl2 proto tcp from 192.168.2.0/24 to !192.168.2.1/32 port = 22 flags S keep state group 300 pass in quick on xl2 proto tcp from 192.168.2.0/24 to any port = 6301 flags S keep state group 300 pass in quick on xl2 proto tcp from 192.168.2.0/24 to any port = 1863 flags S keep state group 300 block in log first quick on xl2 all group 300 #allow access from internet to elayneT subnet block out quick on xl2 all head 350 #allow VNC to pass to 192.168.2.2/32 pass out quick on xl2 proto tcp from 192.168.2.1/32 to 192.168.2.2/32 port = 5901 flags S keep state group 350 #allow HTTP to pass to 192.168.2.0/24 pass out quick on xl2 proto tcp from 127.0.0.1/32 port = 19980 to 192.168.2.0/24 keep state group 350 #allow nynaeveAM to ping any PC within 192.168.2.0/24 pass out quick on xl2 proto icmp from 192.168.2.1/32 to 192.168.2.0/24 keep state group 350 block out log first quick on xl2 all group 350 #block any other packets that didn't match block in quick all block out quick all _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 08:05:01 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C143316A4B3 for ; Thu, 2 Oct 2003 08:05:01 -0700 (PDT) Received: from v6.hitachi.co.jp (galilei.v6.hitachi.co.jp [133.145.167.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DFEE43FEA for ; Thu, 2 Oct 2003 08:04:59 -0700 (PDT) (envelope-from suz@crl.hitachi.co.jp) Received: from s30.crl.hitachi.co.jp (galilei.v6.hitachi.co.jp [133.145.167.4]) by v6.hitachi.co.jp (8.12.9/8.11.6) with ESMTP id h92F65p3064237; Fri, 3 Oct 2003 00:06:14 +0900 (JST) (envelope-from suz@crl.hitachi.co.jp) Date: Thu, 02 Oct 2003 08:04:46 -0700 Message-ID: From: SUZUKI Shinsuke To: jrh@it.uc3m.es X-cite: xcite 1.33 In-Reply-To: <200309300942.40834.jrh@it.uc3m.es> References: <200309291859.09355.jrh@it.uc3m.es> <200309300927.18850.jrh@it.uc3m.es> <200309300942.40834.jrh@it.uc3m.es> User-Agent: User-Agent: Wanderlust/2.11.14 (Wonderwall) Emacs/21.3 Mule/5.0 (SAKAKI) Organization: Network Systems Research Dept., Central Research Laboratory, Hitachi, Ltd, Japan MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 15:05:01 -0000 Hello Juan, >>>>> On Tue, 30 Sep 2003 09:42:39 +0200 > Address of Router1: 2001:720:410:100b::3 > Address of Router2: 2001:800:40:2471::4 Please confirm connectivity from Router2 to Router1 by the following command. Router2% ping6 -S 2001:720:410:100b::3 2001:800:40:2471::4 If it does not work, it's no wonder that you cannot ping from PC to Router1 when the PC's default router is router2. The simplest fix for this problem is to assign 2001:720:410:40::/64 and 2001:800:40:2471::4/64 to both routers: Address of Router1: 2001:720:410:100b::3, 2001:800:40:2471::3 Address of Router2: 2001:720:410:100b::4, 2001:800:40:2471::4 If you cannot still ping from PC to Router1 although it works, please show me the routing tables of both routers. Thanks, ---- SUZUKI, Shinsuke @ Hitachi / KAME Project From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 08:12:27 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B615016A4B3 for ; Thu, 2 Oct 2003 08:12:27 -0700 (PDT) Received: from www.missl.cs.umd.edu (www.missl.cs.umd.edu [128.8.126.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id D238A44003 for ; Thu, 2 Oct 2003 08:12:26 -0700 (PDT) (envelope-from jtm@cs.umd.edu) Received: from www.missl.cs.umd.edu (localhost.missl.cs.umd.edu [127.0.0.1]) by www.missl.cs.umd.edu (8.12.9/8.12.3) with ESMTP id h92FIHK0022959 for ; Thu, 2 Oct 2003 11:18:17 -0400 (EDT) (envelope-from jtm@cs.umd.edu) Received: from localhost (jtm@localhost)h92FIHL6022956 for ; Thu, 2 Oct 2003 11:18:17 -0400 (EDT) X-Authentication-Warning: www.missl.cs.umd.edu: jtm owned process doing -bs Date: Thu, 2 Oct 2003 11:18:17 -0400 (EDT) From: Justin Ma X-X-Sender: jtm@www.missl.cs.umd.edu To: freebsd-net@freebsd.org Message-ID: <20031002111614.P22662-100000@www.missl.cs.umd.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: mobileIP documentation X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 15:12:27 -0000 Can anybody point me to documentation about setting up home/foreign agents for IPv4/IPv6 mobility on FreeBSD 5? Thanks, Justin From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 08:52:32 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E84016A4BF for ; Thu, 2 Oct 2003 08:52:32 -0700 (PDT) Received: from smtp.uc3m.es (smtp01.uc3m.es [163.117.136.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id D531A43FF3 for ; Thu, 2 Oct 2003 08:52:29 -0700 (PDT) (envelope-from jrh@it.uc3m.es) Received: from smtp01.uc3m.es (localhost [127.0.0.1]) by smtp.uc3m.es (Postfix) with ESMTP id AC7E643295; Thu, 2 Oct 2003 17:52:28 +0200 (CEST) Received: from cimborrio (cimborrio.it.uc3m.es [163.117.139.95]) by smtp01.uc3m.es (Postfix) with ESMTP id 6DA8599EB7; Thu, 2 Oct 2003 17:52:28 +0200 (CEST) From: Juan Rodriguez Hervella Organization: UC3M To: SUZUKI Shinsuke Date: Thu, 2 Oct 2003 17:52:28 +0200 User-Agent: KMail/1.5 References: <200309291859.09355.jrh@it.uc3m.es> <200309300942.40834.jrh@it.uc3m.es> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310021752.30192.jrh@it.uc3m.es> cc: freebsd-net@freebsd.org Subject: Re: IPv6 autoconfiguration on a multihomed site X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 15:52:32 -0000 On Thursday 02 October 2003 17:04, SUZUKI Shinsuke wrote: > Hello Juan, > > >>>>> On Tue, 30 Sep 2003 09:42:39 +0200 > > > > Address of Router1: 2001:720:410:100b::3 > > Address of Router2: 2001:800:40:2471::4 > > Please confirm connectivity from Router2 to Router1 by the following > command. > Router2% ping6 -S 2001:720:410:100b::3 2001:800:40:2471::4 Though I don't know how to select the source address on the ping command on the CISCO, I tell you that *doesn't* work (without -S). I've got a default route towards the upstream provider that this router is connected to, so if I sends packets to 2001:800:40:2471::4 those will be routed outside my site because this router doesn't belong to the 2001:800:40:2471::/64 network (it is the router that announces 2001:720:410:100b::/64). > > If it does not work, it's no wonder that you cannot ping from PC to > Router1 when the PC's default router is router2. The simplest fix for > this problem is to assign 2001:720:410:40::/64 and > 2001:800:40:2471::4/64 to both routers: > Address of Router1: 2001:720:410:100b::3, 2001:800:40:2471::3 > Address of Router2: 2001:720:410:100b::4, 2001:800:40:2471::4 > If I do that, then everything is fixed. (I suppose that the first time I send sth. to router1 from the host, it will be route, for example, to router2, which will realize that the packet belongs to the other router, making something like a triangular routing, at least the first time, because afterwards a redirect message should be sent, right ?) But I think this isn't the way the problem should be fixed, I mean, why a router which only announces one prefix has to be configured with the prefix of another router ? In this scenario, the hosts should behave in the same way as with only one prefix. For example, if there's only one prefix, the host doesn't send packets to the default router, it sends them directly on the link...I don't understand why the same thing can not be applied when there are *two or more* links... where's the limitation ? or do you think that this is the way things should be running ? (Windows XP SP1 behave alike, though this isn't a relief :) > If you cannot still ping from PC to Router1 although it works, please > show me the routing tables of both routers. > > Thanks, My *thanks* for you all, you're doing a great job! (I'm applying to visit Japan some day *lol*, just kidding... I've seen on the telly that there are earthquakes !!) > ---- > SUZUKI, Shinsuke @ Hitachi / KAME Project -- JFRH From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 14:30:26 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4416F16A4B3 for ; Thu, 2 Oct 2003 14:30:26 -0700 (PDT) Received: from mwinf0204.wanadoo.fr (smtp7.wanadoo.fr [193.252.22.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B7A543FEC for ; Thu, 2 Oct 2003 14:30:25 -0700 (PDT) (envelope-from vjardin@wanadoo.fr) Received: from mercure.vincentjardin.net (AVelizy-102-1-1-43.w193-253.abo.wanadoo.fr [193.253.255.43]) by mwinf0204.wanadoo.fr (SMTP Server) with ESMTP id E1FB1A000316 for ; Thu, 2 Oct 2003 23:30:23 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" From: Vincent Jardin To: net@freebsd.org Date: Thu, 2 Oct 2003 23:30:22 +0200 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200310022330.22875.vjardin@wanadoo.fr> Subject: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 21:30:26 -0000 Hi, I read the man of ng_ip_input and the source code. However I do not under= stand=20 what the use cases could be. Who is using it and what's for ? Thanks, Vincent From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 15:45:53 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CFCE16A4B3; Thu, 2 Oct 2003 15:45:53 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A2DE43FCB; Thu, 2 Oct 2003 15:45:52 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by comcast.net (sccrmhc11) with ESMTP id <20031002224551011006rnlae>; Thu, 2 Oct 2003 22:45:51 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA09573; Thu, 2 Oct 2003 15:45:49 -0700 (PDT) Date: Thu, 2 Oct 2003 15:45:47 -0700 (PDT) From: Julian Elischer To: Vincent Jardin In-Reply-To: <200310022330.22875.vjardin@wanadoo.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: brooks@freebsd.org cc: net@freebsd.org Subject: Re: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 22:45:53 -0000 I have no idea what it is used for.. similar effect can be made by using the ng_iface node, but I think that they didn't want a separate interface for each packet source.. I suggest we ask brooks..(cc'd). I could imagine it somehow connected with the 300 processor FreeBSD based cluster that he is working on at hos job (especially as it has their copyright). On Thu, 2 Oct 2003, Vincent Jardin wrote: > Hi, > > I read the man of ng_ip_input and the source code. However I do not understand > what the use cases could be. Who is using it and what's for ? > > Thanks, > Vincent > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 16:05:21 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACEEB16A4BF; Thu, 2 Oct 2003 16:05:21 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10C4943F85; Thu, 2 Oct 2003 16:05:20 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h92N58DH007900; Thu, 2 Oct 2003 16:05:08 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h92N58t9007899; Thu, 2 Oct 2003 16:05:08 -0700 Date: Thu, 2 Oct 2003 16:05:08 -0700 From: Brooks Davis To: Julian Elischer Message-ID: <20031002230508.GA4770@Odin.AC.HMC.Edu> References: <200310022330.22875.vjardin@wanadoo.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: net@freebsd.org cc: brooks@freebsd.org Subject: Re: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 23:05:21 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 02, 2003 at 03:45:47PM -0700, Julian Elischer wrote: > On Thu, 2 Oct 2003, Vincent Jardin wrote: >=20 > > I read the man of ng_ip_input and the source code. However I do not > > understand what the use cases could be. Who is using it and what's > > for ? > > I have no idea what it is used for.. similar effect can be made by > using the ng_iface node, but I think that they didn't want a separate > interface for each packet source.. > > I suggest we ask brooks..(cc'd). I could imagine it somehow connected > with the 300 processor FreeBSD based cluster that he is working on at > hos job (especially as it has their copyright). It was for a network emulator we were trying to build to allow us to run real, unmodified programs in an environment where each program was assumed to be an independent agent and the communication topology between agents changed in realtime. Each agent was to bind to the IP address of an IP-over-IP tunnel (gif on the FreeBSD end). We would then take the packets, mangle them slightly and send them off to the emulator (I think part of the goal was to let us use more or less off the shelf emulation gear in the middle without needing a workstation for each agent). When we got them back, we'd remanged them and stuff them back into the IP stack with ng_ip_input so it could decide which gif tunnel to send it back down. The emulation part of the project died when our funding for it dried up so we've not actually using this module for anything. -- Brooks -- Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/fK8iXY6L6fI4GtQRAjQNAJ4/3kNgnwhXTBt0tDbPKlr4Q+1L1wCgqV7a NB9dg/JksdICIqL8g2lkt/8= =JtWC -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT-- From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 16:09:57 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 08A3B16A4B3; Thu, 2 Oct 2003 16:09:57 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1907B43FB1; Thu, 2 Oct 2003 16:09:55 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by comcast.net (rwcrmhc11) with ESMTP id <2003100223095401300lp19fe>; Thu, 2 Oct 2003 23:09:54 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA09736; Thu, 2 Oct 2003 16:09:51 -0700 (PDT) Date: Thu, 2 Oct 2003 16:09:50 -0700 (PDT) From: Julian Elischer To: Brooks Davis In-Reply-To: <20031002230508.GA4770@Odin.AC.HMC.Edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: brooks@freebsd.org cc: net@freebsd.org Subject: Re: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 23:09:57 -0000 On Thu, 2 Oct 2003, Brooks Davis wrote: > On Thu, Oct 02, 2003 at 03:45:47PM -0700, Julian Elischer wrote: > > On Thu, 2 Oct 2003, Vincent Jardin wrote: > > > > > I read the man of ng_ip_input and the source code. However I do not > > > understand what the use cases could be. Who is using it and what's > > > for ? > > > > I have no idea what it is used for.. similar effect can be made by > > using the ng_iface node, but I think that they didn't want a separate > > interface for each packet source.. > > > > I suggest we ask brooks..(cc'd). I could imagine it somehow connected > > with the 300 processor FreeBSD based cluster that he is working on at > > hos job (especially as it has their copyright). > > It was for a network emulator we were trying to build to allow us to > run real, unmodified programs in an environment where each program > was assumed to be an independent agent and the communication topology > between agents changed in realtime. Each agent was to bind to the IP > address of an IP-over-IP tunnel (gif on the FreeBSD end). We would then > take the packets, mangle them slightly and send them off to the emulator > (I think part of the goal was to let us use more or less off the shelf > emulation gear in the middle without needing a workstation for each > agent). When we got them back, we'd remanged them and stuff them back > into the IP stack with ng_ip_input so it could decide which gif tunnel > to send it back down. The emulation part of the project died when our > funding for it dried up so we've not actually using this module for > anything. was there a reason to not use the ng_iface node? (packets enterred on the INET hook if an iface node will be injected into the ip stack) (from memory) > > -- Brooks > > -- > Any statement of the form "X is the one, true Y" is FALSE. > PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 > From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 16:17:43 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B6C4716A4B3 for ; Thu, 2 Oct 2003 16:17:43 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id F05FD43FB1 for ; Thu, 2 Oct 2003 16:17:42 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h92NHcDH010601; Thu, 2 Oct 2003 16:17:38 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h92NHcRA010600; Thu, 2 Oct 2003 16:17:38 -0700 Date: Thu, 2 Oct 2003 16:17:38 -0700 From: Brooks Davis To: Julian Elischer Message-ID: <20031002231738.GB4770@Odin.AC.HMC.Edu> References: <20031002230508.GA4770@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: net@freebsd.org Subject: Re: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 23:17:43 -0000 --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 02, 2003 at 04:09:50PM -0700, Julian Elischer wrote: >=20 >=20 > On Thu, 2 Oct 2003, Brooks Davis wrote: >=20 > > On Thu, Oct 02, 2003 at 03:45:47PM -0700, Julian Elischer wrote: > > > On Thu, 2 Oct 2003, Vincent Jardin wrote: > > >=20 > > > > I read the man of ng_ip_input and the source code. However I do not > > > > understand what the use cases could be. Who is using it and what's > > > > for ? > > > > > > I have no idea what it is used for.. similar effect can be made by > > > using the ng_iface node, but I think that they didn't want a separate > > > interface for each packet source.. > > > > > > I suggest we ask brooks..(cc'd). I could imagine it somehow connected > > > with the 300 processor FreeBSD based cluster that he is working on at > > > hos job (especially as it has their copyright). > >=20 > > It was for a network emulator we were trying to build to allow us to > > run real, unmodified programs in an environment where each program > > was assumed to be an independent agent and the communication topology > > between agents changed in realtime. Each agent was to bind to the IP > > address of an IP-over-IP tunnel (gif on the FreeBSD end). We would then > > take the packets, mangle them slightly and send them off to the emulator > > (I think part of the goal was to let us use more or less off the shelf > > emulation gear in the middle without needing a workstation for each > > agent). When we got them back, we'd remanged them and stuff them back > > into the IP stack with ng_ip_input so it could decide which gif tunnel > > to send it back down. The emulation part of the project died when our > > funding for it dried up so we've not actually using this module for > > anything. >=20 > was there a reason to not use the ng_iface node? > (packets enterred on the INET hook if an iface node will be injected > into the ip stack) (from memory) Probably not. I didn't know netgraph all that well at the time so it wouldn't suprise me if I reinvented a wheel or two. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/fLIQXY6L6fI4GtQRAiVcAJ4l7QdprW2PEXcev9LFGUBk8+oZjgCfbK9z cZD9bi3PFDvP+C7h3rslLXE= =SaAZ -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes-- From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 00:00:41 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0255016A4B3 for ; Fri, 3 Oct 2003 00:00:41 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A75643FFD for ; Fri, 3 Oct 2003 00:00:39 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 88387653D2 for ; Fri, 3 Oct 2003 08:00:38 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 91181-05-3 for ; Fri, 3 Oct 2003 08:00:37 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 233676538E for ; Fri, 3 Oct 2003 08:00:37 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 06BF831; Fri, 3 Oct 2003 08:00:31 +0100 (BST) Date: Fri, 3 Oct 2003 08:00:31 +0100 From: Bruce M Simpson To: freebsd-net@freebsd.org Message-ID: <20031003070031.GL5194@saboteur.dek.spc.org> Mail-Followup-To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Xm/fll+QQv+hsKip" Content-Disposition: inline Subject: rtsock.c: eliminate masking of gotos, don't abuse M_RTABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 07:00:41 -0000 --Xm/fll+QQv+hsKip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Here's a diff to eliminate the senderr() macro from rtsock.c. This macro is masking goto statements, which is incredibly bad style, and makes it difficult to follow the flow of control in the file. This diff also stops rtsock.c from abusing the M_RTABLE malloc define for routing socket messages, for the sake of being clearer. [I would have liked to keep these separate but I haven't setup a local branch yet.] The size of an rtmsg can vary, but should perhaps be constant -- there are bugs present, as exercised by some code I posted to this list, and to ru@ in private, just over a month or so ago which panics the kernel by passing in a dubiously-formatted PF_ROUTE message. Making rtmsg constant and no longer using the packed sockaddr format would make it a candiate for a zone allocator, and would help eliminate some redundancy between rtsock.c and ifconfig(8)/route(8) in the userland. Comments? BMS --Xm/fll+QQv+hsKip Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rtmsg-malloc.diff" Index: rtsock.c =================================================================== RCS file: /home/ncvs/src/sys/net/rtsock.c,v retrieving revision 1.89 diff -u -r1.89 rtsock.c --- rtsock.c 5 Mar 2003 19:24:22 -0000 1.89 +++ rtsock.c 3 Oct 2003 06:45:18 -0000 @@ -55,6 +55,14 @@ MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); +MALLOC_DEFINE(M_RTMSG, "rtmsg", "PF_ROUTE message data"); + +#define RTMSG_MALLOC(p, n) \ + ((p) = (struct rt_msghdr *) \ + malloc((unsigned long)(n), M_RTMSG, M_NOWAIT)) +#define RTMSG_FREE(p) \ + free((caddr_t)(p), M_RTMSG) + static struct sockaddr route_dst = { 2, PF_ROUTE, }; static struct sockaddr route_src = { 2, PF_ROUTE, }; static struct sockaddr sa_zero = { sizeof(sa_zero), AF_INET, }; @@ -280,7 +288,6 @@ struct ifnet *ifp = 0; struct ifaddr *ifa = 0; -#define senderr(e) { error = e; goto flush;} if (m == 0 || ((m->m_len < sizeof(long)) && (m = m_pullup(m, sizeof(long))) == 0)) return (ENOBUFS); @@ -290,37 +297,45 @@ if (len < sizeof(*rtm) || len != mtod(m, struct rt_msghdr *)->rtm_msglen) { dst = 0; - senderr(EINVAL); + error = EINVAL; + goto flush; } - R_Malloc(rtm, struct rt_msghdr *, len); + RTMSG_MALLOC(rtm, len); if (rtm == 0) { dst = 0; - senderr(ENOBUFS); + error = ENOBUFS; + goto flush; } m_copydata(m, 0, len, (caddr_t)rtm); if (rtm->rtm_version != RTM_VERSION) { dst = 0; - senderr(EPROTONOSUPPORT); + error = EPROTONOSUPPORT; + goto flush; } rtm->rtm_pid = curproc->p_pid; bzero(&info, sizeof(info)); info.rti_addrs = rtm->rtm_addrs; if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) { dst = 0; - senderr(EINVAL); + error = EINVAL; + goto flush; } info.rti_flags = rtm->rtm_flags; if (dst == 0 || (dst->sa_family >= AF_MAX) - || (gate != 0 && (gate->sa_family >= AF_MAX))) - senderr(EINVAL); + || (gate != 0 && (gate->sa_family >= AF_MAX))) { + error = EINVAL; + goto flush; + } if (genmask) { struct radix_node *t; t = rn_addmask((caddr_t)genmask, 0, 1); if (t && Bcmp((caddr_t *)genmask + 1, (caddr_t *)t->rn_key + 1, *(u_char *)t->rn_key - 1) == 0) genmask = (struct sockaddr *)(t->rn_key); - else - senderr(ENOBUFS); + else { + error = ENOBUFS; + goto flush; + } } /* @@ -328,13 +343,15 @@ * is the only operation the non-superuser is allowed. */ if (rtm->rtm_type != RTM_GET && (error = suser(curthread)) != 0) - senderr(error); + goto flush; switch (rtm->rtm_type) { case RTM_ADD: - if (gate == 0) - senderr(EINVAL); + if (gate == 0) { + error = EINVAL; + goto flush; + } error = rtrequest1(RTM_ADD, &info, &saved_nrt); if (error == 0 && saved_nrt) { rt_setmetrics(rtm->rtm_inits, @@ -359,15 +376,18 @@ case RTM_CHANGE: case RTM_LOCK: if ((rnh = rt_tables[dst->sa_family]) == 0) { - senderr(EAFNOSUPPORT); + error = EAFNOSUPPORT; + goto flush; } RADIX_NODE_HEAD_LOCK(rnh); rt = (struct rtentry *) rnh->rnh_lookup(dst, netmask, rnh); RADIX_NODE_HEAD_UNLOCK(rnh); if (rt != NULL) rt->rt_refcnt++; - else - senderr(ESRCH); + else { + error = ESRCH; + goto flush; + } switch(rtm->rtm_type) { @@ -394,11 +414,13 @@ (struct walkarg *)0); if (len > rtm->rtm_msglen) { struct rt_msghdr *new_rtm; - R_Malloc(new_rtm, struct rt_msghdr *, len); - if (new_rtm == 0) - senderr(ENOBUFS); + RTMSG_MALLOC(new_rtm, len); + if (new_rtm == 0) { + error = ENOBUFS; + goto flush; + } Bcopy(rtm, new_rtm, rtm->rtm_msglen); - Free(rtm); rtm = new_rtm; + RTMSG_FREE(rtm); rtm = new_rtm; } (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, (struct walkarg *)0); @@ -418,11 +440,11 @@ (ifaaddr != NULL && !sa_equal(ifaaddr, rt->rt_ifa->ifa_addr))) { if ((error = rt_getifa(&info)) != 0) - senderr(error); + goto flush; } if (gate != NULL && (error = rt_setgate(rt, rt_key(rt), gate)) != 0) - senderr(error); + goto flush; if ((ifa = info.rti_ifa) != NULL) { register struct ifaddr *oifa = rt->rt_ifa; if (oifa != ifa) { @@ -453,7 +475,7 @@ break; default: - senderr(EOPNOTSUPP); + error = EOPNOTSUPP; } flush: @@ -473,7 +495,7 @@ if ((so->so_options & SO_USELOOPBACK) == 0) { if (route_cb.any_count <= 1) { if (rtm) - Free(rtm); + RTMSG_FREE(rtm); m_freem(m); return (error); } @@ -487,7 +509,7 @@ m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - Free(rtm); + RTMSG_FREE(rtm); } if (rp) rp->rcb_proto.sp_family = 0; /* Avoid us */ --Xm/fll+QQv+hsKip-- From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 00:40:59 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EC2616A4B3 for ; Fri, 3 Oct 2003 00:40:59 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 2AD9243FF5 for ; Fri, 3 Oct 2003 00:40:58 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 11809 invoked from network); 3 Oct 2003 07:40:57 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 3 Oct 2003 07:40:57 -0000 X-pair-Authenticated: 209.68.2.70 Date: Fri, 3 Oct 2003 02:40:22 -0500 (CDT) From: Mike Silbersack To: Bruce M Simpson In-Reply-To: <20031003070031.GL5194@saboteur.dek.spc.org> Message-ID: <20031003023838.I16042@odysseus.silby.com> References: <20031003070031.GL5194@saboteur.dek.spc.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: rtsock.c: eliminate masking of gotos, don't abuse M_RTABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 07:40:59 -0000 On Fri, 3 Oct 2003, Bruce M Simpson wrote: > Comments? > > BMS I think that anything to clean up the routing table is a good idea... however, aren't there a few major non-committed patches to this area which are almost ready? (Sam's locking, someone else's moving cloned routes into a tcpstatcache, more?) You should probably check on the status of those projects first and make sure that you won't interfere with their integration. Mike "Silby" Silbersack From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 01:00:37 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C80CB16A4C1 for ; Fri, 3 Oct 2003 01:00:37 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5415F43FBD for ; Fri, 3 Oct 2003 01:00:16 -0700 (PDT) (envelope-from ru@sunbay.com) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h9380AZ4059095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Oct 2003 11:00:10 +0300 (EEST) (envelope-from ru@sunbay.com) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9p2/8.12.8/Submit) id h9380ACv059090; Fri, 3 Oct 2003 11:00:10 +0300 (EEST) (envelope-from ru) Date: Fri, 3 Oct 2003 11:00:10 +0300 From: Ruslan Ermilov To: Mike Silbersack Message-ID: <20031003080010.GF53479@sunbay.com> References: <20031003070031.GL5194@saboteur.dek.spc.org> <20031003023838.I16042@odysseus.silby.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l+goss899txtYvYf" Content-Disposition: inline In-Reply-To: <20031003023838.I16042@odysseus.silby.com> User-Agent: Mutt/1.5.4i cc: freebsd-net@freebsd.org Subject: Re: rtsock.c: eliminate masking of gotos, don't abuse M_RTABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 08:00:37 -0000 --l+goss899txtYvYf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 03, 2003 at 02:40:22AM -0500, Mike Silbersack wrote: >=20 > On Fri, 3 Oct 2003, Bruce M Simpson wrote: >=20 > > Comments? > > > > BMS >=20 > I think that anything to clean up the routing table is a good idea... > however, aren't there a few major non-committed patches to this area which > are almost ready? (Sam's locking, someone else's moving cloned routes > into a tcpstatcache, more?) You should probably check on the status of > those projects first and make sure that you won't interfere with their > integration. >=20 I think these uncommitted patches will mostly affect route.c, while this patch is for rtsock.c, the route(4) interface with the kernel, which is unlikely to change a lot. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --l+goss899txtYvYf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/fSyKUkv4P6juNwoRAiBIAJ9bhLY2Gw+ruy1RAA28uV5JvKA1bACgiw5H 5kimAAiWblCgmcEFxbItb7s= =dJIs -----END PGP SIGNATURE----- --l+goss899txtYvYf-- From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 01:16:57 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F25B916A4B3; Fri, 3 Oct 2003 01:16:56 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id C532A43FA3; Fri, 3 Oct 2003 01:16:54 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id E25CD653E6; Fri, 3 Oct 2003 09:16:53 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 91610-05-5; Fri, 3 Oct 2003 09:16:52 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 9D3936538E; Fri, 3 Oct 2003 09:16:52 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 9E64631; Fri, 3 Oct 2003 09:16:47 +0100 (BST) Date: Fri, 3 Oct 2003 09:16:47 +0100 From: Bruce M Simpson To: Ruslan Ermilov Message-ID: <20031003081647.GQ5194@saboteur.dek.spc.org> Mail-Followup-To: Ruslan Ermilov , Mike Silbersack , freebsd-net@freebsd.org References: <20031003070031.GL5194@saboteur.dek.spc.org> <20031003023838.I16042@odysseus.silby.com> <20031003080010.GF53479@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP5ln1Rcf9Bvi+ZW" Content-Disposition: inline In-Reply-To: <20031003080010.GF53479@sunbay.com> cc: freebsd-net@freebsd.org Subject: Re: rtsock.c: eliminate masking of gotos, don't abuse M_RTABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 08:16:57 -0000 --MP5ln1Rcf9Bvi+ZW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 03, 2003 at 11:00:10AM +0300, Ruslan Ermilov wrote: > I think these uncommitted patches will mostly affect route.c, while this > patch is for rtsock.c, the route(4) interface with the kernel, which is > unlikely to change a lot. Much-improved patch to cleanup rtsock.c at bde's prodding attached. I'm proposing doing another pass after this to clear up the bad condition checking style, parentheses, and whitespace. BMS --MP5ln1Rcf9Bvi+ZW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=1 Index: route.h =================================================================== RCS file: /home/ncvs/src/sys/net/route.h,v retrieving revision 1.47 diff -u -r1.47 route.h --- route.h 5 Mar 2003 19:24:22 -0000 1.47 +++ route.h 3 Oct 2003 08:09:36 -0000 @@ -262,6 +262,11 @@ }; #ifdef _KERNEL +MALLOC_DECLARE(M_RTMSG); + +#define RTMSG_MALLOC(p, n) (p) = malloc((n), M_RTMSG, M_NOWAIT) +#define RTMSG_FREE(p) free((p), M_RTMSG) + #define RTFREE(rt) \ do { \ if ((rt)->rt_refcnt <= 1) \ @@ -296,6 +301,9 @@ struct sockaddr *, struct sockaddr *, int, struct rtentry **); int rtrequest1(int, struct rt_addrinfo *, struct rtentry **); int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); +#else +#define RTMSG_MALLOC(p, n) (p) = malloc((u_long)(n)) +#define RTMSG_FREE(p) free((p)) #endif #endif Index: rtsock.c =================================================================== RCS file: /home/ncvs/src/sys/net/rtsock.c,v retrieving revision 1.89 diff -u -r1.89 rtsock.c --- rtsock.c 5 Mar 2003 19:24:22 -0000 1.89 +++ rtsock.c 3 Oct 2003 08:11:06 -0000 @@ -280,7 +280,6 @@ struct ifnet *ifp = 0; struct ifaddr *ifa = 0; -#define senderr(e) { error = e; goto flush;} if (m == 0 || ((m->m_len < sizeof(long)) && (m = m_pullup(m, sizeof(long))) == 0)) return (ENOBUFS); @@ -290,37 +289,45 @@ if (len < sizeof(*rtm) || len != mtod(m, struct rt_msghdr *)->rtm_msglen) { dst = 0; - senderr(EINVAL); + error = EINVAL; + goto flush; } - R_Malloc(rtm, struct rt_msghdr *, len); + RTMSG_MALLOC(rtm, len); if (rtm == 0) { dst = 0; - senderr(ENOBUFS); + error = ENOBUFS; + goto flush; } m_copydata(m, 0, len, (caddr_t)rtm); if (rtm->rtm_version != RTM_VERSION) { dst = 0; - senderr(EPROTONOSUPPORT); + error = EPROTONOSUPPORT; + goto flush; } rtm->rtm_pid = curproc->p_pid; bzero(&info, sizeof(info)); info.rti_addrs = rtm->rtm_addrs; if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) { dst = 0; - senderr(EINVAL); + error = EINVAL; + goto flush; } info.rti_flags = rtm->rtm_flags; if (dst == 0 || (dst->sa_family >= AF_MAX) - || (gate != 0 && (gate->sa_family >= AF_MAX))) - senderr(EINVAL); + || (gate != 0 && (gate->sa_family >= AF_MAX))) { + error = EINVAL; + goto flush; + } if (genmask) { struct radix_node *t; t = rn_addmask((caddr_t)genmask, 0, 1); if (t && Bcmp((caddr_t *)genmask + 1, (caddr_t *)t->rn_key + 1, *(u_char *)t->rn_key - 1) == 0) genmask = (struct sockaddr *)(t->rn_key); - else - senderr(ENOBUFS); + else { + error = ENOBUFS; + goto flush; + } } /* @@ -328,13 +335,15 @@ * is the only operation the non-superuser is allowed. */ if (rtm->rtm_type != RTM_GET && (error = suser(curthread)) != 0) - senderr(error); + goto flush; switch (rtm->rtm_type) { case RTM_ADD: - if (gate == 0) - senderr(EINVAL); + if (gate == 0) { + error = EINVAL; + goto flush; + } error = rtrequest1(RTM_ADD, &info, &saved_nrt); if (error == 0 && saved_nrt) { rt_setmetrics(rtm->rtm_inits, @@ -359,15 +368,18 @@ case RTM_CHANGE: case RTM_LOCK: if ((rnh = rt_tables[dst->sa_family]) == 0) { - senderr(EAFNOSUPPORT); + error = EAFNOSUPPORT; + goto flush; } RADIX_NODE_HEAD_LOCK(rnh); rt = (struct rtentry *) rnh->rnh_lookup(dst, netmask, rnh); RADIX_NODE_HEAD_UNLOCK(rnh); if (rt != NULL) rt->rt_refcnt++; - else - senderr(ESRCH); + else { + error = ESRCH; + goto flush; + } switch(rtm->rtm_type) { @@ -394,11 +406,13 @@ (struct walkarg *)0); if (len > rtm->rtm_msglen) { struct rt_msghdr *new_rtm; - R_Malloc(new_rtm, struct rt_msghdr *, len); - if (new_rtm == 0) - senderr(ENOBUFS); + RTMSG_MALLOC(new_rtm, len); + if (new_rtm == 0) { + error = ENOBUFS; + goto flush; + } Bcopy(rtm, new_rtm, rtm->rtm_msglen); - Free(rtm); rtm = new_rtm; + RTMSG_FREE(rtm); rtm = new_rtm; } (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, (struct walkarg *)0); @@ -418,11 +432,11 @@ (ifaaddr != NULL && !sa_equal(ifaaddr, rt->rt_ifa->ifa_addr))) { if ((error = rt_getifa(&info)) != 0) - senderr(error); + goto flush; } if (gate != NULL && (error = rt_setgate(rt, rt_key(rt), gate)) != 0) - senderr(error); + goto flush; if ((ifa = info.rti_ifa) != NULL) { register struct ifaddr *oifa = rt->rt_ifa; if (oifa != ifa) { @@ -453,7 +467,7 @@ break; default: - senderr(EOPNOTSUPP); + error = EOPNOTSUPP; } flush: @@ -473,7 +487,7 @@ if ((so->so_options & SO_USELOOPBACK) == 0) { if (route_cb.any_count <= 1) { if (rtm) - Free(rtm); + RTMSG_FREE(rtm); m_freem(m); return (error); } @@ -487,7 +501,7 @@ m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - Free(rtm); + RTMSG_FREE(rtm); } if (rp) rp->rcb_proto.sp_family = 0; /* Avoid us */ --MP5ln1Rcf9Bvi+ZW-- From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 02:58:08 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAD9C16A4BF for ; Fri, 3 Oct 2003 02:58:08 -0700 (PDT) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53E0C43FBF for ; Fri, 3 Oct 2003 02:58:06 -0700 (PDT) (envelope-from oppermann@pipeline.ch) Received: (qmail 23607 invoked from network); 3 Oct 2003 09:59:55 -0000 Received: from unknown (HELO pipeline.ch) ([62.48.0.53]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 3 Oct 2003 09:59:55 -0000 Message-ID: <3F7D47D9.DD4E7655@pipeline.ch> Date: Fri, 03 Oct 2003 11:56:41 +0200 From: Andre Oppermann X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Mike Silbersack References: <20031003070031.GL5194@saboteur.dek.spc.org> <20031003023838.I16042@odysseus.silby.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: mbp@freebsd.org cc: freebsd-net@freebsd.org Subject: Re: rtsock.c: eliminate masking of gotos, don't abuse M_RTABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 09:58:08 -0000 Mike Silbersack wrote: > > On Fri, 3 Oct 2003, Bruce M Simpson wrote: > > > Comments? > > > > BMS > > I think that anything to clean up the routing table is a good idea... > however, aren't there a few major non-committed patches to this area which > are almost ready? (Sam's locking, someone else's moving cloned routes > into a tcpstatcache, more?) You should probably check on the status of > those projects first and make sure that you won't interfere with their > integration. This rtsock.c patch does not interfere with the tcp_hostcache work I'm doing at the moment. I've got stuck a little bit in the tcp6 stuff in tcp. The past weeks were quite busy for me but this weekend I've got time to carry the tcp_hostcache (and nuking of PR_CLONING) forward. -- Andre From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 06:28:12 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3A0D16A4B3 for ; Fri, 3 Oct 2003 06:28:12 -0700 (PDT) Received: from vbook.fbsd.ru (asplinux.ru [195.133.213.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14AEF43F75 for ; Fri, 3 Oct 2003 06:28:11 -0700 (PDT) (envelope-from vova@vbook.fbsd.ru) Received: from vova by vbook.fbsd.ru with local (Exim 4.24; FreeBSD 5.1) id 1A5Pz5-000Bvu-Ge; Fri, 03 Oct 2003 17:28:39 +0400 From: "Vladimir B. Grebenschikov" To: Julian Elischer In-Reply-To: References: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: SWsoft Inc. Message-Id: <1065187709.952.38.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 03 Oct 2003 17:28:37 +0400 Sender: Vladimir Grebenschikov cc: net@freebsd.org Subject: Re: ng_ip_input use case X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 13:28:12 -0000 =F7 =D0=D4, 03.10.2003, =D7 03:09, Julian Elischer =D0=C9=DB=C5=D4: > > > I have no idea what it is used for.. similar effect can be made by > > > using the ng_iface node, but I think that they didn't want a separate > > > interface for each packet source.. > > > > > > I suggest we ask brooks..(cc'd). I could imagine it somehow connecte= d > > > with the 300 processor FreeBSD based cluster that he is working on at > > > hos job (especially as it has their copyright). > >=20 > > It was for a network emulator we were trying to build to allow us to > > run real, unmodified programs in an environment where each program > > was assumed to be an independent agent and the communication topology > > between agents changed in realtime. Each agent was to bind to the IP > > address of an IP-over-IP tunnel (gif on the FreeBSD end). We would the= n > > take the packets, mangle them slightly and send them off to the emulato= r > > (I think part of the goal was to let us use more or less off the shelf > > emulation gear in the middle without needing a workstation for each > > agent). When we got them back, we'd remanged them and stuff them back > > into the IP stack with ng_ip_input so it could decide which gif tunnel > > to send it back down. The emulation part of the project died when our > > funding for it dried up so we've not actually using this module for > > anything. >=20 > was there a reason to not use the ng_iface node? > (packets enterred on the INET hook if an iface node will be injected > into the ip stack) (from memory) ng_iface does much more then ability to inject packets into IP-stack, as minimum it creates interface, on hosts with dynamic routing software you should start care about this (unused !) interface, If you have number of ng_iface-s used for some real task and some interfaces used only as ip_input gateway you can completely mix them all in mind. I do not think that it is good idea to create one more interface only to inject packets into IP-stack. PS:=20 Anyway, I can suggest one another way to do this task: use ng_ksocket with socket type divert and ipfw divert rule. But this way have disadvantage: packet can easy enter to infinite loop. So use with care. > > -- Brooks --=20 Vladimir B. Grebenschikov SWsoft Inc. From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 18:50:22 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FCF916A4BF for ; Fri, 3 Oct 2003 18:50:22 -0700 (PDT) Received: from smtp.noos.fr (nan-smtp-09.noos.net [212.198.2.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B5B343FCB for ; Fri, 3 Oct 2003 18:50:20 -0700 (PDT) (envelope-from root@noos.fr) Received: (qmail 1409845 invoked by uid 0); 4 Oct 2003 01:46:14 -0000 Received: (qmail 226322 invoked by uid 0); 30 Sep 2003 22:26:53 -0000 Received: from unknown (HELO mx2.freebsd.org) ([216.136.204.119]) (envelope-sender ) by 212.198.2.80 (qmail-ldap-1.03) with SMTP for ; 30 Sep 2003 22:26:53 -0000 Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 2DF8357215; Tue, 30 Sep 2003 10:58:49 -0700 (PDT) (envelope-from owner-freebsd-arch@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 86A3516A4E9; Tue, 30 Sep 2003 10:58:47 -0700 (PDT) Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6279C16A4B3; Tue, 30 Sep 2003 10:56:46 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C0F944011; Tue, 30 Sep 2003 10:56:45 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h8UHufOP013248; Tue, 30 Sep 2003 19:56:42 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Brooks Davis From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Sep 2003 10:15:36 PDT." <20030930171535.GA31908@Odin.AC.HMC.Edu> Date: Tue, 30 Sep 2003 19:56:41 +0200 Message-ID: <13247.1064944601@critter.freebsd.dk> X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-arch@freebsd.org Errors-To: owner-freebsd-arch@freebsd.org cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-net@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 01:50:22 -0000 In message <20030930171535.GA31908@Odin.AC.HMC.Edu>, Brooks Davis writes: >> Somebody please explain how this would work for non-hardware >> interfaces like if_loop, if_tun, if_tap etc ? > >if_dev would be NULL when a device_t was not available. Code which used >this feature would be required to either check that if_dev was non-NULL >before trying to use it or have special knowldege that it only gets >called with struct ifnet instances which have a non-NULL if_dev member. >For instance, driver routines which take a struct ifnet would know that >they are only called on their own ifnet so they could assume they had >filled it in. So you'd still have to keep the if_name + if_unit around for the drivers which do not have a device_t ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Fri Oct 3 18:55:34 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2603B16A4B3 for ; Fri, 3 Oct 2003 18:55:34 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DF1544005 for ; Fri, 3 Oct 2003 18:55:30 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id BF5F3654B7; Sat, 4 Oct 2003 02:55:28 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01900-01-2; Sat, 4 Oct 2003 02:55:28 +0100 (BST) Received: from saboteur.dek.spc.org (lardystuffer.demon.co.uk [212.228.40.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 46FF4654A1; Sat, 4 Oct 2003 02:55:14 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 436E41F; Sat, 4 Oct 2003 02:55:10 +0100 (BST) Date: Sat, 4 Oct 2003 02:55:10 +0100 From: Bruce M Simpson To: Harti Brandt Message-ID: <20031004015510.GC658@saboteur.dek.spc.org> References: <5.2.1.1.2.20030615064011.02e39eb8@194.184.65.4> <20031001181759.GA65157@pit.databus.com> <20031001182507.GA24453@saboteur.dek.spc.org> <20031002095224.L11328@beagle.fokus.fraunhofer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031002095224.L11328@beagle.fokus.fraunhofer.de> cc: Barney Wolff cc: esperti@gufi.org cc: net@freebsd.org Subject: Re: ADSL PPoA or RFC1483, any solutions ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 01:55:34 -0000 On Thu, Oct 02, 2003 at 09:53:08AM +0200, Harti Brandt wrote: > Does PPPoA really need signalling? I tried to find any pointers to PPPoA > specification, but this seems to be not easy to find. I was probably half asleep when I wrote that answer :) it's been a stressful week. I should correct myself - more often than not ISPs just use PVCs. The userland PPP could probably be run on top of a device node exporting the PVC. I prefer the idea of in-kernel ppp, though, for 1Mbps+ xDSL use. BMS From owner-freebsd-net@FreeBSD.ORG Sat Oct 4 09:51:04 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2C1016A4B3 for ; Sat, 4 Oct 2003 09:51:04 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 7BD3644005 for ; Sat, 4 Oct 2003 09:51:03 -0700 (PDT) (envelope-from adam.mclaurin@gmx.net) Received: (qmail 28496 invoked by uid 65534); 4 Oct 2003 16:51:02 -0000 Received: from dsl-cust-145.openweb.ca (EHLO jake) (64.39.186.145) by mail.gmx.net (mp012) with SMTP; 04 Oct 2003 18:51:02 +0200 X-Authenticated: #19934200 Date: Sat, 4 Oct 2003 12:50:54 -0400 From: Adam McLaurin To: net@freebsd.org Message-Id: <20031004125054.68487767.adam.mclaurin@gmx.net> Organization: X-Mailer: Sylpheed version 0.9.5-gtk2-20030906 (GTK+ 2.2.4; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="=.?YIUnT_dQ:ITTf" Subject: Active-mode FTP routing question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 16:51:04 -0000 --=.?YIUnT_dQ:ITTf Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Let me start off by mentioning that I do understand the FTP protocol quite well, so we can keep replies focused on firewall/routing issues, instead of re-explaining how FTP works. Second, for my software: My firewall/router is running on FreeBSD 5.1-RELEASE-p8 with ipfilter/ipnat. Here's the problem. One of the FTP servers that I visit frequently does not run on port 21. As such, I cannot use 'proxy port ftp' in ipnat to punch a hole for the returning active mode data connection (at least, I don't see any way to use it). I have two machines running behind my router, one running Windows 2000 with FlashFXP, the other FreeBSD 5.1-R with lftp. Now, lftp has an option 'ftp:port-range' to restrict the active mode ports to a specific range. However, NAT seems to translate this port, because the PORT command received by the server is NOT within the specified range. Of course, if the remote FTP admin had passive mode working, this wouldn't be any issue. However, I've been fighting with the guy for about 2 months, and he simply won't do it. So, the question is, how do I set up my ipfilter/ipnat to allow NAT'd clients to access FTP's (not on port 21) with active mode? Is it possible? I don't see any way, but maybe I'm not understanding everything here. Please CC your reply to me (adam.mclaurin@gmx.net), as I am not subscribed to this list. Thanks, Adam McLaurin --=.?YIUnT_dQ:ITTf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/fvput+DSc2Q4lGYRAsGSAKCdIRgyIFiOsGiycztSbV3uyDaOVACffxwP h0W639ESU0knl5iCJjxFG/k= =VFeM -----END PGP SIGNATURE----- --=.?YIUnT_dQ:ITTf-- From owner-freebsd-net@FreeBSD.ORG Sat Oct 4 16:10:17 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15EC516A4B3 for ; Sat, 4 Oct 2003 16:10:17 -0700 (PDT) Received: from jchurch.neville-neil.com (jchurch.neville-neil.com [209.157.133.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FC9E43FD7 for ; Sat, 4 Oct 2003 16:10:16 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from jchurch.neville-neil.com.neville-neil.com (localhost [127.0.0.1])h94NAFTC040488 for ; Sat, 4 Oct 2003 16:10:15 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Sat, 04 Oct 2003 16:10:15 -0700 Message-ID: <87u16o8uqw.wl@jchurch.neville-neil.com.neville-neil.com> From: "George V. Neville-Neil" To: freebsd-net@freebsd.org User-Agent: Wanderlust/2.10.0 (Venus) SEMI/1.14.4 (Hosorogi) FLIM/1.14.4 (=?ISO-8859-4?Q?Kashiharajing=FE-mae?=) APEL/10.4 Emacs/21.2 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Subject: Another question on netisr processing. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 23:10:17 -0000 So I did find the default setting for netisr to defer processing to swi_net but this brings up another question. Are all the locks in the network stacks of a type that could be used correctly at interrupt conext if we wished to do that? Thanks, George From owner-freebsd-net@FreeBSD.ORG Sat Oct 4 16:35:41 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD38716A4B3 for ; Sat, 4 Oct 2003 16:35:41 -0700 (PDT) Received: from phalanx.trit.org (phalanx.trit.org [63.198.170.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1C2043FF9 for ; Sat, 4 Oct 2003 16:35:40 -0700 (PDT) (envelope-from dima@trit.org) Received: by phalanx.trit.org (Postfix, from userid 406) id 8D59E1A0FF; Sat, 4 Oct 2003 23:35:40 +0000 (UTC) Received: from sparkie.trit.org (sparkie.trit.org [192.168.4.16]) by phalanx.trit.org (Postfix) with ESMTP id E113719FBB; Sat, 4 Oct 2003 23:35:37 +0000 (UTC) Received: (from dima@localhost) by sparkie.trit.org (8.10.2+Sun/8.10.2) id h94NZb308589; Sat, 4 Oct 2003 23:35:37 GMT X-Authentication-Warning: sparkie.trit.org: dima set sender to dima@trit.org using -f Date: Sat, 4 Oct 2003 23:35:37 +0000 From: Dima Dorfman To: Adam McLaurin Message-ID: <20031004233536.GH8410@trit.org> References: <20031004125054.68487767.adam.mclaurin@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031004125054.68487767.adam.mclaurin@gmx.net> User-Agent: Mutt/1.4i X-Spam-Status: No, hits=-9.2 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT,X_AUTH_WARNING autolearn=ham version=2.54 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.54 (1.174.2.17-2003-05-11-exp) cc: net@freebsd.org Subject: Re: Active-mode FTP routing question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2003 23:35:41 -0000 Adam McLaurin wrote: > Let me start off by mentioning that I do understand the FTP protocol quite well, > so we can keep replies focused on firewall/routing issues, instead of > re-explaining how FTP works. > > Second, for my software: My firewall/router is running on FreeBSD > 5.1-RELEASE-p8 with ipfilter/ipnat. > > Here's the problem. One of the FTP servers that I visit frequently does not > run on port 21. As such, I cannot use 'proxy port ftp' in ipnat to punch a hole > for the returning active mode data connection (at least, I don't see any way > to use it). I have this in my ipnat.rules: map fxp0 63.198.170.138/32 -> 0.0.0.0/32 proxy port ftp ftp/tcp and I believe that the first "ftp" is the port number to translate, and the latter "ftp/tcp" is what protocol to expect (but I can't confirm this because ipnat(5) doesn't document the proxy modifier). E.g., this line loads just fine: map fxp0 63.198.170.138/32 -> 0.0.0.0/32 proxy port 12345 ftp/tcp but I can't test it because I don't know any FTP servers on non-standard ports. I'm not exactly sure that this will do what you want, but it might be worth a try. Hope this helps, Dima.