mirror of
https://github.com/lgcosta/pf-linux-port.git
synced 2026-11-13 02:58:03 -03:00
M2: live netfilter data path (pf_test per direction), pfattach bring-up, NET_LOCK reentrancy fix, static pfctl
- pfk_hooks: PRE→PF_IN, LOCAL_OUT/POST→PF_OUT v4+v6; replacement/buffer handling with NF_STOLEN + re-injection (documented divergence: re-entry) - pfk_mod: pf_status_init/pfattach + pfi attach via pfk_if event callback - pfk_kern: NET_LOCK holder reentrancy (fix deadlock when notifier fires under the write lock — observed as full-VM network hang) - tools: static pfctl link for musl VMs
This commit is contained in:
1 parent
0119e70960
commit
5323ee2c71
49 files changed
+20028
-28
No files matched your search
@@ -0,0 +1,45 @@
|
||||
/* PFLINUX: <sys/ioctl.h> — OpenBSD 8.0 ioctl encoding for userland pfctl.
|
||||
*
|
||||
* net/pfvar.h builds every DIOC* number with _IO/_IOW/_IOR/_IOWR. pf.ko
|
||||
* (see module/include/pfk.h) interprets ioctl commands using the OpenBSD
|
||||
* sys/ioccom.h bit layout, NOT Linux asm/ioctl.h, so this header must
|
||||
* reproduce pfk.h's PFKXIOC_* encoding byte-for-byte. We pull in the real
|
||||
* glibc <sys/ioctl.h> first (ioctl(2) prototype, Linux SIOC* constants used
|
||||
* by <net/if.h>) and then redefine the _IO family.
|
||||
*
|
||||
* Values copied from module/include/pfk.h lines 135-152.
|
||||
*/
|
||||
#ifndef _PFLINUX_SYS_IOCTL_H
|
||||
#define _PFLINUX_SYS_IOCTL_H
|
||||
|
||||
#include_next <sys/ioctl.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#undef _IO
|
||||
#undef _IOR
|
||||
#undef _IOW
|
||||
#undef _IOWR
|
||||
|
||||
#define PFKXIOC_NRBITS 8
|
||||
#define PFKXIOC_TYPEBITS 8
|
||||
#define PFKXIOC_SIZEBITS 13
|
||||
#define PFKXIOC_DIRBITS 2
|
||||
#define PFKXIOC_NRSHIFT 0
|
||||
#define PFKXIOC_TYPESHIFT (PFKXIOC_NRSHIFT + PFKXIOC_NRBITS)
|
||||
#define PFKXIOC_SIZESHIFT (PFKXIOC_TYPESHIFT + PFKXIOC_TYPEBITS)
|
||||
#define PFKXIOC_DIRSHIFT (PFKXIOC_SIZESHIFT + PFKXIOC_SIZEBITS + 1)
|
||||
#define PFKXIOC_NONE 0U
|
||||
#define PFKXIOC_WRITE 1U /* OpenBSD IOC_IN (copyin) */
|
||||
#define PFKXIOC_READ 2U /* OpenBSD IOC_OUT (copyout) */
|
||||
|
||||
#define PFKXIOC(dir,type,nr,size) \
|
||||
(((dir) << PFKXIOC_DIRSHIFT) | ((type) << PFKXIOC_TYPESHIFT) | \
|
||||
((nr) << PFKXIOC_NRSHIFT) | ((size) << PFKXIOC_SIZESHIFT))
|
||||
|
||||
#define _IO(t, n) PFKXIOC(PFKXIOC_NONE, (t), (n), 0)
|
||||
#define _IOWR(t, n, s) PFKXIOC(PFKXIOC_WRITE|PFKXIOC_READ, (t), (n), sizeof(s))
|
||||
#define _IOW(t, n, s) PFKXIOC(PFKXIOC_WRITE, (t), (n), sizeof(s))
|
||||
#define _IOR(t, n, s) PFKXIOC(PFKXIOC_READ, (t), (n), sizeof(s))
|
||||
|
||||
#endif /* _PFLINUX_SYS_IOCTL_H */
|
||||
Reference in new issue
Block a user