git: pf: Fix and improve interface group support

Aaron LI aly at crater.dragonflybsd.org
Wed Aug 8 02:10:40 PDT 2018


commit c686757e01dd668abe9817cf3e78f18b4de62be7
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Jun 16 22:48:38 2018 +0800

    pf: Fix and improve interface group support
    
    The old PF code has broken partial support of the interface group.
    Without this patch, loading the 'pf.ko' module will panic the system.
    
    * Add event handlers of pfi_{attach,detach,change}_group_event()
      to support the interface groups.  Meanwhile, add event handler
      of pfi_ifaddr_event() that is called when an address is set up
      on an interface, and update pfi_{attach,detach}_event() handlers.
      (Based on FreeBSD)
    
    * Remove function pfi_kifaddr_update() as it is merged into
      pfi_ifaddr_event() handler.
    
    * Update pfi_initialize() and pfi_cleanup() functions (Based on
      FreeBSD).
    
    * Split function pfi_kif_find() out of pfi_kif_get().
      (Based on OpenBSD)
    
    * The PF module will be properly initialized on module load, so remove
      extra pfi_initialize() calls.
    
    * Rename malloc type 'PFI_MTYPE' to 'M_PFI',  and merge with malloc type
      'M_PFIADDRPL'.
    
    * Staticize internal functions and variables.
    
    * Some cleanups and style updates.
    
    Thanks to sephe for the guidance.

Summary of changes:
 sys/net/pf/pf_if.c    | 390 ++++++++++++++++++++++++++------------------------
 sys/net/pf/pf_ioctl.c |   9 +-
 sys/net/pf/pfvar.h    |   2 +-
 3 files changed, 212 insertions(+), 189 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c686757e01dd668abe9817cf3e78f18b4de62be7


-- 
DragonFly BSD source repository



More information about the Commits mailing list