diff options
author | Jingjing Duan <Jingjing.Duan@sun.com> | 2008-08-13 20:06:16 +0200 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-08-22 20:52:57 +0200 |
commit | 3e40282fd93553da276b48830db3df819b73c884 (patch) | |
tree | ec89de00c1e111d1c7e2672829857f3bf6356fbc /isisd/isis_dlpi.c | |
parent | [lib] Add fletcher checksum implementation (diff) | |
download | frr-3e40282fd93553da276b48830db3df819b73c884.tar.xz frr-3e40282fd93553da276b48830db3df819b73c884.zip |
[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>
Diffstat (limited to 'isisd/isis_dlpi.c')
-rw-r--r-- | isisd/isis_dlpi.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c index db4383bed..e61dd1666 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; |