Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173931592
D60110.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60110.diff
View Options
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -2777,9 +2777,25 @@
size_t total_count;
};
+/* pfra_af is a u8, but the kernel sends PFR_A_AF as a u32. Accept both. */
+static bool
+snl_attr_get_pfra_af(struct snl_state *ss, struct nlattr *nla,
+ const void *arg __unused, void *target)
+{
+ uint32_t af;
+
+ if (snl_attr_get_uint8(ss, nla, NULL, target))
+ return (true);
+ if (! snl_attr_get_uint32(ss, nla, NULL, &af))
+ return (false);
+ *(uint8_t *)target = af;
+
+ return (true);
+}
+
#define _OUT(_field) offsetof(struct pfr_addr, _field)
static const struct snl_attr_parser ap_pfr_addr[] = {
- { .type = PFR_A_AF, .off = _OUT(pfra_af), .cb = snl_attr_get_uint32 },
+ { .type = PFR_A_AF, .off = _OUT(pfra_af), .cb = snl_attr_get_pfra_af },
{ .type = PFR_A_NET, .off = _OUT(pfra_net), .cb = snl_attr_get_uint8 },
{ .type = PFR_A_NOT, .off = _OUT(pfra_not), .cb = snl_attr_get_bool },
{ .type = PFR_A_ADDR, .off = _OUT(pfra_ip6addr), .cb = snl_attr_get_in6_addr },
diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h
--- a/sys/netpfil/pf/pf_nl.h
+++ b/sys/netpfil/pf/pf_nl.h
@@ -494,7 +494,7 @@
enum pfr_addr_t {
PFR_A_UNSPEC,
- PFR_A_AF = 1, /* uint8_t */
+ PFR_A_AF = 1, /* uint8_t, uint32_t in replies */
PFR_A_NET = 2, /* uint8_t */
PFR_A_NOT = 3, /* bool */
PFR_A_ADDR = 4, /* in6_addr */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 30, 11:13 AM (13 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39915972
Default Alt Text
D60110.diff (1 KB)
Attached To
Mode
D60110: libpfctl: decode PFR_A_AF into a u8
Attached
Detach File
Event Timeline
Log In to Comment