Re: ospfd: fix rtlabel refcnt leak in kroute code

Alexander Bluhm <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
On Thu, Aug 27, 2026 at 10:24:13AM +0200, Claudio Jeker wrote:
> The rtlabel handling in kr_change does not properly adjust the refcnt of
> the label and so labels may be dropped even though still in use.
> On top of this the code does not update the values in case of a change.
> 
> I think there are still a few bits missing, e.g. the reload logic seems to
> be missing as well. Also the RDE does not track the ext_tag per nexthop so
> two routers redistributing the same as-ext LSA with equal metrics but
> different ext_tag will use one or the other tag for all routes.
> 
> Noticed while working on some imsg cleanup.

> +
> +				/* update if label changed */ 
> +				if (kn->r.rtlabel != label) {
> +					if (send_rtmsg(kr_state.fd, RTM_CHANGE,
> +					    &kn->r) == -1)
> +					return (-1);
> +				}

The return (-1) should be indented right of the if.

OK bluhm@
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.