Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 1997 16:01:36 +0200
From:      =?iso-8859-1?Q?=C5ge_R=F8bekk?= <aagero@aage.priv.no>
To:        freebsd-hackers@freebsd.org
Subject:   IPDIVERT not working in 2.2.2
Message-ID:  <19970601160135.28385@aage.priv.no>

next in thread | raw e-mail | index | archive | help

--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii

I'm having problems getting IPDIVERT and friends working on
FreeBSD-2.2.2.  When the kernel has booted and the drivers are
initialized, the kernel says

IP packet filtering initialized, divert enabled, unlimited logging

as expected.  However, binding to a divert socket and read()ing gives
no data no matter what i try.  The exact same setup works perfectly
fine in -CURRENT, although that is on another machine.  The 2.2.2 box
has 2 vx network cards, but I do not think that the divert layer can
be affected by such a low-level layer.  If someone could build and
test the extremely-crude and high-speed hacked together divert test
program attached to this mail, perhaps we could narrow out what i've
missed:

cc diverttest.c -o diverttest

ipfw add 00001 divert 32768 ip from any to any via <your-interface>
./diverttest 32768

any inbound traffic should be displayed as

read nn bytes

-aage

--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="diverttest.c"

I2luY2x1ZGUgPHVuaXN0ZC5oPg0KI2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPHN0
ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4u
aD4NCg0KI2RlZmluZSBCVUZGU0laIDE2MDAgLyogc2hvdWxkIGJlIE1UVSBwZXJoYXBzPyAq
Lw0KDQppbnQNCm1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0Kew0KICBpbnQgZGl2ZXJ0
c29jaywgcG9ydCwgcmRzejsNCiAgc3RydWN0IHNvY2thZGRyX2luIGFkZHI7DQogIGNoYXIg
KmJ1ZmY7DQoNCiAgaWYoYXJnYyA8IDIpIHsNCiAgICBmcHJpbnRmKHN0ZGVyciwgIiVzIHBv
cnRcbiIsIGFyZ3ZbMF0pOw0KICAgIGV4aXQoMSk7DQogIH0NCg0KICBpZigoZGl2ZXJ0c29j
ayA9IHNvY2tldChQRl9JTkVULCBTT0NLX1JBVywgSVBQUk9UT19ESVZFUlQpKSA9PSAtMSkg
ew0KICAgIHBlcnJvcigic29ja2V0Iik7DQogICAgZXhpdCgxKTsNCiAgfQ0KDQogIHBvcnQg
PSBhdG9pKGFyZ3ZbMV0pOw0KICANCiAgYWRkci5zaW5fZmFtaWx5ID0gQUZfSU5FVDsNCiAg
YWRkci5zaW5fYWRkci5zX2FkZHIgPSBJTkFERFJfQU5ZOw0KICBhZGRyLnNpbl9wb3J0ID0g
bnRvaHMocG9ydCk7DQoNCiAgaWYoYmluZChkaXZlcnRzb2NrLCAoc3RydWN0IHNvY2thZGRy
ICopJmFkZHIsIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHJfaW4pKSA8IDApIHsNCiAgICBwZXJy
b3IoImJpbmQiKTsNCiAgICBleGl0KDEpOw0KICB9DQoNCiAgaWYoKGJ1ZmYgPSBtYWxsb2Mo
QlVGRlNJWikpID09IE5VTEwpIHsNCiAgICBmcHJpbnRmKHN0ZGVyciwgIm1hbGxvYyBlcnJv
clxuIik7DQogICAgZXhpdCgxKTsNCiAgfQ0KDQogIGZvcig7Oykgew0KICAgIHJkc3ogPSBy
ZWFkKGRpdmVydHNvY2ssIGJ1ZmYsIEJVRkZTSVopOw0KICAgIGZwcmludGYoc3RkZXJyLCAi
cmVhZCAlZCBieXRlc1xuIiwgcmRzeik7DQogIH0NCg0KICByZXR1cm4gMDsgLyogSnVzdCB0
byBzaHV0IHVwIGdjYyAqLw0KfQ0KDQo=

--17pEHd4RhPHOinZp--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970601160135.28385>