1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00
Commit Graph

2663 Commits

Author SHA1 Message Date
claudio
477ac4f17e Improve some currently impossible error path in log_ext_subtype().
Mainly handle unknown ext-communities better and handle the special
case of type == -1.
OK tb@
2024-09-30 12:54:12 +00:00
claudio
bc3692b580 In bgpd_rtr_connect() do the setsockopt dance for IP_TOS and TCP_NODELAY
before calling connect(). This way it happens for sure and on top the TOS
is already set on the initial SYN.
OK tb@
2024-09-30 09:42:24 +00:00
claudio
6c19f566ed When generating UPDATE handle the message size limit better.
First of all warn that a prefix was dropped. In the generate an update
code handle possible overflows of attributes and NLRI and withdraw the
affected prefix. This way the peer will not have stale data.
OK tb@
2024-09-25 14:46:51 +00:00
jsg
479c151d34 remove unneeded semicolons; checked by millert@ 2024-09-20 02:00:46 +00:00
claudio
e386eeb169 Be more careful with aspath that have 0 length (aka the empty AS_PATH).
Again malloc(0) is not portable and calling memcpy with a NULL pointer
and a 0 length is not allowed by the C standard.

OK tb@
2024-09-10 09:38:45 +00:00
claudio
07ef39656b community_copy needs to check if nentries is 0 and handle that specially.
Calling malloc / reallocarray with a 0 size is not portable and the
memcpy with a possible NULL pointer as source and 0 len is seen as UB
by newer C standards (grmbl).

OK tb@
2024-09-10 08:53:20 +00:00
claudio
e5e5eb1a03 AID_VPN_IPv4 and AID_VPN_IPv6 require a labellen that is non-zero.
OK tb@
2024-09-10 08:47:51 +00:00
claudio
d9facda501 Enfroce proper encoding of ASPA announce/withdraw PDU.
An announce PDU requires at least one provider ASnum while a withdraw
must not include any provider ASnums. The first is mandated by the ASPA
profile and the 2nd by the 8210bis draft.

Further cleanup some leftovers from the old per-AFI split of ASPA.
OK tb@
2024-09-10 08:41:13 +00:00
claudio
c2b3ae36d4 Use reallocarray() instead of recallocarray(), this code does not need the
extra security measures of recallocarray() which adds a lot of overhead.
OK tb@
2024-09-10 08:37:52 +00:00
claudio
457c3e2447 Handle the CLUSTER_LIST attribute as described in RFC7606
Just drop the attribute if received from an external peer.
Treat as withdraw if the len is 0 or not % 4.
OK tb@
2024-09-09 15:00:45 +00:00
claudio
173da11705 There is no need for an explicit size check for IMSG_RECONF_ASPA_TAS
imsg_get_data() does the same and produces the same error.
OK tb@
2024-09-09 14:58:47 +00:00
claudio
6116e163fc Use msgbuf_init() instead of hand initalizing the msgbuf.
OK tb@
2024-09-09 12:59:49 +00:00
claudio
6e684d5963 Bump version 2024-09-05 20:28:42 +00:00
claudio
3e51611556 Qualifying nexthops via BGP does not properly work since nexthops need
to be rechecked when a BGP route is added (or changed).

We need to revalidate nexthops on inserts (kroute_insert) and
on change (krX_change but only for AID_INET and AID_INET6 -- no nexthops
in the other tables) the nexthop needs to be updated.

Only validate nexthops if 'nexthop qualify via bgp' is enabled. For route
changes the code can depend on the F_NEXTHOP flag.

Fix for: https://github.com/openbgpd-portable/openbgpd-portable/issues/81
OK tb@
2024-09-04 15:06:36 +00:00
claudio
7f893e0cba Call pfkey_remove() only after the Session Engine finished reloading its
configuration. Doing so before could result in some messages being sent
out without proper TCP-MD5 signature.

Fix for: https://github.com/openbgpd-portable/openbgpd-portable/issues/82
OK tb@
2024-09-04 13:30:10 +00:00
claudio
c4328fc634 Introduce peer_is_up() and use it instead of peer->state == PEER_UP checks
also enqueue update and rrfresh imsgs only if the peer is up and flush them
once this is no longer the case.
OK tb@
2024-08-28 13:21:39 +00:00
claudio
174b88088d Check the max_prefix and max_out_prefix limit during config reload.
This is cheap and will trigger immediatly instead of waiting until
the next UPDATE happens (which could happen a lot later).
OK tb@ job@
2024-08-28 13:18:11 +00:00
florian
f885c9d92a inet_pton returns 0 and -1 for error.
Adjust the error check that is now wrong after the inet_aton -> inet_pton
conversion.

