Re: authpf: kill states in the session's routing domain
Alexandr Nedvedicky <[email protected]> Fri, 24 Jul 2026 09:43:59 +0200
| Newsgroups | gmane.os.openbsd.tech |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I think the diff needs few tweaks
On Sun, Jul 19, 2026 at 11:20:01PM +0530, Avinash Duduskar wrote:
> +/*
> + * Map the process routing table to its routing domain; a policy-routing
> + * rtable lives in rdomain 0.
> + */
> +static u_int
> +authpf_rdomain(void)
> +{
> + struct rt_tableinfo info;
> + int mib[6];
> + size_t len = sizeof(info);
> + int rtable = getrtable();
> +
> + mib[0] = CTL_NET;
> + mib[1] = PF_ROUTE;
> + mib[2] = 0;
> + mib[3] = 0;
> + mib[4] = NET_RT_TABLE;
> + mib[5] = rtable;
> +
> + if (sysctl(mib, 6, &info, &len, NULL, 0) == -1) {
> + syslog(LOG_ERR, "sysctl NET_RT_TABLE: %m");
> + return (rtable);
> + }
> + return (info.rti_domainid);
> +}
> +
Also I'm not sure if the plan for sysctl(2) error handling
is good. I think better course of action is to do exit(1)
instead of returning rtable assuming this is what we are
asking for.
thanks and
regards
sashan