pfil + if_bridge hooks not being called

Gerry Weaver gerryw at compvia.com
Mon Dec 29 02:30:00 UTC 2008


Hello All,

I am working on a driver to collect some network statistics using pfil. I have set up
a bridge and set net.link.bridge.pfil_member=1 via sysctl. I have added hooks for 
incoming and outgoing packets. I also put a third adapter into the system for 
dev/managment purposes. My hooks are only being called for outgoing packets
on the management (non bridge) interface. I have been searching for information
about what I may have overlooked, but I can't find anything concrete. Is there 
something else that I need to do to see packets on the bridge member interfaces
and incoming packets in general? 


I'm using FreeBSD 7.0-RELEASE.

struct pfil_head *pfh_inet;

  pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);

  if(pfh_inet == NULL)
  {
   uprintf("ERROR: Cannot get pfil head\n");
   return ENOENT;
  }

  pfil_add_hook(packets_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet);
  pfil_add_hook(packets_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet);

  ...


Thanks in advance,
Gerry


More information about the freebsd-net mailing list