Noticed by & OK bluhm.
OK tb
2024-08-22 08:17:54 +00:00
florian
b840faef38 Use inet_pton to parse ext-communities with an IPv4 address.
No need for inet_aton's flexibility.
OK claudio
2024-08-21 09:17:05 +00:00
claudio
db359c8123 Use msgbuf_queuelen() instead of accessing wbuf.queue for msgbuf structs.
Also export the msgbuf queue len as a stats member so bgpctl does not need
to dig into the msgbuf structure inside struct peer.
This skips imsg related msgbuf since that will be handled by a imsgbuf
specific function.
OK tb@
2024-08-20 11:59:39 +00:00
claudio
89ee02f7f3 Introduce 'rde rib Loc-RIB include filtered' a feature that includes
filtered prefixes in the Loc-RIB

This includes filtered prefixes into the Loc-RIB but they are marked
ineligible so nothing will select them but it is possible to show them
in bgpctl. So 'bppctl show rib filtered' will return all prefixes filtered
out by the input filters.

OK tb@
2024-08-14 19:09:51 +00:00
claudio
d87cfbcc05 Add 'min-version' RTR config option and default to RTR version 1 by default.
The min-version pins a minimal required version for rtr session. This is
needed if specific PDUs are required and it ensures that the session is
not suddenly downgraded. This is important for ASPA where a minimum
version of 2 is required. Only then the ASPA PDUs are transmitted.

By default a RTR version of 1 is used but setting min-version to 2
will enable draft-ietf-sidrops-8210bis-14 support and enforce it
at the same time. Right now defaulting to version 2 is not possible
since draft-ietf-sidrops-8210bis failed to progress for a too long
time resulting in split eco system with various incompatible RTR
version 2 implementations.

OK tb@
2024-08-12 09:04:23 +00:00
claudio
b0ea642a7b Remove the ibuf_size(pdu) % sizeof(uint32_t) == 0 since it is already
done in rtr_parse_header(). No need to do it twice.
2024-08-09 14:00:48 +00:00
claudio
228f6bd1a1 Adjust RTR ASPA pdu parser to draft-ietf-sidrops-8210bis-14 which finally
adjusted the pdu to follow the other ASPA drafts.
OK tb@
2024-08-09 13:52:09 +00:00
job
9a8ba155e2 Fix typo
Reported by Marco D'Itri
2024-07-03 08:39:43 +00:00
claudio
58086f61c2 Bump version 2024-06-26 08:28:45 +00:00
claudio
a48c3ad520 When filling prefixes with pt_writebuf() keep 2 bytes reserved in the
withdraw case. Those bytes are needed for the attribute length field.
Without this withdraw messages can become overfull and are dropped
without notice.

Problem found and fix tested by denis@
OK denis@ tb@
2024-06-25 13:21:18 +00:00
claudio
3dbf4d6d62 In get_alternate_addr() consider sessions to IPv6 link-local addresses
as connected (they are so by definition).

Issue reported by Jason Tubnor ( Jason.Tubnor (at) lchs.com.au )
OK tb@
2024-06-10 12:51:25 +00:00
claudio
de634ddda8 Fix copy-paste error in last commit. Fixes lladdr and l3vpn regress.
Noticed by anton@
2024-05-30 08:29:30 +00:00
claudio
cd5e2f786e Handle IPvX only interfaces with IPvY sessions more gracefully.
In up_get_nexthop() check that the local_vX_addr is actually valid
before using it. In the UPDATE generation functions check that the
nexthop is valid before adding it and fail hard if it does not exist.
You can't announce an IPv4 prefix/gateway over an IPv6 only link.
OK henning@ sthen@
2024-05-29 10:41:12 +00:00
claudio
0e946de2e9 Only fall back to the default IPv4 unicast mode if there was no MP
capability neither from our side not the remote end.

