From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 16 14:00:29 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40D3B16A417 for ; Sat, 16 Feb 2008 14:00:29 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by mx1.freebsd.org (Postfix) with ESMTP id D5B1F13C459 for ; Sat, 16 Feb 2008 14:00:28 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-038-022.pools.arcor-ip.net [88.66.38.22]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1JQNOT0F9u-0006df; Sat, 16 Feb 2008 14:47:53 +0100 Received: (qmail 82134 invoked by uid 80); 16 Feb 2008 13:47:37 -0000 Received: from 192.168.4.151 (SquirrelMail authenticated user mlaier) by router.laiers.local with HTTP; Sat, 16 Feb 2008 14:47:37 +0100 (CET) Message-ID: <35810.192.168.4.151.1203169657.squirrel@router.laiers.local> In-Reply-To: <342414370802160011s7fc3edc2w5feb45ce788930c5@mail.gmail.com> References: <342414370802160011s7fc3edc2w5feb45ce788930c5@mail.gmail.com> Date: Sat, 16 Feb 2008 14:47:37 +0100 (CET) From: "Max Laier" To: "Tofig Suleymanov" User-Agent: SquirrelMail/1.4.13 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Provags-ID: V01U2FsdGVkX19402r/inK8UBDdVcC4ENlk4xIcpgi6bP1lUnG E0A3mKqJT+0xxuqGHkouzsv/1hmweimTP8ImcsSlqPc7pqL+pN 963z7ph4aBF19/FqVUgnA== Cc: hackers@freebsd.org Subject: Re: if_start() and sending packets problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Feb 2008 14:00:29 -0000 Am Sa, 16.02.2008, 09:11, schrieb Tofig Suleymanov: > Hello hackers, > > I will be grateful if someone could point me to the right direction > regarding the question below. > > My device driver is getting incoming packets fine, but for some reason I > am not able to send a single packet. Here is the source code: > > http://www.freebsd.az/if_ib.c > > I've added several debug messages to the source and here is the output: > > (bringing interface up and assigning the ip/netmask combination) > > ifconfig ib0 192.168.0.6 netmask 255.255.255.0 up > > (At this moment I get this in my /var/log/messages. It seems to be a > gratuitous arp who-has packet ) > > Feb 7 19:14:32 schizo kernel: ib_init entered > Feb 7 19:14:32 schizo kernel: ib_start entered > Feb 7 19:14:32 schizo kernel: ib_encap entered > Feb 7 19:14:32 schizo kernel: DHOST ff ff ff ff ff ff > Feb 7 19:14:32 schizo kernel: SHOST 0 c0 ee 22 3 14 > Feb 7 19:14:32 schizo kernel: txeof entered > Feb 7 19:14:32 schizo kernel: txeof exiting > > (now I try pinging, but no joy . I've added extra debug messages inside > ping.c) > > schizo# ping 192.168.0.1 > PING 192.168.0.1 (192.168.0.1): 56 data bytes > packets sent: -1 > ping: sendto: Invalid argument > packets sent: -1 > ping: sendto: Invalid argument > packets sent: -1 > ping: sendto: Invalid argument > ^C > --- 192.168.0.1 ping statistics --- > 3 packets transmitted, 0 packets received, 100% packet loss > > > I have also tried to add debug messages to sys/net/if.c and > sys/net/netisr.c and it seems that the kernel doesn't even try to run my > ib_start() function. > > Doing tcpdump on the interface and pinging does not show any packets > flowing. Please note that tcpdump shows the arp who-has request right > after I assign the ip address. > > ifconfig ib0 gives the following: > ib0: flags=1008c3 mtu 1500 Why do you set NOARP? It seems that your ping can't figure out the ARP address of 192.168.0.1 and hence returns early. Either install a static arp entry for 192.168.0.1 or lose the NOARP. > inet 192.168.0.5 netmask 0xffffff00 broadcast 192.168.0.255 > ether 00:c0:ee:22:03:14 > media: Ethernet 10baseT/UTP > status: active > > netstat -in gives the following output: > Name Mtu Network Address Ipkts Ierrs Opkts Oerrs > Coll > bge0* 1500 00:16:41:52:fb:1e 0 0 0 0 > 0 > iwi0 1500 00:13:ce:cc:b8:10 3065 0 2856 0 > 0 > iwi0 1500 192.168.1 192.168.1.5 3034 - 2825 - > - > lo0 16384 8 0 8 0 > 0 > lo0 16384 127 127.0.0.1 8 - 8 - > - > ib0 1500 00:c0:ee:22:03:14 4 0 2 0 > 0 > ib0 1500 192.168.0 192.168.0.5 0 - 3 - > - > > Any ideas are highly appreciated. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News