From owner-freebsd-net@FreeBSD.ORG Mon Dec 9 09:31:04 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01E7D7A4 for ; Mon, 9 Dec 2013 09:31:04 +0000 (UTC) Received: from mail.euro-comm.net (mail.euro-comm.net [194.190.78.14]) by mx1.freebsd.org (Postfix) with ESMTP id AC70F1638 for ; Mon, 9 Dec 2013 09:31:02 +0000 (UTC) Received: from [192.168.0.4] (unknown [213.109.0.97]) by mail.euro-comm.net (Postfix) with ESMTPSA id A4E736BD5E3; Mon, 9 Dec 2013 13:30:55 +0400 (MSK) Subject: Re: Netgraph ng_patch and ng_input: where to find packets? Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=utf-8 From: Victor Gamov In-Reply-To: Date: Mon, 9 Dec 2013 13:30:53 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <5293E3E7.6090604@freebsd.org> <52A493F1.6040700@freebsd.org> To: Sami Halabi X-Mailer: Apple Mail (2.1283) Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 09:31:04 -0000 On 09Dec, 2013, at 11:36, Sami Halabi wrote: > Hi, Hi Sami > Actually following the ng_patch the following worked for me (using = 9.2-R -amd64): Yes, ng_patch works fine for me too. Then ng_input works too because I = see patched packets at ipfw. But this packets does not appears on = outgoing interface. Now I haven't machine for future testing, but I'll do more tests on = upcoming 10.0-R because I want to use 10.0 for my project. > kldload ng_patch > kldload ng_ipfw > /usr/sbin/ngctl -f- << SEQ > mkpeer ipfw: patch 300 in > name ipfw:300 src_dst_chg > msg src_dst_chg: setconfig { count=3D2 csum_flags=3D1 = ops=3D[ \ > { mode=3D1 value=3D0xc0a8e609 length=3D4 = offset=3D12 } \ > { mode=3D1 value=3D0xc0a8e680 length=3D4 = offset=3D16 } ] } > SEQ > /sbin/ipfw add 600 netgraph 300 log ip from any to 239.0.0.19 dst-port = 1234 in via vlan999 >=20 > Sami >=20 >=20 > On Sun, Dec 8, 2013 at 5:44 PM, Julian Elischer = wrote: > On 12/8/13, 6:43 PM, Sami Halabi wrote: > Hi Gamov, > Have got this to work? > If so would share configurations? >=20 > Thanks in advance, > Sami > =D7=91=D7=AA=D7=90=D7=A8=D7=99=D7=9A 29 =D7=91=D7=A0=D7=95=D7=91 2013 = 19:28, "Victor Gamov" =D7=9B=D7=AA=D7=91: >=20 >=20 >=20 > if not then the way to track it it to put a breakpoint on the netgraph = node that handles the packet and just single step through until you see = where the packet goes.. > kdb would give you a decent idea but a second machine (or a virtual = machine) with kgdb would really show you what's going on. -- =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=93=D0=B0=D0=BC=D0=BE=D0=B2 =D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80