Subject: kern/27260: Interface events in kernel shouldn't be implemented in pfil(9)
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 10/14/2004 15:02:54
>Number:         27260
>Category:       kern
>Synopsis:       Interface events in kernel shouldn't be implemented in pfil(9)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 14 13:34:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Postma
>Release:        NetBSD 2.99.9
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 2.99.9 NetBSD 2.99.9 (mercury) #57: Sun Oct 10 21:06:54 CEST 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
Problem described here:
http://marc.theaimsgroup.com/?l=netbsd-tech-net&m=109558992520060&w=2

I'm filing this PR because I don't have time to work on this now.

In short, I've two objections with interface events implemented in pfil(9):

1) pfil(9) is for packet filtering, attachment/detachment of interfaces
   and address changes have nothing to do with it.

2) The pfil(9) API is now very ugly (e.g. extra conditionals in
   pfil_run_hooks).

It works for now, but IMHO in the long term the hacks in pfil(9) should
be removed and a cleaner solution should be implemented, maybe something
like FreeBSD's EVENTHANDLER or the extending the hook_* code in kern_subr.c.

>How-To-Repeat:
Inspect sys/net/pfil.c

>Fix:
See description.
>Release-Note:
>Audit-Trail:
>Unformatted: