aboutsummaryrefslogtreecommitdiff
path: root/lib/libpfctl
diff options
context:
space:
mode:
authorKajetan Staszkiewicz <vegeta@tuxpowered.net>2023-05-29 19:35:58 +0000
committerKristof Provost <kp@FreeBSD.org>2023-05-30 12:28:57 +0000
commitc45d6b0ec011d5c113e0f7dedfc0070e8464fbbc (patch)
tree0e874e3b485cb87328841692c9f34af7fc5cf986 /lib/libpfctl
parent4bf98559d9d6fa7c3571d26ed6f2b18823e3a30b (diff)
Diffstat (limited to 'lib/libpfctl')
-rw-r--r--lib/libpfctl/libpfctl.c16
-rw-r--r--lib/libpfctl/libpfctl.h12
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 4f251e92d9aa..28ec89cd2aed 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -1111,6 +1111,7 @@ pf_state_export_to_state(struct pfctl_state *ps, const struct pf_state_export *s
ps->id = s->id;
strlcpy(ps->ifname, s->ifname, sizeof(ps->ifname));
strlcpy(ps->orig_ifname, s->orig_ifname, sizeof(ps->orig_ifname));
+ strlcpy(ps->rt_ifname, s->rt_ifname, sizeof(ps->rt_ifname));
pf_state_key_export_to_state_key(&ps->key[0], &s->key[0]);
pf_state_key_export_to_state_key(&ps->key[1], &s->key[1]);
pf_state_peer_export_to_state_peer(&ps->src, &s->src);
@@ -1131,8 +1132,19 @@ pf_state_export_to_state(struct pfctl_state *ps, const struct pf_state_export *s
ps->key[0].af = s->af;
ps->key[1].af = s->af;
ps->direction = s->direction;
- ps->state_flags = s->state_flags;
- ps->sync_flags = s->sync_flags;
+ ps->state_flags = ntohs(s->state_flags);
+ ps->sync_flags = ntohs(s->sync_flags);
+ ps->qid = ntohs(s->qid);
+ ps->pqid = ntohs(s->pqid);
+ ps->dnpipe = ntohs(s->dnpipe);
+ ps->dnrpipe = ntohs(s->dnrpipe);
+ ps->rtableid = ntohl(s->rtableid);
+ ps->min_ttl = s->min_ttl;
+ ps->set_tos = s->set_tos;
+ ps->max_mss = ntohs(s->max_mss);
+ ps->rt = s->rt;
+ ps->set_prio[0] = s->set_prio[0];
+ ps->set_prio[1] = s->set_prio[1];
}
int
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 064adafcf3ed..1a22cb5b853c 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -353,6 +353,18 @@ struct pfctl_state {
uint32_t pfsync_time;
uint16_t state_flags;
uint32_t sync_flags;
+ uint16_t qid;
+ uint16_t pqid;
+ uint16_t dnpipe;
+ uint16_t dnrpipe;
+ uint8_t log;
+ int32_t rtableid;
+ uint8_t min_ttl;
+ uint8_t set_tos;
+ uint16_t max_mss;
+ uint8_t set_prio[2];
+ uint8_t rt;
+ char rt_ifname[IFNAMSIZ];
};
TAILQ_HEAD(pfctl_statelist, pfctl_state);