Page MenuHomeFreeBSD

D30944.diff
No OneTemporary

D30944.diff

diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -197,19 +197,10 @@
bool kill_match;
};
-struct pfctl_state_scrub {
- bool timestamp;
- uint8_t ttl;
- uint32_t ts_mod;
-};
-
struct pfctl_state_peer {
- struct pfctl_state_scrub *scrub;
uint32_t seqlo;
uint32_t seqhi;
uint32_t seqdiff;
- uint16_t max_win;
- uint16_t mss;
uint8_t state;
uint8_t wscale;
};
@@ -243,10 +234,7 @@
uint32_t creation;
uint32_t expire;
uint32_t pfsync_time;
- uint16_t tag;
- uint8_t log;
uint8_t state_flags;
- uint8_t timeout;
uint32_t sync_flags;
};
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -636,35 +636,15 @@
nvlist_destroy(nv);
}
-static void
-pf_nvstate_scrub_to_state_scrub(const nvlist_t *nvl,
- struct pfctl_state_scrub *scrub)
-{
- bzero(scrub, sizeof(*scrub));
-
- scrub->timestamp = nvlist_get_bool(nvl, "timestamp");
- scrub->ttl = nvlist_get_number(nvl, "ttl");
- scrub->ts_mod = nvlist_get_number(nvl, "ts_mod");
-}
-
static void
pf_nvstate_peer_to_state_peer(const nvlist_t *nvl,
struct pfctl_state_peer *peer)
{
bzero(peer, sizeof(*peer));
- if (nvlist_exists_nvlist(nvl, "scrub")) {
- peer->scrub = malloc(sizeof(*peer->scrub));
- pf_nvstate_scrub_to_state_scrub(
- nvlist_get_nvlist(nvl, "scrub"),
- peer->scrub);
- }
-
peer->seqlo = nvlist_get_number(nvl, "seqlo");
peer->seqhi = nvlist_get_number(nvl, "seqhi");
peer->seqdiff = nvlist_get_number(nvl, "seqdiff");
- peer->max_win = nvlist_get_number(nvl, "max_win");
- peer->mss = nvlist_get_number(nvl, "mss");
peer->state = nvlist_get_number(nvl, "state");
peer->wscale = nvlist_get_number(nvl, "wscale");
}
@@ -721,9 +701,7 @@
pf_nvuint_64_array(nvl, "packets", 2, s->packets, NULL);
pf_nvuint_64_array(nvl, "bytes", 2, s->bytes, NULL);
- s->log = nvlist_get_number(nvl, "log");
s->state_flags = nvlist_get_number(nvl, "state_flags");
- s->timeout = nvlist_get_number(nvl, "timeout");
s->sync_flags = nvlist_get_number(nvl, "sync_flags");
}
diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c
--- a/sys/netpfil/pf/pf_nv.c
+++ b/sys/netpfil/pf/pf_nv.c
@@ -874,52 +874,22 @@
return (NULL);
}
-static nvlist_t *
-pf_state_scrub_to_nvstate_scrub(const struct pf_state_scrub *scrub)
-{
- nvlist_t *nvl;
-
- nvl = nvlist_create(0);
- if (nvl == NULL)
- return (NULL);
-
- nvlist_add_bool(nvl, "timestamp", scrub->pfss_flags & PFSS_TIMESTAMP);
- nvlist_add_number(nvl, "ttl", scrub->pfss_ttl);
- nvlist_add_number(nvl, "ts_mod", scrub->pfss_ts_mod);
-
- return (nvl);
-}
-
static nvlist_t *
pf_state_peer_to_nvstate_peer(const struct pf_state_peer *peer)
{
- nvlist_t *nvl, *tmp;
+ nvlist_t *nvl;
nvl = nvlist_create(0);
if (nvl == NULL)
return (NULL);
- if (peer->scrub) {
- tmp = pf_state_scrub_to_nvstate_scrub(peer->scrub);
- if (tmp == NULL)
- goto errout;
- nvlist_add_nvlist(nvl, "scrub", tmp);
- nvlist_destroy(tmp);
- }
-
nvlist_add_number(nvl, "seqlo", peer->seqlo);
nvlist_add_number(nvl, "seqhi", peer->seqhi);
nvlist_add_number(nvl, "seqdiff", peer->seqdiff);
- nvlist_add_number(nvl, "max_win", peer->max_win);
- nvlist_add_number(nvl, "mss", peer->mss);
nvlist_add_number(nvl, "state", peer->state);
nvlist_add_number(nvl, "wscale", peer->wscale);
return (nvl);
-
-errout:
- nvlist_destroy(nvl);
- return (NULL);
}
nvlist_t *
@@ -989,9 +959,7 @@
nvlist_add_number(nvl, "creatorid", s->creatorid);
nvlist_add_number(nvl, "direction", s->direction);
- nvlist_add_number(nvl, "log", s->log);
nvlist_add_number(nvl, "state_flags", s->state_flags);
- nvlist_add_number(nvl, "timeout", s->timeout);
if (s->src_node)
flags |= PFSYNC_FLAG_SRCNODE;
if (s->nat_src_node)

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 17, 1:13 PM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15838922
Default Alt Text
D30944.diff (3 KB)

Event Timeline