Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 2004 11:48:59 -0700 (PDT)
From:      Kelly Yancey <kbyanc@posi.net>
To:        Patrick Tracanelli <eksffa@freebsdbrasil.com.br>
Cc:        Dario Basso Cardoso <cardosodario@itelefonica.com.br>
Subject:   Re: FWD under bridged enviroment...
Message-ID:  <20040819114254.E16906@gateway.posi.net>
In-Reply-To: <4122738D.1020607@freebsdbrasil.com.br>
References:  <4120DA69.8080609@freebsdbrasil.com.br> <20040817125600.I2020@gateway.posi.net> <4122738D.1020607@freebsdbrasil.com.br>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1757655805-1092941339=:16906
Content-Type: TEXT/PLAIN; charset=US-ASCII

yOn Tue, 17 Aug 2004, Patrick Tracanelli wrote:

> Kelly, I remember you said once that you had modified the code in a
> different way Luigi had done and posted here (Rizzo's patch for
> revision); I considere patching ip_fw2.c and ip_input.c to get it
> working, where can I find your patches to read it?
>
> I want to see the two ways it was done :}
>

  It isn't pretty as mbuf tags had not been backported to -stable yet when
I originally wrote the attached diffs (circa FreeBSD 4.7).  I also just
noticed that the MGETHDR with M_NOWAIT is bogus as the following code
doesn't check for it failing.  I'll cleanup both of these points when I
port the code to 5.x and post the resulting patch.
  These diffs were just pulled out of my local CVS with other changes in
the network stack, so it is doubtful they will apply cleanly against any
version of FreeBSD (although 4.7p23 should have the highest odds).  Since
you said you just wanted to read the code, though, it shouldn't be a
problem.  If it looks like I missed a file, please let me know,

  Kelly

--
Kelly Yancey  -  kbyanc@{posi.net,FreeBSD.org}  -  kelly@nttmcl.com
--0-1757655805-1092941339=:16906
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ipfw2-fwd.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <20040819114859.J16906@gateway.posi.net>
Content-Description: 
Content-Disposition: attachment; filename="ipfw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wkJ
ICogICAgIHRoZSBsZWFkaW5nIG1idWYgYXMgaXQncyBvdXIgdGFnIHJhdGhl
ciB0aGFuIGEgcHJvcGVyDQorCQkgKiAgICAgcGFja2V0IGhlYWRlci4NCisJ
CSAqIFhYWCBUaGlzIGlzIHByZXR0eSBleHBlbnNpdmUgKGFuZCB1Z2x5ISku
ICBUaGlzIGNhbiBiZQ0KKwkJICogICAgIGNsZWFuZWQgdXAgdXNpbmcgLWN1
cnJlbnQncyBwYWNrZXQgdGFnZ2luZy4NCisJCSAqLw0KKwkJc3RydWN0IG1i
dWYgKnRhZzsNCisNCisJCU1HRVRIRFIodGFnLCBNX0RPTlRXQUlULCBNVF9U
QUcpOw0KKwkJdGFnLT5tX2hkci5taF9mbGFncyA9IFBBQ0tFVF9UQUdfSVBG
T1JXQVJEIHwgTV9QUk9UTzU7IC8qIEhhY2shICovDQorCQl0YWctPm1faGRy
Lm1oX2RhdGEgPSAoY2FkZHJfdClhcmdzLm5leHRfaG9wOw0KKwkJdGFnLT5t
X2hkci5taF9uZXh0ID0gKm0wOw0KKw0KKwkJc2NoZWRuZXRpc3IoTkVUSVNS
X0lQKTsNCisJCSh2b2lkKSBJRl9IQU5ET0ZGKCZpcGludHJxLCB0YWcsIE5V
TEwpOw0KKwkJKm0wID0gTlVMTDsNCisJCXJldHVybiAwOw0KIAl9DQogI2Vu
ZGlmDQogDQo=

--0-1757655805-1092941339=:16906--


Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20040819114254.E16906>