On Sat, Apr 06, 2019 at 02:37:05AM +0200, Alexandr Nedvedicky wrote:
> updated diff is attached. I'll commit the change after unlock.
OK kn with comments inline.

> +     pf.ifname = strdup("none");
> +     if (pf.ifname == NULL)
> +             warn("%s: Warning: can't reset loginterface\n", __func__);
> +     else
> +             pf.ifname_set = 1;

We should fail hard as in almost all other strdup(3) use cases.
Failure means the system ran out of memory, there's no point in going
any further.

So just something like

        pf.ifname = strdup("none");
        if (pf.ifname == NULL)
                err(1, "%s: strdup", __func__);

> +     if (pfctl_trans(dev, &t, DIOCXBEGIN, 0))
> +             warn("%s, DIOCXBEGIN", __func__);
Turn this comma into a double colon.

> +     if (pfctl_trans(dev, &t, DIOCXCOMMIT, 0))
> +             warn("%s, DIOCXCOMMIT", __func__);
Same here.

Reply via email to