Also track unknown AFI/SAFI combos for the remote end in AID_UNSPEC
this way even unknown combos will prevent a fall back.
OK henning@ sthen@
2024-05-29 10:38:24 +00:00
claudio
1ebe6b99eb Remove nexthop_compare() prototype.
OK henning@ sthen@
2024-05-29 10:36:32 +00:00
claudio
cb510c7b2d Rename nexthop_compare to nexthop_cmp and make it static inline.
OK henning@ sthen@
2024-05-29 10:34:56 +00:00
claudio
9ad78aa8fb Introduce a ring buffer for log_sockaddr() this way log_addr() can be
used more then once in a log message (e.g. log_peer_warnx + log_addr.
OK henning@ sthen@
2024-05-29 10:34:07 +00:00
claudio
bcd6516ba4 Convert bgpid, remote_bgpid and clusterid to host byte order.
Before the RDE used host byte order for remote_bgpid but all the other
code used network byte order. The reason for that was that bgpid was
initially an IPv4 address but since RFC 6286 in 2011 this is much more
relaxed and so it makes more sense to just treat them as numbers and
so host byte order.

OK tb@
2024-05-22 08:41:14 +00:00
claudio
5149f89075 Convert more of the session engine parsers to the new ibuf API
This converts OPEN and it capability parser and RREFRESH and with that
all packet parser are kind of converted. There is still parse_header()
and the general packet handling that needs some work now so that all
the ugly ibuf_from_buffer() can be dropped.
OK tb@
2024-05-20 10:01:52 +00:00
claudio
9db223a96e Tabs on empty line 2024-05-20 10:00:00 +00:00
jsg
85ba9220c9 remove prototypes with no matching function 2024-05-19 03:31:05 +00:00
jsg
088a2cd995 remove prototypes with no matching function; ok claudio@ 2024-05-18 11:17:30 +00:00
claudio
4a323eb5ee Simplify the code to clamp the TCP send and recv buffer to 64k.
We don't really care if it works or not and we don't want to clamp it
down further then 64k. So just call setsockopt() once and ignore the error.
OK tb@ sthen@
2024-05-16 09:38:21 +00:00
job
f7421e0736 Mark RTR and IPv6 BGP packets with DSCP CS6 (network control)
Additionally, set TCP_NODELAY on the RTR socket, there is no need to
queue up messages towards the RTR server.

OK claudio@
2024-05-15 09:09:38 +00:00
claudio
8ead1a30b8 Remove 'announce capabilities' as neighbor config stanza.
There is no need to have an easy knob to get outdated or crappy
implementations to limp along. Instead the various default on
capabilities just need to be disabled (e.g. announce as-4byte no).

OK tb@
2024-04-24 10:41:34 +00:00
claudio
91834cfda1 In state IDLE handle EVNT_STOP and stop the IdleHold timer. This way
a down of an idle connection will properly stop the session.

OK tb@ (as part of larger diff)
2024-04-22 09:43:11 +00:00
claudio
3a82eff3de Move setting of the shutdown reason to session_stop()
Also make sure that something is logged when a session is stopped.
Part of a bigger diff which was OK tb@
2024-04-22 09:36:04 +00:00
claudio
096630734c No longer fall back to no capabilities when there is an OPEN/optional
attribute error.

BGP more and more relies on capabilities, automatically clearing them
all no longer seems the right choice. Now operators need to adjust the
config explicitly to allow such connections.
From a larger diff which is OK tb@
2024-04-22 08:53:59 +00:00
tb
e961ca10cf Remove repeated type declaration that makes bison unhappy
Fixes: https://github.com/openbgpd-portable/openbgpd-portable/issues/77

ok claudio
2024-04-11 18:07:55 +00:00
claudio
02c3cfbc8c Use != NULL for pointer check. No binary change. 2024-04-11 08:33:15 +00:00
claudio
8768446ca0 Rework the logic to not send double notifications in session_notification().
last_sent_errcode is now cleared late (when state changes to ESTABLISHED)
and so notifications sent in the OPEN phase would be dropped after the
first incident. Using the session state to know if sending a message is
possible seems more robust and is what session_stop() uses as well.
For now log the notification which are not sent as 'dropping' to see how
often this happens.

OK tb@
2024-04-10 09:05:32 +00:00
claudio
0ff3951c80 Limit the number of provider ASnumbers to MAX_ASPA_SPAS_COUNT (10'000)
in the parser as well.

OK tb@
2024-04-09 12:40:01 +00:00
claudio
623585da7a Increase RTR PDU limit to 48k and limit number of SPAS to 10'000.
PDU larger then 48k will result in a session reset while ASPA records
with more than 10'000 entries will be implicitly withdrawn.

Also truncate RTR error PDUs to only include 256 bytes of the faulty PDU.
It makes no sense to include more to identify the issue.
OK tb@
2024-04-09 12:09:19 +00:00
claudio
bb1a6d1a5c Check that the ASPA tas array fits in an IMSG before sending the ASPA
record over to RTR or the RDE.

The long term goal is to increase the IMSG size considerably but that
requires some additional API changes to the imsg API.
OK tb@
2024-04-09 12:05:07 +00:00
claudio
4b1bc0cbc5 Allow operators to enforce the presence of certain capabilities on sessions.
For simple capabilities this just adds enforce to the yes/no option of the
announce statement. For multi-protocol capabilities and add-path there is
an extra keyword. On top of this for add-path the enforcement requires the
neighbor to send a matching capability, e.g
'announce add-path recv enforce' requires the other side to send any
'announce add-path send XYZ' capability.

This is mainly to enforce as-4byte and extra multi-protocol capabilities.

OK denis@ tb@
2024-04-09 09:03:18 +00:00
claudio
18589ef5b0 Rewrite str2key() to not use strtoul() to convert 2 hexdigits into one
char. Instead use a simple function to do the conversion per nibble.
OK deraadt@ tb@
2024-04-03 08:57:26 +00:00
claudio
47d273e883 Move the SendHoldTimer code into start_timer_sendholdtime() and ensure
the timer is stopped if HoldTime is 0.
OK tb@
2024-03-26 12:45:29 +00:00
claudio
eff7ddaf53 Rework the cease shutdown reason to work in both directions by looking
at the ibuf payload passed to log_notification().
Because of this move ibuf_get_string() and the log_notification() call
in parse_notification().
OK tb@
2024-03-22 15:41:34 +00:00
claudio
beb044e947 Rework parse_notification() to use the ibuf API for everything.
While there fix the RFC5492 handling of ERR_OPEN_CAPA (the current code
has the logic inversed). ERR_OPEN_CAPA is there to signal that a needed
capability is missing in our OPEN message. Just add the handling of
ERR_OPEN_CAPA to log_notification().

Also rework the handling of the shutdown reason and move the printing
into log_notification().

OK tb@
2024-03-22 07:19:28 +00:00
claudio
110c1584e6 Cleanup AID handling.
- Loops over all valid AID should start with AID_MIN and go up to AID_MAX - 1
   e.g. for (i = AID_MIN; i < AID_MAX; i++)
  If for some reason AID_UNSPEC must be handled make that explicit in the
  for loop.

- aid2afi() now returns an error for AID_UNSPEC since there is no valid
  AFI SAFI combo for AID_UNSPEC.

- Add additional checks for AID_MIN where currently only AID_MAX was checked.
  This affects imsg for route refresh and graceful restart.

- Simplify add-path capability handling. Only the negotiated add_path capa
  sets the flag for AID_UNSPEC to help code to quickly check if any add-path
  is active.

OK tb@
2024-03-20 09:35:46 +00:00
claudio
3adb47df1f Typecast char argument to isxdigit() to unsigned char since isxdigit()
only works that way correctly.
OK deraadt@
2024-03-18 14:54:52 +00:00
claudio
7578d2982d Double PEER_DESCR_LEN to 64 characters since 32 is a bit on the short side.
OK sthen@, deraadt@, dlg@, tb@
2024-03-18 10:49:24 +00:00
claudio
f822ad641a Use same markup for origin-set arguments as for roa-set. The maxlen argument
is optional.
OK tb@
2024-03-18 10:16:50 +00:00
claudio
c5f5d4ca5c Bump version 2024-03-01 16:23:37 +00:00
miod
2fd9f52d7a Workaround for gcc3 - the use of anonymous unions now makes it complain
when named initializers use fields within these anonymous unions.

Hopefully a short-term bandaid until the appropriate changes are identified
and backported to gcc3.

ok claudio@
2024-02-22 06:45:22 +00:00
job
66500b2f77 IANA assigned error 8 to draft-ietf-idr-sendholdtimer
https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-parameters-3

OK claudio@
2024-02-19 10:15:35 +00:00
claudio
660f4b3c4e Use an C99 anonymous union inside struct bgpd_addr
This kills the two far to generic v4 and v6 macros which is a big win.
OK tb@
2024-02-13 16:35:43 +00:00
claudio
b6c0962af4 Remove IMSG_SESSION_DOWN handler in the session engine. The RDE does
not issue such imsgs.
OK tb@
2024-02-13 16:12:37 +00:00
jsg
4b4f2e389e fix off-by-one in bounds check
found by "buffer overflow 'peer->capa.add_path' 7 <= 7" smatch error
ok claudio@
2024-02-03 09:26:52 +00:00
jsg
470fe335ce add missing fatal() call in rde_peer_send_rrefresh()
found by "if statement not indented" smatch warning
ok claudio@
2024-02-03 00:11:34 +00:00
claudio
4ac10ff8d8 aspath_inflate() can be called with an empty ASPATH.
In this case ibuf_size(in) is 0 and the ibuf_open() fails because
right now 0 sized ibufs are not allowed. Add + 1 to the size calculation
as a workaround.
OK tb@
2024-02-02 16:14:51 +00:00
claudio
e83bb2c891 Cleanup a couple of fatal messages to be less bad. 2024-02-02 16:10:33 +00:00
claudio
04349dff7d Convert he ATTR_ASPATH and ATTR_AS4_PATH handlers in rde_attr_parse()
to new ibuf API.

Various aspath functions are modified to work better with ibufs.
aspath_inflate() now only works with ibufs and is a lot simpler.
aspath_verify() does all the checks using the ibuf api and therefor
most length checks can be skipped.
aspath_asprint() and the new internal aspath_strsize() and aspath_snprint()
are totally overhauled -- including some bugs that got squashed.
OK tb@
2024-01-30 13:50:08 +00:00
claudio
6a5cf36aa8 Use RFC7606 treat-as-withdraw for ORIGIN attributes with an invalid value.
OK tb@
2024-01-25 11:13:35 +00:00
claudio
7094370e53 Convert most attributes in rde_attr_parse() to new ibuf API.
This skips ATTR_ASPATH and ATTR_AS4_PATH for now, those will follow soon.
Reshuffle checks a little bit. While ibuf_get does ensure that enough data
is available do a precise size check to ensure that only the expected amount
of data is available.

OK tb@
2024-01-25 09:46:12 +00:00
claudio
b3b1d93975 Convert the community parsers to the new ibuf api.
This converts community_add(), community_large_add() and community_ext_add()
and as a result removes some hacks from rde_attr_add() and rde_attr_parse().
OK tb@
2024-01-24 14:51:11 +00:00
claudio
5c4d2233d5 Start converting the message parser to use the new ibuf api.
Rewrite rde_update_dispatch() to use ibufs. Because of this
rde_update_err(), rde_get_mp_nexthop(), nlri_get_prefix() and
friends are switched to use ibufs. For rde_attr_parse() a minimal
change was done for now.

OK tb@
2024-01-23 16:13:35 +00:00
claudio
504b006644 Fix tab after space 2024-01-23 16:08:35 +00:00
claudio
1f53ead5c4 KNF, space before EOL 2024-01-23 15:59:56 +00:00
claudio
99074c6d91 Split cases and call peer_stale() individually instead of using a
conditional argument.
OK tb@
2024-01-23 14:39:10 +00:00
claudio
25d70ad5a6 Convert IMSG_UPDATE and session_update() to new imsg API and ibufs.
OK tb@
2024-01-18 14:56:44 +00:00
claudio
d1ecb0c527 Fix IMSG_RECONF_ASPA handling. The rde did not expect what the rtr process
was sending and hit the error path because of that. Since the encoding
as two uint32_t in rtr.c is awkward use the same way that the parent is
sending the aspa sets. This uses a local copy so that the included expire
filed is forced to 0 (the RDE does not use that field).
OK tb@
2024-01-18 09:39:36 +00:00
claudio
ebae4308b4 Switch session_notification() over to use a struct ibuf to carry the
extra data. With this IMSG_UPDATE_ERR can use the new imsg API.

Introduce session_notification_data() for the few cases where there
is no ibuf readily available.

OK tb@
2024-01-16 13:15:31 +00:00
claudio
d8eba67b8a Convert the simple bits of imsg handling over to the new imsg API.
OK tb@
2024-01-15 15:44:50 +00:00
claudio
a62144a242 A cache can send a 'NO_DATA_AVAILABLE' error during version negotiation
so handle this case as well. This error triggers an RTR_EVNT_NO_DATA
event that moves the session to RTR_STATE_ESTABLISHED (and out of negotiation).

When there is no data available the session_id remains unset until data
becomes available. So handle this case not only in rtr_parse_cache_response()
but also in rtr_parse_notify().

RTR_EVNT_NO_DATA arms the RTR_EVNT_TIMER_RETRY timer. On expiry send a
reset or serial query depending on the cache session state.

OK tb@
2024-01-15 11:55:26 +00:00
claudio
ba323c9d8a Convert the simple IMSG calls in session.c to the new imsg API.
OK tb@
2024-01-12 11:19:51 +00:00
claudio
c8f6e08e2a rename field ibuf to imsgbuf in struct ctl_conn
OK tb@
2024-01-11 15:46:25 +00:00
claudio
047cb73c25 Clear the last errors after receiving a RTR_EVNT_END_OF_DATA event.
Once the cache is synced we can assume that the errors are no longer
relevant.
OK tb@
2024-01-11 15:38:05 +00:00
claudio
41ac09096b Clear the last_sent_errcode, last_rcvd_errcode and last_reason when
the session comes up instead of at the start of a connect.
With this the last errors reported should stick around longer.
Reported by linx.net, OK job@
2024-01-11 14:11:03 +00:00
claudio
33c734718e Export the rtr session state as string.
OK tb@
2024-01-11 13:08:39 +00:00
claudio
125ef3d536 Try to improve RTR version negotiation.
RFC8210 and especially draft-ietf-sidrops-8210bis are underspecified when
it comes to inital version negotiation. The authors seem to have a very
different view on how this works compared to the various RTR cache
implementations.

Reducing the version on any session close is a problem since it often leads
to downgraded sessions where not needed. Instead require the server to send
PDUs with their correct version (either a code 4 error, a cache response
or cache reset pdu).

Extensively tested against various modes of StayRTR.
Also tested against routinator which is currently not following the spec
(https://github.com/NLnetLabs/routinator/issues/919) and breaks on unknown
versions.

This is probably not the last change to make RTR version negotiation work
but it is a step in the right direction.

OK tb@
2024-01-11 11:43:07 +00:00
claudio
9dad73886d Improve rtr_send_error() so that there is no need to log_warnx() before.
Now rtr_send_error() supports a format string for the error message so
use this fact to make the error report better.

OK tb@
2024-01-10 16:08:36 +00:00
claudio
6290e740bb Implement log_roa() and log_aspa() and use these functions in printconf.c
OK tb@
2024-01-10 13:31:09 +00:00
claudio
0b920bb90a Update the control.c code to use the new imsg API.
OK tb@
2024-01-10 11:08:04 +00:00
claudio
0d6339a20f The End of Data PDU changed between v0 (RFC6810) and v1 (RFC8210).
Add struct rtr_endofdata_v0 and rtr_parse_end_of_data_v0() to handle this
oddity. With this bgpd supports RFC6810 and RFC8210 and some form of
draft-ietf-sidrops-8210bis

OK tb@
2024-01-09 15:13:49 +00:00
claudio
964d6687de rtr_parse_notify() state check is special since we ignore the PDU when
it arrives in a strange moment. The RFC is as helpful about this as one
could expect. Still I botched the state check and later added an
rtr_send_error() call which made the previous worse.
OK tb@
2024-01-09 14:43:41 +00:00
claudio
4fa7a5b4af Be more consistent with RTR parse error reporting.
Stop calling rtr_send_error() after a parse error in rtr_process_msg();
instead move the calls into the parse functions.
Use consistend and useful error text to most rtr_send_error() calls.
In parse header also check the minimal version for router key and ASPA pdus
before checking their length.

OK tb@
2024-01-09 14:15:15 +00:00
claudio
be25e90dc9 Convert the parent process imsg handling over to the new imsg API.
This simplifies the code a fair bit and removes direct unchecked memory
access to imsg.data.
OK tb@
2024-01-09 13:41:32 +00:00
claudio
37149e4fa8 Rework rtr_parse_header() and introduce rtr_check_session_id() to make
the initial header parsing simpler.
This also allows to simplify the version negotiation dance a bit. More
is needed there.
OK tb@
2024-01-08 16:39:17 +00:00
claudio
9150415584 Define and use struct ctl_kroute_req to encode the arguments of
IMSG_CTL_KROUTE instead of doing it by hand.
OK tb@
2024-01-08 15:08:34 +00:00
claudio
fba72c1056 Improve rtr_send_error() logging and demote the FSM state changes from
log_info to log_debug.
OK tb@
2024-01-05 11:02:57 +00:00
claudio
ed5572f8e0 Rewrite the imsg handling using the new API functions.
OK tb@
2024-01-04 16:38:18 +00:00
claudio
b1793e8cdc Convert the RTR PDU parser to use the new ibuf API.
Lenght / overflow checks are now handled by ibufs.
OK tb@
2024-01-04 14:30:09 +00:00