]> git.proxmox.com Git - mirror_frr.git/commitdiff
[isisd] Fix packet filtering with DLPI
authorJingjing Duan <Jingjing.Duan@sun.com>
Wed, 13 Aug 2008 18:06:16 +0000 (19:06 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 22 Aug 2008 18:52:57 +0000 (19:52 +0100)
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>
isisd/isis_dlpi.c

index db4383bed2d31fce6420cb5ac8cfe8eb42130ac9..e61dd1666fb71b1104365989861f3060b9915385 100644 (file)
@@ -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;