aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2023-10-20 07:13:56 +0000
committerKristof Provost <kp@FreeBSD.org>2023-10-20 07:16:08 +0000
commitc1146e6ad67fb866c2472a1cbe5609fd939fd5ef (patch)
tree8554ee3d508a93a3075704bd98fb559aaab65a27 /sys/netinet/ip_divert.c
parenta959ae1c503d104f1e28033522362e5054f52c94 (diff)
downloadsrc-c1146e6ad67fb866c2472a1cbe5609fd939fd5ef.tar.gz
src-c1146e6ad67fb866c2472a1cbe5609fd939fd5ef.zip
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
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index ad95a1ce0d76..78ca36fc2a0f 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -182,7 +182,7 @@ divert_packet(struct mbuf *m, bool incoming)
(((struct ipfw_rule_ref *)(mtag+1))->info));
} else if ((mtag = m_tag_locate(m, MTAG_PF_DIVERT, 0, NULL)) != NULL) {
cookie = ((struct pf_divert_mtag *)(mtag+1))->idir;
- nport = htons(((struct pf_divert_mtag *)(mtag+1))->ndir);
+ nport = htons(((struct pf_divert_mtag *)(mtag+1))->port);
} else {
m_freem(m);
return;