TAP (/dev/tap0) interface payload not delivered to user space

ragu foss ragu.foss at gmail.com
Thu Mar 10 14:05:16 UTC 2016

Hi All,

I am studying how tun/tap interface works in FreeBSD.
I wrote an application where I am trying to receive packets in user
space through tap interface.
For this, I open the tap device (/dev/tap0) and read from it.

I am configuring the tap interface with the following configurations
ifconfig tap0 create
ifconfig tap0 inet

Then I ping the ip "ping".  The problem is, I am
receiving only the header of the packet.
I am reading only 42 (Ethernet header (14) + IP header (20) + ICMP (8)
) bytes always. Whatever be the value of the ping payload size (ping
-s 100,
I am reading the same 42 bytes in the application.

Is this is expected behaviour? If yes, what should I do to receive the
whole packet?


More information about the freebsd-questions mailing list