From owner-freebsd-questions@freebsd.org Thu Mar 10 14:05:16 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BB7ACB3F6 for ; Thu, 10 Mar 2016 14:05:16 +0000 (UTC) (envelope-from ragu.foss@gmail.com) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A488F47 for ; Thu, 10 Mar 2016 14:05:16 +0000 (UTC) (envelope-from ragu.foss@gmail.com) Received: by mail-ob0-x22c.google.com with SMTP id fz5so81498546obc.0 for ; Thu, 10 Mar 2016 06:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=VTFVdVM/y3VPRtqeU54sfqyGY6BehKbrPjAI3jJg1mo=; b=KcEPBRiM30frhHGKBj4OV2AQ3mxdD8DjV3lLjk/YVYQbhsJ03NbYzcPn72L7P0VPCg JnTaE+0DbwiyX16BtirGVvHNuG9HaeF8f6IVc2Phfwk0ZL8zv1BgcX7gyCBDh+Bre9mz +8wlatEskwJFcyDfgR7MxTHvjfQYPXxt5tNxMymvCtj2TEx2ytxgG1ZwmBRPApEKQf6g Oy/KF+GKkrJy3QrIvYAeAECWsf+SDxmRIJybXpMUkJHYjkjyDx+f6AIFAD6wZTni3TTs +MQ9lzmJfymOly0suT7XxsKAk5rqZebWPL5ctxYRrae9yaQeBULzgwN/MVIzKFzZVkgW 9CyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=VTFVdVM/y3VPRtqeU54sfqyGY6BehKbrPjAI3jJg1mo=; b=bhgmWefZVdYuflR6fdFDrCgq5EF3O2JKO5cJv7oSBBXO8X47jGxA/1OH3I624I4q6H ezwVzJWBb+t7ut2x13YIMl2dwJUbzhR6iJ3mzkZbBqYQegR2Z/YtHnvkUIVBPANsOC2A ggHNq0XrFzQP1jX6Tf5lYIAi0F06+neAXeUnxSd5u414mJYrPGBlgqx6+6+3q9D9jaj3 r32IMZTyz25v4FvcnTZtxaJF1feefN9YyjjTN9IYOAIE8LDSSiOYp93WQ9Mf/8nsA7yG UW6O5rTo6uG3Qhak18XtZy5pJuenAkYTWW0IOh10v16t3myYRGXV/j08ZUjl9xAb1/9m tc7Q== X-Gm-Message-State: AD7BkJJ3mpJi+wBrPeCvrHfXaPoygcKkh5qYO2jC5ejwLUVJKZMwL4QJ7DmasJXV5IZQmhAGLOV5nzAvhMjmMA== MIME-Version: 1.0 X-Received: by 10.60.17.135 with SMTP id o7mr2142722oed.25.1457618715698; Thu, 10 Mar 2016 06:05:15 -0800 (PST) Received: by 10.202.195.6 with HTTP; Thu, 10 Mar 2016 06:05:15 -0800 (PST) Date: Thu, 10 Mar 2016 19:35:15 +0530 Message-ID: Subject: TAP (/dev/tap0) interface payload not delivered to user space From: ragu foss To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2016 14:05:16 -0000 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 192.168.1.32/24 Then I ping the ip "ping 192.168.1.45". 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 192.168.1.45), 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? Thanks, Ragunath