pf: use an enum for packet direction in divert tag
authorKristof Provost <kp@FreeBSD.org>
Fri, 20 Oct 2023 07:13:56 +0000 (09:13 +0200)
committerKristof Provost <kp@FreeBSD.org>
Fri, 20 Oct 2023 07:16:08 +0000 (09:16 +0200)
commitc1146e6ad67fb866c2472a1cbe5609fd939fd5ef
tree8554ee3d508a93a3075704bd98fb559aaab65a27
parenta959ae1c503d104f1e28033522362e5054f52c94
pf: use an enum for packet direction in divert tag

The benefit is that in the debugger you will see PF_DIVERT_MTAG_DIR_IN
instead of 1 when looking at a structure. And compilation time failure
if anybody sets it to a wrong value. Using "port" instead of "ndir" when
assigning a port improves readability of code.

Suggested by: glebius
MFC after: 3 weeks
X-MFC-With: fabf705f4b
sys/netinet/ip_divert.c
sys/netinet/ip_var.h
sys/netpfil/pf/pf.c