Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2008 21:29:35 +0400
From:      Tofig Suleymanov <tofig@freebsd.az>
To:        Max Laier <max@love2party.net>
Cc:        hackers@freebsd.org
Subject:   Re: if_start() and sending packets problem
Message-ID:  <47B71D7F.9070804@freebsd.az>
In-Reply-To: <35810.192.168.4.151.1203169657.squirrel@router.laiers.local>
References:  <342414370802160011s7fc3edc2w5feb45ce788930c5@mail.gmail.com> <35810.192.168.4.151.1203169657.squirrel@router.laiers.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Max Laier wrote:
> 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<UP,BROADCAST,RUNNING,NOARP,SIMPLEX,NEEDSGIANT> 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.
>   
Good catch !

I've added a static arp entry as advised and now I am getting into 
ib_start() and ib_encap() successfully !


Kind regards,
Tofig.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47B71D7F.9070804>