Page MenuHomeFreeBSD

D57608.diff
No OneTemporary

D57608.diff

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -3877,10 +3877,8 @@
uint32_t seq_id;
if (tbl == NULL || size == NULL || *size < 0 ||
- (*size && as == NULL)) {
- errno = EINVAL;
- return (-1);
- }
+ (*size && as == NULL))
+ return (EINVAL);
snl_init_writer(&h->ss, &nw);
hdr = snl_create_genl_msg_request(&nw, h->family_id,
diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c
--- a/sbin/pfctl/pfctl_radix.c
+++ b/sbin/pfctl/pfctl_radix.c
@@ -194,7 +194,14 @@
pfr_get_astats(struct pfr_table *tbl, struct pfr_astats *addr, int *size,
int flags)
{
- return (pfctl_get_astats(pfh, tbl, addr, size, flags));
+ int ret;
+
+ ret = pfctl_get_astats(pfh, tbl, addr, size, flags);
+ if (ret) {
+ errno = ret;
+ return (-1);
+ }
+ return (0);
}
int
diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
--- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
@@ -1355,7 +1355,7 @@
struct pfr_table tbl = { 0 };
struct pfr_astats *t = NULL;
struct pfa_entry *e;
- int i, numaddrs = 1, outnum;
+ int error, i, numaddrs = 1, outnum;
if (pt == NULL)
return (-1);
@@ -1373,9 +1373,9 @@
}
outnum = numaddrs;
- if (pfctl_get_astats(pfh, &tbl, t, &outnum, 0) != 0) {
+ if ((error = pfctl_get_astats(pfh, &tbl, t, &outnum, 0)) != 0) {
syslog(LOG_ERR, "pfa_table_addrs(): ioctl() on %s: %s",
- pt->pfrt_name, strerror(errno));
+ pt->pfrt_name, strerror(error));
numaddrs = -1;
break;
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 16, 7:26 AM (18 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35129330
Default Alt Text
D57608.diff (1 KB)

Event Timeline