summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingjing Duan <Jingjing.Duan@sun.com>2008-08-13 19:06:16 +0100
committerPaul Jakma <paul@quagga.net>2008-08-22 19:52:57 +0100
commit3e40282fd93553da276b48830db3df819b73c884 (patch)
treeec89de00c1e111d1c7e2672829857f3bf6356fbc
parentefda3bb8e548fee84928ff23329c11de8e742ecd (diff)
[isisd] Fix packet filtering with DLPI
2008-08-13 Jingjing Duan <Jingjing.Duan@sun.com> * isisd/isis_dlpi.c: Change ioctl from PFIOCSETF (transparent mode) to I_STR (non-transparent mode). The old code resulted in no filtering at all. Signed-off-by: Paul Jakma <paul@quagga.net>
-rw-r--r--isisd/isis_dlpi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c
index db4383be..e61dd166 100644
--- a/isisd/isis_dlpi.c
+++ b/isisd/isis_dlpi.c
@@ -42,8 +42,6 @@
#include "isisd/isis_circuit.h"
#include "isisd/isis_flags.h"
#include "isisd/isisd.h"
-#include "isisd/isis_constants.h"
-#include "isisd/isis_circuit.h"
#include "isisd/isis_network.h"
#include "privs.h"
@@ -452,11 +450,19 @@ open_dlpi_dev (struct isis_circuit *circuit)
if (ioctl (fd, I_PUSH, "pfmod") == 0)
{
struct packetfilt pfil;
+ struct strioctl sioc;
pfil.Pf_Priority = 0;
pfil.Pf_FilterLen = sizeof (pf_filter) / sizeof (u_short);
memcpy (pfil.Pf_Filter, pf_filter, sizeof (pf_filter));
- ioctl (fd, PFIOCSETF, &pfil);
+ /* pfmod does not support transparent ioctls */
+ sioc.ic_cmd = PFIOCSETF;
+ sioc.ic_timout = 5;
+ sioc.ic_len = sizeof (struct packetfilt);
+ sioc.ic_dp = (char *)&pfil;
+ if (ioctl (fd, I_STR, &sioc) == -1)
+ zlog_warn("%s: could not perform PF_IOCSETF on %s",
+ __func__, circuit->interface->name);
}
circuit->fd = fd;