Age | Commit message (Collapse) | Author |
|
of the control socket needs a local variable since imsg_get_fd() can
only be called once on an imsg.
OK tb@
|
|
ibuf should be reserved for struct ibuf * values.
OK tb@
|
|
imsg->data field. This is needed for future imsg API changes.
OK tb@
|
|
Right now OpenBGPD can not produce so many capabilities that this
case is reached but still better to fix it now.
OK tb@
|
|
Use the ibuf_size() of the optional params (opb) when writing the various
headers. Only use optparamlen to write the Opt Parm Len field of the OPEN
message. Since there the size could be forced to 255 in case of a RFC9072
exended header. Also use size_t for optparamlen since the new ibuf API
no longer depends on using the right sized type.
OK tb@
|
|
htons() the value before.
OK tb@
|
|
value here since *olen is (conditionally) set a few lines later to the
same value as xoff.
Should fix the CodeQL warnings because *olen is dereferenced without
proper NULL check.
OK tb@
|
|
is still better to check for error.
OK tb@
|
|
More yak shaving required which will follow.
OK tb@
|
|
OK tb@
|
|
Also reorder the RTF_HOST vs netmask check. RTF_HOST wins if both are set.
Makes the code a bit neater.
OK tb@
|
|
OK tb@
|
|
When a session is established determine the possible interface scope of that
session. The scope is only set when the remote address is directly connected.
This interface scope is passed to the RDE that uses this information when
link-local nexthops are received. Again checking that a link-local nexthop
is actually acceptable.
OK tb@
|
|
Passing the peer description as part of the format string was a bad idea
since the peer description may include some % signs (e.g. for link local
IPv6 addresses). So instead of asprintf a new fmt string use vasprintf
to get the message and then use logit("%s: %s", peer_info, msg).
OK tb@
|
|
|
|
path is actually eligible. If this is not the case pass NULL instead.
This is an optimisation to bypass extra work if both old and new path
were ineligible.
OK tb@
|
|
This should fix a fatal error reported by Arend Brouwer (arend at eritap com)
when "announce add-path send all" is used.
As a workaround "announce add-path send best plus 500" can used.
OK tb@
|
|
|
|
ext-communities was put into the wrong place in the loop finding
start, end and number of communities to dump. As a result the end
pointer for regular communities can point at an ext-community and
with that the COMMUNITY attribute written includes unexpected extra
bytes. This in turn causes the peer to send a NOTIFICATION error
and to terminate the session.
Fix for -portable issue #64 reported by Pier Carlo Chiodi (pierky)
OK tb@
|
|
The code in get_alternate_addr() checked for sa_cmp() == 0 but actually
sa_cmp() returned 1 for equal addrs. So rename the function to sa_equal()
to make it clear that a true return value means equality.
Found by Asa Yeamans (enigma2e at rivin net)
OK tb@
|
|
|
|
bgpctl before calling strlcpy() with that string.
OK tb@ some long time ago
|
|
can be used in -portable for features that are not available in the build.
OK tb@
|
|
OK claudio@
|
|
With draft-ietf-sidrops-aspa-profile-16 and
draft-ietf-sidrops-aspa-verification-15 the AFI dependence of ASPA
records was dropped. So remove this complication form the code.
This only removes the AFI handling internally in bgpd but still allows
the old syntax in aspa-set tables. The optional address family is just
ignored and records are merged together.
For RTR sessions draft-ietf-sidrops-8210bis has not yet been updated so
right now we still handle RTR sessions as specified there. The IPv4 and
IPv6 ASPA entries are handled in two trees and merged together into one
AFI independent tree. This is the best we can do for now until IETF
updates draft-ietf-sidrops-8210bis.
OK tb@ job@
|
|
peer matching code to only match at maximum sizeof(n->descr) bytes
using strncmp().
OK tb@
|
|
OK tb@
|
|
them with direct calls to for example ibuf_add_n16(). Further cleanup
the error handling and use goto fail in most places. Remove many of the
error messages and combine all the possible ibuf errors in one place.
For this remove most warnings from internal functions (also mark all
internal helper functions with static to make that more obvious).
There are still some cases where an error will result in to warnings but
those errors are unreachable in normal operations.
OK tb@
|
|
This replaces the old way of using a static buffer and a len to build
UPDATEs with a pure ibuf solution. The result is much cleaner and a lot
of almost duplicate code can be removed because often a version for ibufs
and one for this static buffer was implemented (e.g. for mrt or bgpctl).
With and OK tb@
|
|
a treat-as-withdraw consume the full attribute by updating plen else the
parser will fail parsing a possible next element which results in a
session reset.
Initial report by Ben Cox (ben at benjojo.co.uk)
OK tb@
|
|
|
|
Problem reported by Moyaze Shivji
OK tb@ job@
|
|
for IMSG_CTL_SHOW_RIB_ATTR. Also drop the attr_optlen() usage in
imsg_create() since it is not stricly needed. With this attr_optlen
follows the path of the dodo.
OK tb@
|
|
OK tb@
|
|
On multipath routes the check ended up checking the wrong route for the
nexthop update. This resulted in a use-after-free in kroute_detach_nexthop().
This only affects IPv6 in the IPv4 code path the right object was already used.
Thanks to sthen@ for providing the debug information to track this down.
OK sthen@ tb@
|
|
the remaining data around.
There is an improbable case where a NOTIFICATION is received while also
reaching the MSG_PROCESS_LIMIT. In this case rbuf is NULL when breaking
out of the for loop and hitting this code.
sthen@ is the (un)lucky person to hit that improbable case
OK tb@ sthen@
|
|
Up until recently filterset_copy() was only used in the parent process
where none of those references exist but by using filterset_copy() in
the RDE to populate per-peer output filters the code needs to handle
such references. Without this rules like 'match to any set nexthop X'
will cause internal corruption on config reloads and session resets.
Bug report from Marko Cupac (marko.cupac (at) mimar.rs)
OK tb@
|
|
OK tb@
|
|
setting the size to 64k was increasing the size but now auto-scaling
could grow the buffer size much more. The origianl idea was that sessions
without protection had a small window size to make window attacks
harder. This problem was fixed long time ago and is no longer relevant.
Limiting the buffer size to a reasonable size ensures that not too many
updates end up queued in the TCP stack.
OK benno@ (some time ago)
|
|
|
|
Right now these are not reachable. Should also clear some gcc warnings.
OK tb@
|
|
Needed for bison.
|
|
prefix/rib dump functions.
OK tb@
|
|
introduced with flowspec.
OK tb@
|
|
|
|
OK tb@
|
|
ASPA provider AS sets can include optional limitations to inet/inet6 these
limits are represented in the TAS_AID bit masks (2bits per AS).
Introduce a TAS_AID_SIZE() makro that returns the size in bytes of this
bit mask (rounded to the next uint32_t).
Without this change aspa objects with AID specific elements trigger a
fatal error condition when the config is loaded.
OK tb@ job@
|
|
IMSG_FLOWSPEC_ADD and IMSG_FLOWSPEC_REMOVE received from bgpctl via SE.
OK tb@
|
|
Input and OK jmc@ tb@
|
|
order.
|