git: Revert "pf: Allow disappearing or not yet existing interfaces for ALTQ"
commit d15093b968014ef49e9a6d18ef3d97557410473e Author: Aaron LI Date: Thu Aug 9 10:40:36 2018 +0800 Revert "pf: Allow disappearing or not yet existing interfaces for ALTQ" This reverts commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6. 1. It's incorrect to change the ifnet_unlock(). The original protection range is used to make sure that the ifp does not get ripped out behind our back. 2. We don't suffer from the issue that that commit was intended to fix. Thanks-to: sephe Summary of changes: sys/net/pf/pf_if.c| 10 sys/net/pf/pf_ioctl.c | 123 +++--- sys/net/pf/pfvar.h| 6 --- usr.sbin/pfctl/pfctl_altq.c | 4 -- usr.sbin/pfctl/pfctl_qstats.c | 17 +- 5 files changed, 21 insertions(+), 139 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d15093b968014ef49e9a6d18ef3d97557410473e -- DragonFly BSD source repository
Re: git: pf: Allow disappearing or not yet existing interfaces for ALTQ
That's fine w/ me too. On Thu, Aug 9, 2018 at 9:23 AM, Aaron LI wrote: > Thanks for the explanation. > > As you said we don't have the issue that this commit is intended to fix, I'd > revert the whole commit, OK? > > > > On Thu, 9 Aug 2018 09:05:18 +0800 > Sepherosa Ziehau wrote: > >> Please backout the "simplify the ifnet_unlock" part. The original >> protection range is used to make sure that the ifp does not get ripped >> out behind our back. To be frank, we don't even suffer the issue this >> fix is intended to address; it only makes the code convoluted. >> >> On Wed, Aug 8, 2018 at 5:10 PM, Aaron LI >> wrote: >> > >> > commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6 >> > Author: Aaron LI >> > Date: Sat Jun 16 23:18:20 2018 +0800 >> > >> > pf: Allow disappearing or not yet existing interfaces for ALTQ >> > >> > Make ALTQ cope with disappearing interfaces (particularly common with >> > net/mpd4 and netgraph in general). This also allows to add queues for >> > an interface that is not yet existing, however, you have to provide >> > the bandwidth for the interface. >> > >> > Meanwhile, simplify the ifnet_unlock() calls for ifunit() use. >> > >> > Taken-from: FreeBSD (r177700) >> > >> > Summary of changes: >> > sys/net/pf/pf_if.c| 10 >> > sys/net/pf/pf_ioctl.c | 123 >> > +++--- sys/net/pf/pfvar.h >> > | 6 +++ usr.sbin/pfctl/pfctl_altq.c | 4 ++ >> > usr.sbin/pfctl/pfctl_qstats.c | 17 +- >> > 5 files changed, 139 insertions(+), 21 deletions(-) >> > >> > http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6 >> > >> > >> > -- >> > DragonFly BSD source repository > -- Tomorrow Will Never Die
Re: git: pf: Allow disappearing or not yet existing interfaces for ALTQ
Thanks for the explanation. As you said we don't have the issue that this commit is intended to fix, I'd revert the whole commit, OK? On Thu, 9 Aug 2018 09:05:18 +0800 Sepherosa Ziehau wrote: > Please backout the "simplify the ifnet_unlock" part. The original > protection range is used to make sure that the ifp does not get ripped > out behind our back. To be frank, we don't even suffer the issue this > fix is intended to address; it only makes the code convoluted. > > On Wed, Aug 8, 2018 at 5:10 PM, Aaron LI > wrote: > > > > commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6 > > Author: Aaron LI > > Date: Sat Jun 16 23:18:20 2018 +0800 > > > > pf: Allow disappearing or not yet existing interfaces for ALTQ > > > > Make ALTQ cope with disappearing interfaces (particularly common with > > net/mpd4 and netgraph in general). This also allows to add queues for > > an interface that is not yet existing, however, you have to provide > > the bandwidth for the interface. > > > > Meanwhile, simplify the ifnet_unlock() calls for ifunit() use. > > > > Taken-from: FreeBSD (r177700) > > > > Summary of changes: > > sys/net/pf/pf_if.c| 10 > > sys/net/pf/pf_ioctl.c | 123 > > +++--- sys/net/pf/pfvar.h > > | 6 +++ usr.sbin/pfctl/pfctl_altq.c | 4 ++ > > usr.sbin/pfctl/pfctl_qstats.c | 17 +- > > 5 files changed, 139 insertions(+), 21 deletions(-) > > > > http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6 > > > > > > -- > > DragonFly BSD source repository pgpTGQ8Bbykwp.pgp Description: OpenPGP digital signature
Re: git: pf: Allow disappearing or not yet existing interfaces for ALTQ
Please backout the "simplify the ifnet_unlock" part. The original protection range is used to make sure that the ifp does not get ripped out behind our back. To be frank, we don't even suffer the issue this fix is intended to address; it only makes the code convoluted. On Wed, Aug 8, 2018 at 5:10 PM, Aaron LI wrote: > > commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6 > Author: Aaron LI > Date: Sat Jun 16 23:18:20 2018 +0800 > > pf: Allow disappearing or not yet existing interfaces for ALTQ > > Make ALTQ cope with disappearing interfaces (particularly common with > net/mpd4 and netgraph in general). This also allows to add queues for > an interface that is not yet existing, however, you have to provide > the bandwidth for the interface. > > Meanwhile, simplify the ifnet_unlock() calls for ifunit() use. > > Taken-from: FreeBSD (r177700) > > Summary of changes: > sys/net/pf/pf_if.c| 10 > sys/net/pf/pf_ioctl.c | 123 > +++--- > sys/net/pf/pfvar.h| 6 +++ > usr.sbin/pfctl/pfctl_altq.c | 4 ++ > usr.sbin/pfctl/pfctl_qstats.c | 17 +- > 5 files changed, 139 insertions(+), 21 deletions(-) > > http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6 > > > -- > DragonFly BSD source repository -- Tomorrow Will Never Die
git: eventhandler: Implement ifnet_event
commit fcddd1b6c3b2924a8a022caf183b8f186e7d5cae Author: Aaron LI Date: Mon Jun 25 17:00:21 2018 +0800 eventhandler: Implement ifnet_event Implement the "ifnet_event" which is triggered on interface up and down. Taken-from: FreeBSD Summary of changes: share/man/man9/EVENTHANDLER.9 | 4 +++- sys/net/if.c | 2 ++ sys/net/if_var.h | 5 + 3 files changed, 10 insertions(+), 1 deletion(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fcddd1b6c3b2924a8a022caf183b8f186e7d5cae -- DragonFly BSD source repository
git: Move pf.conf.5 and pf.os.5 to share/man/man5
commit d27abe81872597163e3d797770ce9aaf71bbb6c7 Author: Aaron LI Date: Tue Jun 26 12:25:07 2018 +0800 Move pf.conf.5 and pf.os.5 to share/man/man5 Summary of changes: share/man/man5/Makefile | 3 ++- {usr.sbin/pfctl => share/man/man5}/pf.conf.5 | 0 {usr.sbin/pfctl => share/man/man5}/pf.os.5 | 0 usr.sbin/pfctl/Makefile | 2 +- 4 files changed, 3 insertions(+), 2 deletions(-) rename {usr.sbin/pfctl => share/man/man5}/pf.conf.5 (100%) rename {usr.sbin/pfctl => share/man/man5}/pf.os.5 (100%) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d27abe81872597163e3d797770ce9aaf71bbb6c7 -- DragonFly BSD source repository
git: bpf: Move bpf_track event declaration to
commit e826117ee8aacb5698d8c6af3d39ba34be643c84 Author: Aaron LI Date: Mon Jun 25 17:31:16 2018 +0800 bpf: Move bpf_track event declaration to Move the declaration of the "bpf_track" event from to . Document the "bpf_track" event in eventhandler.9 man page. Based on FreeBSD. Summary of changes: share/man/man9/EVENTHANDLER.9 | 3 +++ sys/net/bpf.h | 20 sys/sys/eventhandler.h| 6 -- 3 files changed, 15 insertions(+), 14 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e826117ee8aacb5698d8c6af3d39ba34be643c84 -- DragonFly BSD source repository
git: eventhandler.9: Update events list
commit acc24b690ed6d89cb2611bb8ee46800d01acaa84 Author: Aaron LI Date: Mon Jun 25 17:59:15 2018 +0800 eventhandler.9: Update events list * Remove "dev_clone" * Add "iflladdr_event", "mountroot", and "usb_dev_configured". Descriptions are taken from FreeBSD. Summary of changes: share/man/man9/EVENTHANDLER.9 | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/acc24b690ed6d89cb2611bb8ee46800d01acaa84 -- DragonFly BSD source repository
git: eventhandler: Implement ifnet_link_event
commit bc1a39e222197cb9e98ed508f3994662d5d3fc75 Author: Aaron LI Date: Mon Jun 25 17:04:41 2018 +0800 eventhandler: Implement ifnet_link_event The "ifnet_link_event" is triggered by the change of the link state of an interface. Taken-from: FreeBSD Summary of changes: share/man/man9/EVENTHANDLER.9 | 2 ++ sys/net/if.c | 2 ++ sys/net/if_var.h | 3 +++ 3 files changed, 7 insertions(+) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bc1a39e222197cb9e98ed508f3994662d5d3fc75 -- DragonFly BSD source repository
git: pf.conf.5: Describe the use of interface group
commit 5304134c9c97d9ff22e6c3ddc4dde7ccb3895cde Author: Aaron LI Date: Tue Jun 26 13:42:42 2018 +0800 pf.conf.5: Describe the use of interface group Add the description on interface group, which is supported by DragonFly BSD's PF now. Meanwhile, bring in many small updates/fixes from FreeBSD. Summary of changes: share/man/man5/pf.conf.5 | 94 1 file changed, 56 insertions(+), 38 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5304134c9c97d9ff22e6c3ddc4dde7ccb3895cde -- DragonFly BSD source repository
git: net: Tweak some styles and comments
commit 2949c680adb831996c4c170affac4f493c3de188 Author: Aaron LI Date: Thu Jun 21 13:56:00 2018 +0800 net: Tweak some styles and comments Summary of changes: sys/net/if.c | 13 +++-- sys/net/if_var.h | 32 +++- sys/net/pf/pf_if.c| 2 +- sys/net/pf/pf_ioctl.c | 7 --- sys/net/pf/pfvar.h| 28 ++-- sys/net/route.c | 4 ++-- sys/net/route.h | 3 +-- sys/sys/sockio.h | 22 +++--- 8 files changed, 55 insertions(+), 56 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2949c680adb831996c4c170affac4f493c3de188 -- DragonFly BSD source repository
git: if_loop: Use ifc->ifc_name and minor cleanups
commit 426d6ad04af3385f289cad4f7b0a68148573b0e5 Author: Aaron LI Date: Thu Jun 21 13:49:15 2018 +0800 if_loop: Use ifc->ifc_name and minor cleanups * Use "ifc->ifc_name" instead of explicit "lo". * Minor style updates. Summary of changes: sys/net/if_loop.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/426d6ad04af3385f289cad4f7b0a68148573b0e5 -- DragonFly BSD source repository
git: if_clone: Add cloned interface to the group of its device name
commit 5e983a2e81a369a995ee9cb7d8bcecf766990863 Author: Aaron LI Date: Thu Jun 21 14:40:31 2018 +0800 if_clone: Add cloned interface to the group of its device name When a new interface is cloned, add it to the group of its device name, e.g., cloned interfaces tapX will belong to group of "tap" by default. Summary of changes: sys/net/if_clone.c | 10 ++ 1 file changed, 10 insertions(+) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e983a2e81a369a995ee9cb7d8bcecf766990863 -- DragonFly BSD source repository
git: pf: Allow disappearing or not yet existing interfaces for ALTQ
commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6 Author: Aaron LI Date: Sat Jun 16 23:18:20 2018 +0800 pf: Allow disappearing or not yet existing interfaces for ALTQ Make ALTQ cope with disappearing interfaces (particularly common with net/mpd4 and netgraph in general). This also allows to add queues for an interface that is not yet existing, however, you have to provide the bandwidth for the interface. Meanwhile, simplify the ifnet_unlock() calls for ifunit() use. Taken-from: FreeBSD (r177700) Summary of changes: sys/net/pf/pf_if.c| 10 sys/net/pf/pf_ioctl.c | 123 +++--- sys/net/pf/pfvar.h| 6 +++ usr.sbin/pfctl/pfctl_altq.c | 4 ++ usr.sbin/pfctl/pfctl_qstats.c | 17 +- 5 files changed, 139 insertions(+), 21 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6 -- DragonFly BSD source repository
git: pf: Fix and improve interface group support
commit c686757e01dd668abe9817cf3e78f18b4de62be7 Author: Aaron LI 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
git: pf: Update pfi_kif and pfi_kif_cmp structs
commit 3bbcdcc2594c6b74fb7c860ceebf1713b0ad56ef Author: Aaron LI Date: Thu Jun 21 08:59:47 2018 +0800 pf: Update pfi_kif and pfi_kif_cmp structs For struct "pfi_kif", add "pfik_name" entry while remove multiple obsolete entries and macros. Rename "pfik_ifname" to "pfik_name" for "pfi_kif_cmp" struct. Based on both OpenBSD and FreeBSD. Summary of changes: sys/net/pf/pfvar.h | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3bbcdcc2594c6b74fb7c860ceebf1713b0ad56ef -- DragonFly BSD source repository
git: net: Implement interface group support
commit 233c85704a96468c162480f32a6e092b81b0cdaf Author: Aaron LI Date: Sat Jun 16 22:25:31 2018 +0800 net: Implement interface group support The network interface group (aka ifgroup) functionality is currently only used by the PF (still needs patch to make PF use the ifgroup), allowing rules to use group names instead of the specific interface names, which makes firewall rules more generic and simpler. * The ifgroup data are stored at the following two places: - The global list of 'struct ifg_group': each entry is a group which has the name and members (a list of pointers to the interfaces). - The per-ifnet 'if_groups' list, which records the groups that the interface belongs to. * Introduce the 'ifgroup_lock' locakmgr(9) to protect the global list of 'struct ifg_group' and per-ifnet 'if_groups' list. The R/W locking operations are provided by the ifgroup_lockmgr() function. * Move the copyout() out of the locked loop in if_getgroups() and if_getgroupmembers() functions. * Fix several M_NOWAIT to be M_WAITOK. * Use M_IFNET instead of M_TEMP for allocated ifgroup memory. * Add SIOC[ADG]IFGROUP and SIOCGIFGMEMB ioctl's, bump __DragonFly_version. * Add invocations to group_{attach,change,detach}_event handlers. * Update eventhandler.9 man page. * Some style updates. Great thanks to sephe for his patient guidance and review. Credit to both FreeBSD and OpenBSD for the ifgroup functionality. NOTE: When delete the only group from an interface, which leaves an empty group that will be destroyed, make sure the group_change_event event is invoked *before* the group destroy (i.e., group_detach_event). Both FreeBSD and OpenBSD have the ordering problem with group detach event. Need to report the problem to them. Summary of changes: share/man/man9/EVENTHANDLER.9 | 8 +- sys/net/if.c | 347 -- sys/net/if.h | 4 +- sys/net/if_var.h | 38 +++-- sys/sys/param.h | 3 +- sys/sys/sockio.h | 5 +- 6 files changed, 272 insertions(+), 133 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/233c85704a96468c162480f32a6e092b81b0cdaf -- DragonFly BSD source repository
git: ifconfig(8): Add group support
commit d4024308578796b864d264d08e7cd14719d0c00a Author: Aaron LI Date: Sat Jun 16 23:01:21 2018 +0800 ifconfig(8): Add group support Obtained from FreeBSD, with some minor changes. Summary of changes: sbin/ifconfig/Makefile | 1 + sbin/ifconfig/ifconfig.8 | 22 +- sbin/ifconfig/ifgroup.c | 183 +++ 3 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 sbin/ifconfig/ifgroup.c http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d4024308578796b864d264d08e7cd14719d0c00a -- DragonFly BSD source repository
git: if_pflog: Explicitly depend on "pf" and various cleanups
commit a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48 Author: Aaron LI Date: Thu Jun 21 09:31:44 2018 +0800 if_pflog: Explicitly depend on "pf" and various cleanups * Explicitly depend on the "pf" module to make sure it is initialized later than the "pf" main module. * Fix a missing lwkt token release in pflog_clone_create(). * Remove unnecessary kmalloc() check. * Use if_initname() to properly set up if_{xname,dname,dunit}. * Use pflogattach() in module load event handle. * Staticize functions and variables. * Remove the unused pflogrtrequest() function. * Remove the "old_pfloghdr" struct from if_pflog.h. * Mark some __unused variables. Summary of changes: sys/net/pf/if_pflog.c | 84 +++ sys/net/pf/if_pflog.h | 11 --- 2 files changed, 37 insertions(+), 58 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48 -- DragonFly BSD source repository
git: if_pfsync: Depend on "pf" module and some cleanups
commit c8f430ba934ae95fab35e5ea90b7092b6805837e Author: Aaron LI Date: Thu Jun 21 09:40:05 2018 +0800 if_pfsync: Depend on "pf" module and some cleanups * Explicitly depend on the "pf" module to make sure it is initialized later. * Remove the unnecessary ksnprintf directive that sets if_xname. * Order several directives in pfsync_clone_create(), making it more consistent with pflog_clone_create(). Summary of changes: sys/net/pf/if_pfsync.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c8f430ba934ae95fab35e5ea90b7092b6805837e -- DragonFly BSD source repository
git: if_clone: Refactor out if_clone_{alloc,free}_unit() functions
commit 9ad42ca200d2153e8f3d9b86928684884d283da3 Author: Aaron LI Date: Mon Aug 6 00:10:54 2018 +0800 if_clone: Refactor out if_clone_{alloc,free}_unit() functions Refactor out if_clone_{alloc,free}_unit() functions from if_clone_{create,destroy}() functions. Summary of changes: sys/net/if_clone.c | 120 +++-- 1 file changed, 70 insertions(+), 50 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9ad42ca200d2153e8f3d9b86928684884d283da3 -- DragonFly BSD source repository
git: if_clone: Check cloner name to avoid duplicate in if_clone_attach()
commit 595dc8f18c44a1d14a2b0b9b6ba2485cee04d3b5 Author: Aaron LI Date: Mon Aug 6 00:34:25 2018 +0800 if_clone: Check cloner name to avoid duplicate in if_clone_attach() Change if_clone_attach() to check the cloner name instead of the pointer to avoid duplicate, also to return EEXIST instead of panic. Summary of changes: sys/net/if_clone.c | 14 +- sys/net/if_clone.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/595dc8f18c44a1d14a2b0b9b6ba2485cee04d3b5 -- DragonFly BSD source repository
git: if_clone: Refactor out if_clone_createif() function
commit 1047b69ec58e788e95845d6a577152a68e9d6601 Author: Aaron LI Date: Mon Aug 6 15:36:41 2018 +0800 if_clone: Refactor out if_clone_createif() function The new if_clone_createif() function will create a clone interface with the given cloner and unit. Summary of changes: sys/net/if_clone.c | 52 +++- 1 file changed, 35 insertions(+), 17 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1047b69ec58e788e95845d6a577152a68e9d6601 -- DragonFly BSD source repository
git: if_clone: Remove useless code wrongly added in 84cb91c376f
commit 1e4b15c7af1048818778718cff71b98ff6cf252b Author: Aaron LI Date: Mon Aug 6 00:09:53 2018 +0800 if_clone: Remove useless code wrongly added in 84cb91c376f The code was inteded to obtain the created interface and add an interface group for it, which is a work in progress. Summary of changes: sys/net/if_clone.c | 6 -- 1 file changed, 6 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1e4b15c7af1048818778718cff71b98ff6cf252b -- DragonFly BSD source repository