CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/05/13 09:12:14

Modified files:
        usr.sbin/bgpd  : rde.h rde_prefix.c 

Log message:
Do not fatal in pt_fill() instead return an error object that can never exist.

pt_fill() is in some cases used by semi-trusted content (e.g. from
bgpctl). The fatalx calls in that function are therefor a problem.

This alters pt_fill to instead return a pt_entry object that can not
exist in the tree. This error object is simply initalised with 0xff.

Also if the prefixlen is too large for the address family just clip it down
to the maximum (with a log message).

In pt_add(), the only place a pt_fill() object would be added to the tree,
check if the returned object is valid. There it is ok to fatal (at least
for now) since the code previous to pt_add() should validate the prefix.

Uniform some error messages and switch the prefixlen argument to u_int.

OK tb@

Reply via email to