From owner-freebsd-net@FreeBSD.ORG Tue Feb 19 07:45:19 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8392C99 for ; Tue, 19 Feb 2013 07:45:19 +0000 (UTC) (envelope-from fernando@gont.com.ar) Received: from web01.jbserver.net (web01.jbserver.net [93.186.182.34]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF7B1D1 for ; Tue, 19 Feb 2013 07:45:18 +0000 (UTC) Received: from [186.134.32.92] (helo=[192.168.123.126]) by web01.jbserver.net with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1U7hsd-0007QH-Vy; Tue, 19 Feb 2013 08:44:48 +0100 Message-ID: <51232D67.8040100@gont.com.ar> Date: Tue, 19 Feb 2013 04:44:39 -0300 From: Fernando Gont User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: FreeBSD Net Subject: pcap DLT_NULL encapsulation X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Feb 2013 07:45:19 -0000 Folks, I've working on a libpcap-based program that sends packets over a gogoc-created tunnel. The gogoc-created interface is of type DLT_NULL. My understanding is that packets sent/received on such interface type include a 4-byte header that includes the address family as a 32-bit integer, in host byte order. Packets sent with tools such as ping6, get the corresponding header set to 0x1c (PF_INET6). However, packets sent with pcap_inject() get such header set to 0x1f, even when I explicitly set it to PF_INET6 (0x1c). >From a practical point of view, everything works ok (i.e., my packets *are* successfully sent over the tunnel). However, when sniffing traffic on my local host, I get a "AF unknown (31)", as in: --- cut here ---- 04:31:09.377625 AF Unknown (31), length 108: 0x0000: 6000 0000 0040 3aff 2001 05c0 1000 000a `....@:......... 0x0010: 0000 0000 0000 152d 2001 05c0 1000 000a .......-........ 0x0020: 0000 0000 0000 0108 8000 d368 667c 0000 ...........hf|.. ---- cut here ---- it looks like no matter what I write in that header, the contents never change when the packet hit the interface (i.e., once pcap_inject() is called, it seems those bytes are being rewritten). Is this a known issue with gogoc? Am I missing something else? Thanks! Best regards, -- Fernando Gont e-mail: fernando@gont.com.ar || fgont@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1