OpenBSD CVS

CVS log for src/usr.sbin/bgpd/rde.h


[BACK] Up to [local] / src / usr.sbin / bgpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.303 / (download) - annotate - [select for diffs], Wed May 29 10:36:32 2024 UTC (10 days, 10 hours ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.302: +1 -2 lines
Diff to previous 1.302 (colored)

Remove nexthop_compare() prototype.
OK henning@ sthen@

Revision 1.302 / (download) - annotate - [select for diffs], Wed May 22 08:41:14 2024 UTC (2 weeks, 3 days ago) by claudio
Branch: MAIN
Changes since 1.301: +2 -2 lines
Diff to previous 1.301 (colored)

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@

Revision 1.301 / (download) - annotate - [select for diffs], Sun May 19 03:31:05 2024 UTC (2 weeks, 6 days ago) by jsg
Branch: MAIN
Changes since 1.300: +1 -5 lines
Diff to previous 1.300 (colored)

remove prototypes with no matching function

Revision 1.300 / (download) - annotate - [select for diffs], Sat May 18 11:17:30 2024 UTC (3 weeks ago) by jsg
Branch: MAIN
Changes since 1.299: +1 -6 lines
Diff to previous 1.299 (colored)

remove prototypes with no matching function; ok claudio@

Revision 1.299 / (download) - annotate - [select for diffs], Wed Jan 24 14:51:12 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.298: +4 -5 lines
Diff to previous 1.298 (colored)

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@

Revision 1.298 / (download) - annotate - [select for diffs], Tue Jan 23 16:13:35 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.297: +2 -9 lines
Diff to previous 1.297 (colored)

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@

Revision 1.297 / (download) - annotate - [select for diffs], Mon Oct 16 10:25:46 2023 UTC (7 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.296: +2 -1 lines
Diff to previous 1.296 (colored)

Improve IPv6 link-local address handling

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@

Revision 1.296 / (download) - annotate - [select for diffs], Wed Aug 16 08:26:35 2023 UTC (9 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.295: +4 -6 lines
Diff to previous 1.295 (colored)

Remove per-AFI ASPA handling in bgpd internals

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@

Revision 1.295 / (download) - annotate - [select for diffs], Wed Jul 12 14:45:43 2023 UTC (10 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.294: +5 -11 lines
Diff to previous 1.294 (colored)

Update OpenBGPD to use new ibuf API.

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@

Revision 1.294 / (download) - annotate - [select for diffs], Mon Jun 12 12:48:07 2023 UTC (11 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.293: +1 -3 lines
Diff to previous 1.293 (colored)

Use attr_writebuf() instead of hand rolling a more complicated version
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@

Revision 1.293 / (download) - annotate - [select for diffs], Wed Apr 19 13:23:33 2023 UTC (13 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.292: +12 -1 lines
Diff to previous 1.292 (colored)

Implement a way to announce flowspec rules without hitting Adj-RIB-In
and Loc-RIB. Flowspec objects are collected in a single flowrib RIB
and then directly distributed into the various Adj-RIB-Outs.
For this to work add a bypass in the filter logic (flowspec AFI/SAFI
are currently accepted without any rule). The filter language lacks
a way to allow prefixes based on AFI/SAFI which is the minimum needed.
OK tb@

Revision 1.292 / (download) - annotate - [select for diffs], Wed Apr 19 07:09:47 2023 UTC (13 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.291: +4 -1 lines
Diff to previous 1.291 (colored)

Extend the pt_entry api to handle flowspec.
Introduce pt_get_flow() and pt_add_flow() to lookup and insert flowspec
objects. Add pt_getflowspec() which works somewhat similar to pt_getaddr()
to extract the flowspec NLRI from a pt_entry.
Make pt_getaddr() to return the destination prefix of the flowspec rule and
handle flowspec in pt_write().
OK tb@

Revision 1.291 / (download) - annotate - [select for diffs], Fri Apr 7 13:49:03 2023 UTC (14 months ago) by claudio
Branch: MAIN
Changes since 1.290: +3 -2 lines
Diff to previous 1.290 (colored)

Pass a pt_entry pointer to rib_get() and rib_add().
Add rib_get_addr() to behave like rib_get() did before.
OK tb@

Revision 1.290 / (download) - annotate - [select for diffs], Thu Mar 30 12:11:18 2023 UTC (14 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.289: +3 -2 lines
Diff to previous 1.289 (colored)

Put the size of the pt_entry object into the struct itself.

Increase the refcnt to a 32bit int and while there reorder the vpn
specific structs a bit so the IPv4 and IPv6 types are more equal.

OK tb@

Revision 1.289 / (download) - annotate - [select for diffs], Wed Mar 29 10:46:11 2023 UTC (14 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.288: +7 -6 lines
Diff to previous 1.288 (colored)

Switch prefix_adjout_get and new prefix_adjout_first to use a pt_entry
as argument instead of the bgpd_addr + prefixlen.

Do the same with prefix_adjout_update but leave prefix_adjout_lookup
and prefix_adjout_match since those are used by bgpctl code that does
not use pt_entry structs.

With this most of the update code no longer needs struct bgpd_addr and
pt_getaddr().
OK tb@

Revision 1.288 / (download) - annotate - [select for diffs], Tue Mar 28 15:17:34 2023 UTC (14 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.287: +3 -3 lines
Diff to previous 1.287 (colored)

Instead of exracting the prefix into a bgpd_addr and passing that to
prefix_write() rename prefix_write() to pt_write() and pass a pt_entry to
the function. Removes an extra conversion step.
OK tb@

Revision 1.287 / (download) - annotate - [select for diffs], Tue Mar 28 13:30:31 2023 UTC (14 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.286: +2 -43 lines
Diff to previous 1.286 (colored)

More pt_entry cleanup, move structure definitions to rde_prefix.c and
by that make them private. Remove no longer used AID_PTSIZE define.
OK tb@

Revision 1.286 / (download) - annotate - [select for diffs], Mon Mar 13 16:52:42 2023 UTC (14 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.285: +2 -2 lines
Diff to previous 1.285 (colored)

Add F_CTL_LEAKED and F_CTL_INELIGIBLE flags for bgpctl to show leaked
and ineligible paths.
While there rename F_PREF_OTC_LOOP to F_PREF_OTC_LEAK since this indicates
that a route leak was detected.
OK tb@

Revision 1.285 / (download) - annotate - [select for diffs], Fri Mar 10 07:57:15 2023 UTC (15 months ago) by claudio
Branch: MAIN
Changes since 1.284: +14 -15 lines
Diff to previous 1.284 (colored)

Compile the output filter rules into per peer filter rules.

especially on route-servers the output filters are in the hot path so
reducing the number of rules to check has a big impact. I have seen a
25% to 30% speedup in my big IXP testbench.
The output ruleset is applied and copied for each peer during config reload
and when a peer is initially added.
OK tb@

Revision 1.284 / (download) - annotate - [select for diffs], Thu Mar 9 13:12:19 2023 UTC (15 months ago) by claudio
Branch: MAIN
Changes since 1.283: +1 -2 lines
Diff to previous 1.283 (colored)

Major rework of RFC9234 support. My initial interpretation of the RFC was
too conservative. Fixes and changes include:

- add role output to bgpctl, also adjust the capability output.
  Note, this changes the JSON output of neighbors a bit.
- adjust the config parser to enable the RFC9234 role capability when
  there is a role set. iBGP and sessions with no role will not announce
  the role capability.
- adjust the role capability announcement to be only on sessions that
  use either AFI IPv4 or IPv6 and SAFI 1 (AID_INET, AID_INET6).
- if there is an OPEN notification indicating that the role capability
  is bad only disable the capability if it is not enforced.
- Adjust capability negotiation, store remote_role on the peer since
  the neighbors role is no longer needed by the RDE.
- inject the OTC attribute on ingress only for AID_INET and AID_INET6.
  For other AIDs clear the F_ATTR_OTC_LOOP flag.
- Adjust the role logic in the RDE and use the peer->role (local role of
  the system) for all checks. Also remove the check if the role capability
  was negotiated between peers.
- In prefix_eligible() check also if the F_ATTR_OTC_LOOP flag is set.
  The RFC requires that prefixes must be considered ineligible (and not
  treat as withdraw as done before)
- When generating an UPDATE include the OTC attribute unless the AID is
  neither AID_INET or AID_INET6.

Fixes https://github.com/openbgpd-portable/openbgpd-portable/issues/51
Reported by Pier Carlo Chiodi
OK tb@

Revision 1.283 / (download) - annotate - [select for diffs], Mon Feb 13 18:07:53 2023 UTC (15 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.282: +7 -7 lines
Diff to previous 1.282 (colored)

Pass struct rib_entry to rde_generate_updates() instead of struct rib.
With this the newbest and oldbest arguments can go since the infromation
is part of the rib_entry. Especially the prefix in the rib_entry is
always valid so simplify some code in various functions below to use
this information.
OK tb@

Revision 1.282 / (download) - annotate - [select for diffs], Thu Feb 9 13:43:23 2023 UTC (15 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.281: +2 -11 lines
Diff to previous 1.281 (colored)

Instead of relaying struct peer from the SE to the RDE to fill out 10
stat numbers, just send the peerid and have the RDE response with the
stats. The control code will then merge these counters into the real
peer struct and send that to bgpctl. This reduces the number of bytes
sent around a fair bit.
OK tb@

Revision 1.281 / (download) - annotate - [select for diffs], Tue Jan 24 11:28:41 2023 UTC (16 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.280: +27 -4 lines
Diff to previous 1.280 (colored)

Implement ASPA validation and reload logic on ASPA set changes.

For this use the validation state (vstate) in struct prefix and
struct filterstate to store both the ASPA and ROA validity.
Introduce helper functions to set and get the various states for
struct prefix and make sure struct filterstate is also setup properly.
Change the ASPA state in rde_aspath to be AFI/AID and role independent
by storing all 4 possible outcomes. Also add a ASPA generation count
which is used to update the rde_aspath ASPA state cache on reloads.
Rework the rde_aspa.c code to be AFI/AID and role independent. Doing
this for roles is trivial but AFI switch goes deep and is so unnecessary.
The reload is combined with the ROA reload logic and renamed to RPKI
softreload.

OK tb@

Revision 1.280 / (download) - annotate - [select for diffs], Wed Jan 18 17:40:17 2023 UTC (16 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.279: +3 -5 lines
Diff to previous 1.279 (colored)

Use the vstate of the filterstate struct instead of passing an extra copy
to the various prefix update functions.
While there fix a filterstate leak in up_generate_updates().
With and OK tb@

Revision 1.279 / (download) - annotate - [select for diffs], Tue Jan 17 16:09:01 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.278: +11 -3 lines
Diff to previous 1.278 (colored)

Add the needed logic to load the ASPA table from the rtr process into the
RDE. The actual reload logic is missing to keep the diff small.
OK tb@

Revision 1.278 / (download) - annotate - [select for diffs], Thu Jan 12 17:35:51 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.277: +4 -3 lines
Diff to previous 1.277 (colored)

Split rde_filterstate_prep() into three functions.
- rde_filterstate_init(): initialize a filterstate to default values
- rde_filterstate_copy(): copy from a filterstate into a new state object
- rde_filterstate_prep(): set filtersate based on prefix passed as argument.

This makes the code a bit easier to read.
OK tb@

Revision 1.277 / (download) - annotate - [select for diffs], Wed Jan 11 17:10:26 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.276: +5 -4 lines
Diff to previous 1.276 (colored)

Add the validation state to the filterstate struct.
Removes vstate argument from rde_filter().
Rename prefix_vstate() to prefix_roa_vstate().
OK tb@

Revision 1.276 / (download) - annotate - [select for diffs], Wed Jan 11 13:53:17 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.275: +10 -2 lines
Diff to previous 1.275 (colored)

Add ASPA validation functions to the RDE.

This implements ASPA validation based on the current draft. Implementing
this showed various weaknesses in the current ASPA draft which I hope to
fix in the near future.

Unlike the algorithm specified in the draft our version validates the
AS_PATH attribute in a single path doing one or two lookups depending on
the sessions BGP role.

The code is not yet hooked up into the RDE (see the NOTYET blocks).
Missing are reload logic, bgpctl integration and the loading of the
merged ASPA set from the rtr process.

OK tb@

Revision 1.275 / (download) - annotate - [select for diffs], Wed Dec 28 21:30:16 2022 UTC (17 months, 1 week ago) by jmc
Branch: MAIN
Changes since 1.274: +3 -3 lines
Diff to previous 1.274 (colored)

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech

Revision 1.274 / (download) - annotate - [select for diffs], Wed Dec 14 12:37:15 2022 UTC (17 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.273: +20 -4 lines
Diff to previous 1.273 (colored)

Move some basic accessors of aspath to rde.h and make them static inline.
OK tb@

Revision 1.273 / (download) - annotate - [select for diffs], Fri Sep 23 15:49:20 2022 UTC (20 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.272: +6 -2 lines
Diff to previous 1.272 (colored)

Implement a special update generator for add-path send all.

The generic add-path code up_generate_addpath() reevaluates everything
since this is the simplest way to select the announced paths. For add-path
all this is overkill since there is no dependency between prefixes and so
individual prefixes can be handled more efficently.

Extend rde_generate_updates() to pass the current newbest and oldbest
prefixes (for the selected best path) but now also include newpath and
oldpath (which is the prefix that is added/removed/modified).
If newpath or oldpath is set then a single prefix was altered and
up_generate_addpath_all() can just remove or add this prefix.
If newpath and oldpath are NULL than the full list based on newbest
needs to be inserted and any old path/prefix removed in the process.

This improves update generation performance on big route collectors using
add-path all substantially.

OK tb@

Revision 1.272 / (download) - annotate - [select for diffs], Wed Sep 21 10:39:17 2022 UTC (20 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.271: +2 -1 lines
Diff to previous 1.271 (colored)

Adjust pathid_assign() to be much faster in the common case.

Use a per peer path_id_tx to assign to paths received from none add-path
enabled peers. This skips two extra walks of the RIB prefix list and is
a big speed-up when there are many regular sessions. If the session uses
add-path recv then the old way of assigning random path_ids needs to be
used.

With input and OK tb@

Revision 1.271 / (download) - annotate - [select for diffs], Mon Sep 12 10:03:17 2022 UTC (20 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.270: +10 -1 lines
Diff to previous 1.270 (colored)

Introduce tree walkers that only walk a subtree of the RIB.

In some cases only a "small" part of the RIB needs to be looked at. Like
bgpctl show rib 10/8 or-longer that only needs to travers nodes under
10/8 all other RIB entries do not matter. By setting the start node to
the RB_NFIND(10/8) the all nodes below this point can be skipped.
Using prefix_compare() while walking the tree with RB_NEXT() the walker
know when it steps outside of the 10/8 subtree and stops.
With this the or-longer commands become a lot faster.

Looks good to tb@

Revision 1.270 / (download) - annotate - [select for diffs], Thu Sep 1 13:23:24 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.269: +7 -8 lines
Diff to previous 1.269 (colored)

Switch the rde_peer hashtable and peer list to a single RB tree.
Only the RDE used a hashtable for lookups while the session engine
switched from a list to RB tree some time ago.
Use peer_foreach() in the mrt code instead of passing the peer list
as an argument.
OK benno@ tb@

Revision 1.269 / (download) - annotate - [select for diffs], Thu Sep 1 13:19:11 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.268: +1 -3 lines
Diff to previous 1.268 (colored)

This code no longer needs siphash.h and also cleanup some leftover
prototypes and members that were not removed in the previous RB tree
conversions.
OK benno@ tb@

Revision 1.268 / (download) - annotate - [select for diffs], Wed Aug 31 14:29:36 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.267: +2 -5 lines
Diff to previous 1.267 (colored)

Switch the generic attribute cache to an RB tree.
OK benno@ tb@

Revision 1.267 / (download) - annotate - [select for diffs], Tue Aug 30 18:50:21 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.266: +2 -3 lines
Diff to previous 1.266 (colored)

Switch nexthop hash to a RB tree.
OK benno@

Revision 1.266 / (download) - annotate - [select for diffs], Mon Aug 29 18:18:55 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.265: +2 -7 lines
Diff to previous 1.265 (colored)

Instead of a global aspath cache copy the aspath attribute per rde_aspath
struct. It uses a bit more memory but improves performance a lot on really
big systems because aspath_get() becomes a very hot function.
OK tb@

Revision 1.265 / (download) - annotate - [select for diffs], Mon Aug 29 16:44:47 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.264: +4 -6 lines
Diff to previous 1.264 (colored)

Switch the DB of communities collections to a RB tree instead of an
undersized hash table.
OK tb@

Revision 1.264 / (download) - annotate - [select for diffs], Mon Aug 29 16:43:07 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.263: +2 -8 lines
Diff to previous 1.263 (colored)

Switch rde_aspath to a RB tree instead of a hash table.
OK tb@

Revision 1.263 / (download) - annotate - [select for diffs], Fri Aug 26 14:10:52 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.262: +3 -3 lines
Diff to previous 1.262 (colored)

Handle IMSG_SESSION_* messages immediatly when received and do not put
them on the per peer imsg queue. This is mainly for IMSG_SESSION_DOWN.
Delaying the session down can race against IMSG_SESSION_ADD which is
handled immediatly and as a result an establised connection may be
removed in the RDE because of it.
The various graceful restart imsgs need similar treatment for similar
reasons. In the end when a session is reset/closed the RDE needs to
stop all work and flush the per peer imsg queue.
With this only update and route refresh messages are handled via the
imsg queue.
OK tb@

Revision 1.262 / (download) - annotate - [select for diffs], Wed Aug 3 08:56:23 2022 UTC (22 months ago) by claudio
Branch: MAIN
Changes since 1.261: +2 -2 lines
Diff to previous 1.261 (colored)

Add comment that NEXTHOP_FLAPPED is only set on oldstate of a nexthop.

Revision 1.251.2.1 / (download) - annotate - [select for diffs], Mon Aug 1 11:02:16 2022 UTC (22 months, 1 week ago) by tb
Branch: OPENBSD_7_1
Changes since 1.251: +12 -2 lines
Diff to previous 1.251 (colored) next main 1.252 (colored)

Properly handle nexthop state changes in the decision process

In rev 1.90 of rde_decide.c the re->active cache of the best prefix was
replaced with a call to prefix_best(). This introduced a bug because the
nexthop state at that time may have changed already. As a result when
a nexthop became unreachable prefix_evaluate() had oldbest = NULL and
newbest = NULL and did not withdraw the prefix from FIB and Adj-RIB-Out.

To fix this store the nexthop state per prefix and introduce
prefix_evaluate_nexthop() which removes the prefix from the decision list,
updates the nexthop state of the prefix and reinserts the prefix. Doing
this ensures that prefix_best() always reports the same result once the
decison process is done. prefix_best() and prefix_eligible() only depend
on data stored on the prefix itself.

from claudio, backport tb

this is patches/7.1/common/008_bgpd.patch.sig

Revision 1.261 / (download) - annotate - [select for diffs], Thu Jul 28 13:11:51 2022 UTC (22 months, 1 week ago) by deraadt
Branch: MAIN
Changes since 1.260: +15 -15 lines
Diff to previous 1.260 (colored)

whitespace found during a read-thru; ok claudio

Revision 1.260 / (download) - annotate - [select for diffs], Mon Jul 25 16:37:55 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.259: +12 -2 lines
Diff to previous 1.259 (colored)

Properly handle nexthop state changes in the decision process

In rev 1.90 of rde_decide.c the re->active cache of the best prefix was
replaced with a call to prefix_best(). This introduced a bug because the
nexthop state at that time may have changed already. As a result when
a nexthop became unreachable prefix_evaluate() had oldbest = NULL and
newbest = NULL and did not withdraw the prefix from FIB and Adj-RIB-Out.

To fix this store the nexthop state per prefix and introduce
prefix_evaluate_nexthop() which removes the prefix from the decision list,
updates the nexthop state of the prefix and reinserts the prefix. Doing
this ensures that prefix_best() always reports the same result once the
decison process is done. prefix_best() and prefix_eligible() only depend
on data stored on the prefix itself.

OK tb@

Revision 1.259 / (download) - annotate - [select for diffs], Mon Jul 11 17:08:21 2022 UTC (22 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.258: +4 -1 lines
Diff to previous 1.258 (colored)

Implement send side of RFC7911 ADD-PATH

This allows to send out more then one path per perfix to a neighbor that
supports add-path receive. OpenBGPD supports a few different modes to
select which paths to send:
  - all:	send all valid paths (the ones with a * in bgpctl output)
  - best:	send out only the single best path
  - ecmp:	send out paths that evaluate the same up and including
                the nexthop metric
  - as-wide-best: send out paths that evaluete the same up but not including
		  the nexthop metric
Currently ecmp and as-wide-best are the same. On top of this best, ecmp
and as-wide-best allow to include extra paths (e.g. best plus 2) and
for the multipath modes there is also a maximum (e.g. ecmp plus 2 max 4)

OK tb@

Revision 1.258 / (download) - annotate - [select for diffs], Fri Jul 8 10:01:52 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.257: +4 -3 lines
Diff to previous 1.257 (colored)

Pass path_id_tx to the Adj-RIB-Out

Adjust prefix_adjout_update() to properly handle path_id_tx.
Move the lookup of the prefix out of prefix_adjout_update() and to
up_generate_updates(). While that code uses prefix_adjout_lookup() to
find the current prefix in the Adj-RIB-Out and add-path aware function
will use prefix_adjout_get().

In up_generate_default() just use 0 for path_id_tx since for this peer
that is the only prefix installed into the Adj-RIB-Out.

OK tb@

Revision 1.257 / (download) - annotate - [select for diffs], Fri Jul 8 08:11:25 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.256: +3 -2 lines
Diff to previous 1.256 (colored)

Assign a local path_id to all prefixes

For add-path a unique path_id needs to be assigne to all prefixes.
Use a random number since the RFC explicitly mentions that there is no
meaning what the value means. The local path_id is inherited to all
the RIBs. Adj-RIB-Out handling is not yet down.
OK tb@

Revision 1.256 / (download) - annotate - [select for diffs], Thu Jul 7 12:16:04 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.255: +9 -2 lines
Diff to previous 1.255 (colored)

Introduce a decision metric (dmetric) that classifies the relation of
this prefix with respect to its previous one.

Currently the plan is to distinguish the best prefix (only one), ecmp
prefixes (currently the same as as-wide-multipath), as-wide-multipath
prefixes, valid prefixes and invalid prefixes.
This information will be used to implement add-path send but also for
ecmp support in bgpd.
OK tb@

Revision 1.255 / (download) - annotate - [select for diffs], Thu Jul 7 10:46:54 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.254: +8 -2 lines
Diff to previous 1.254 (colored)

Refactor the code that generates updates so that up_generate_updates is
only called in one spot.

rde_generate_updates() gets a enum eval_mode argument to discern
the different cases. peer_generate_update() uses the eval_mode to skip
the update if it is not needed.
While there also add an extra AID check in IMSG_REFRESH case to make sure
the requested AID is actually available for this peer.
OK tb@

Revision 1.254 / (download) - annotate - [select for diffs], Mon Jun 27 13:26:51 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.253: +5 -2 lines
Diff to previous 1.253 (colored)

Add support for RFC 9234 - Route Leak Prevention and Detection Using Roles

With this it is possible to send a role in the OPEN message and if that
was successful the RDE will add the new OTC attribute if necessary.
OK tb@

Revision 1.253 / (download) - annotate - [select for diffs], Tue May 31 09:45:33 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.252: +2 -1 lines
Diff to previous 1.252 (colored)

Implement a max communities filter match

When max-communities X is set on a filterrule the filter will match when
more than X communities are present in the path. In other words
max-communities 0 means no communities are allowed and max-communities 3
limits it up to 3 communities.
There is max-communities, max-ext-communities and max-large-communities
for each of the 3 community attributes. These three max checks can be used
together.
OK tb@ job@

Revision 1.252 / (download) - annotate - [select for diffs], Wed May 25 16:03:34 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.251: +2 -2 lines
Diff to previous 1.251 (colored)

Fix non-transitive extended community handling.
First of all the detection logic was totally wrong. Then filter out
non-transitive extended communities when received from an ebgp peer.
Also cleanup the type handling of ext-communities. Mainly to not have
to handle the transitive vs non-transitive versions the type is masked
with EXT_COMMUNITY_VALUE before doing the switch case for the various
types.
With this my test using ext-communities works.
OK tb@

Revision 1.251 / (download) - annotate - [select for diffs], Tue Mar 22 10:53:08 2022 UTC (2 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE
Branch point for: OPENBSD_7_1
Changes since 1.250: +5 -3 lines
Diff to previous 1.250 (colored)

Switch from a LIST to TAILQ for the structure to store prefixes on a
rib_entry. Mostly mechanical, this simplifies prefix_insert() and
prefix_remove() since the redo queue can now just use TAILQ_INSERT_TAIL().
rde_softreconfig_sync_reeval() needs to use TAILQ_CONCAT() to move
the list of prefixes over to the local TAILQ_HEAD to reapply them later.
OK tb@

Revision 1.250 / (download) - annotate - [select for diffs], Mon Mar 21 17:35:56 2022 UTC (2 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.249: +5 -4 lines
Diff to previous 1.249 (colored)

Remove the active prefix cache in struct rib_entry. I need the space
and it also makes less sense to track this with ECMP or add-path.
Replace the re->active access with prefix_best(re) which does the
check on the spot.
Feedback and OK tb@

Revision 1.249 / (download) - annotate - [select for diffs], Mon Mar 21 13:33:20 2022 UTC (2 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.248: +2 -2 lines
Diff to previous 1.248 (colored)

Adjust how RIB are reloaded when their flags (esp. no evaluate) changes.
First flush all affected Adj-RIB-Out and then in a second step re-evaluate
the RIB itself. The no evaluate case becomes simpler. Fix the way
prefixes are re-evaluated, the list remove needs to be explict and not
part of prefix_evaluate() as in most other cases since this list is not
part of the rib_entry.
OK tb@

Revision 1.248 / (download) - annotate - [select for diffs], Tue Mar 15 16:50:29 2022 UTC (2 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.247: +3 -2 lines
Diff to previous 1.247 (colored)

Replace the eor member of struct prefix with a flag. Saves a byte that
will be reused soon.
OK denis@ tb@

Revision 1.247 / (download) - annotate - [select for diffs], Wed Mar 2 16:51:43 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.246: +2 -2 lines
Diff to previous 1.246 (colored)

Adapt prefix_adjout_update() the same way as prefix_adjout_withdraw()
and to the accounting in the function.
OK tb@

Revision 1.246 / (download) - annotate - [select for diffs], Wed Mar 2 14:49:25 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.245: +2 -2 lines
Diff to previous 1.245 (colored)

Correct prefix_adjout_destroy() prototype

Revision 1.245 / (download) - annotate - [select for diffs], Wed Mar 2 14:44:46 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.244: +2 -3 lines
Diff to previous 1.244 (colored)

Refactor prefix_adjout_withdraw()

Just pass the prefix to be withdrawn to the function and move the lookup
up. Adjust how the various accounting vars are updated so that the
values are decremented in the right cases. Do the same accounting dance
for prefix_adjout_destroy(). Adjust rde_up_flush_upcall() to directly
call prefix_adjout_withdraw() without calling it via up_generate_updates().
OK tb@

Revision 1.244 / (download) - annotate - [select for diffs], Fri Feb 25 11:36:54 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.243: +7 -2 lines
Diff to previous 1.243 (colored)

For add-path send the Adj-RIB-Out needs to handle multiple paths per
prefix. For this extend the RB trees of the Adj-RIB-Out to also consider
the path_id. Add functions to lookup a prefix without path_id so that
bgpctl works. Rename functions so that all Adj-RIB-Out specific functions
start with prefix_adjout_

For now the path_id_tx in the Adj-RIB-Out is forced to 0 since
up_generate_updates() is not ready to handle more than one path per prefix.

OK tb@

Revision 1.243 / (download) - annotate - [select for diffs], Sun Feb 6 09:51:19 2022 UTC (2 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.242: +153 -153 lines
Diff to previous 1.242 (colored)

Switch from u_intX_t types to stdint.h uintX_t. Mostly mechanical with
a few reindents.
OK florian@ tb@

Revision 1.242 / (download) - annotate - [select for diffs], Mon Aug 9 08:15:34 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.241: +9 -5 lines
Diff to previous 1.241 (colored)

Implement reception of multiple paths per BGP session. This is one
side of RFC7911 and the send portion will follow.

The path-id is extracted from the NLRI encoding an put into struct
prefix.  To do this the prefix_by_peer() function gets a path-id
argument.  If a session is not path-id enabled this argument will
be always 0. If a session is path-id enabled the value is taken
from the NLRI and can be anything, including 0. The value has no
meaning in itself. Still to make sure the decision process is able
to break a tie the path-id is checked as the last step (this is not
part of the RFC but required).

OK benno@

Revision 1.241 / (download) - annotate - [select for diffs], Tue Jul 27 07:50:02 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.240: +13 -4 lines
Diff to previous 1.240 (colored)

Restructure struct prefix a bit and move the rib pointer to the union
that splits the normal RIB linkage vs the adjrib-out linkage. This is
done to make a bit of space to put an extra add-path related id into
the struct without blowing its size over 128 bytes.
Long run this struct should be split up but the necessary changes are
too large right now so this is the 2nd best option.
OK benno@

Revision 1.240 / (download) - annotate - [select for diffs], Thu Jun 17 16:05:26 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.239: +5 -1 lines
Diff to previous 1.239 (colored)

Implement RFC 7313 enhanced route refresh. It is off by default and
can be enabled with 'announce enhanced refresh yes'
Similar to graceful restart this allows to mark routes as stale, refresh
them and the flush out routes that are still stale. Enhanced route refresh
uses a begin of rr and a end of rr message to signal the various stages.
A future enhancement would be the addition of a timeout in case the EoRR
message is not sent in reasonable time.
OK denis@ job@

Revision 1.239 / (download) - annotate - [select for diffs], Thu May 27 14:32:08 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.238: +3 -2 lines
Diff to previous 1.238 (colored)

Rename and move functions used to get per-peer settings to the
hopefully better names peer_has_as4byte() and peer_accept_no_as_set().
Move them to rde_peer.c where all other peer functions live.
OK sthen@

Revision 1.238 / (download) - annotate - [select for diffs], Thu May 6 09:18:54 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.237: +3 -1 lines
Diff to previous 1.237 (colored)

Improve reload behaviour of RDE peer flags and export_type.

Add an extra reload barrier (IMSG_RECONF_DRAIN) to the sync of the peer
config from the session engine to the rde. Necessary to ensure that the
peer config is up to date in the RDE before hitting reconfiguration.

Store the export_type and the peer flags outside of peer->conf. Adjust all
users of these two fields so they only look at the copies in peer.
During reload check the values with the peer->conf to check for changes.

If the export_type or the rde evaluate or transparent-as flags changed
flush the Adj-RIB-Out for that peer and in a 2nd step rebuild the RIB from
scratch. This results in a lot of UPDATE churn but these configs are not
altered often.

Fix multiple issues in the rde_softreconfig_in_done handler that resulted
in multiple runs of the out stage of the softreconfig pipeline.

OK benno@

Revision 1.237 / (download) - annotate - [select for diffs], Tue Mar 2 09:45:07 2021 UTC (3 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.236: +4 -2 lines
Diff to previous 1.236 (colored)

Introduce 'rde evaluate all' a mode to work around path hiding in IXP
route-server environments.

By default only the best path is sent to peers and if that path is filtered
then the path is hidden for that peer. On route-servers this is sometimes
not desried. For this 'rde evaluate all' will cause the evaluation process
to fall back to alternate routes and will redistribute the first non-filtered
path to the peer. This is very similar to per-peer RIBs but accomplishes
the same effect without the massive increase in memory usage. Compared to
the default mode this requires more CPU resources but it is probably less
than what per-peer RIBs would require.

'rde evaluate all' can be set and reset globally, on groups and on idividual
neighbors. It is not limited to route-server configs but route loops are
possible if not properly used.

OK benno@

Revision 1.236 / (download) - annotate - [select for diffs], Wed Jan 13 11:34:01 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.235: +3 -3 lines
Diff to previous 1.235 (colored)

Extend prefix_evaluate() to also be used when withdrawing a prefix.
Doing the LIST_REMOVE() outside of prefix_evalute() is no longer valid.
As a benefit it is now simply possible to re-evaluate a prefix by passing
it to prefix_evaluate() for both removal and insertion. prefix_evaluate()
will then take care to ensure that a update is sent out if necessary.

Also move rde_send_kroute() call to rde_generate_updates() to make it a
bit easier to plug this module into a regress test.

OK denis@

Revision 1.235 / (download) - annotate - [select for diffs], Fri Dec 4 11:57:13 2020 UTC (3 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.234: +3 -4 lines
Diff to previous 1.234 (colored)

Reference count prefixes added to a pftable. This allows to export
prefixes from multiple sessions into the same table. Before a prefix
was removed from the table on the first withdraw (even though there
was an alternative around).
Requested by, tested and OK dlg@

Revision 1.234 / (download) - annotate - [select for diffs], Fri Jun 5 19:50:59 2020 UTC (4 years ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.233: +1 -2 lines
Diff to previous 1.233 (colored)

Remove redundant code

Reported by Prof. Dr. Steffen Wendzel <wendzel @ hs-worms . de>,
thanks!

OK martijn@ sthen@

Revision 1.233 / (download) - annotate - [select for diffs], Fri Jan 24 05:44:05 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.232: +5 -2 lines
Diff to previous 1.232 (colored)

Implement 'max-prefix NUM out' to limit the number of announced prefixes.
This is an easy safety switch to not leak full tables to upstreams and
peers. If the limit is hit a Cease notification is sent and the session
is closed.
This implements most of https://tools.ietf.org/html/draft-sa-idr-maxprefix-00
OK job@

Revision 1.232 / (download) - annotate - [select for diffs], Thu Jan 9 15:50:34 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.231: +4 -2 lines
Diff to previous 1.231 (colored)

Instead of calling SipHash24_Update() in path_hash for each element of
struct rde_aspath define aspath_hashstart and aspath_hashend and update
all values in one call. Inspired by struct process and its ps_startcopy.
OK deraadt@

Revision 1.231 / (download) - annotate - [select for diffs], Thu Jan 9 14:44:55 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.230: +6 -8 lines
Diff to previous 1.230 (colored)

Clean up header a bit, remove peer_recv_eor and peer_send_eor prototypes
and order prototypes like the functions in rde_peer.c

Revision 1.230 / (download) - annotate - [select for diffs], Thu Jan 9 13:31:52 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.229: +20 -3 lines
Diff to previous 1.229 (colored)

Move peer related code from rde.c to rde_peer.c.
Change peer_foreach() to just walk the peer list instead of iterating over
the peer hash table. Also change peer_down() arguments so that it can be
used as a peer_foreach() callback (which is then used in rde_shutdown()).
OK benno@

Revision 1.229 / (download) - annotate - [select for diffs], Wed Jan 8 18:01:22 2020 UTC (4 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored)

eye burning whitespace

Revision 1.228 / (download) - annotate - [select for diffs], Wed Jan 1 07:25:04 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.227: +10 -1 lines
Diff to previous 1.227 (colored)

Instead of processing all imsg when reading them store peer specific
messages on a per peer queue. This queue is later processed one at a
time resulting in a fairer processing of work and avoiding big table
dumps to delay processing of other updates.
OK denis@ benno@

Revision 1.226.2.1 / (download) - annotate - [select for diffs], Wed Oct 30 20:02:19 2019 UTC (4 years, 7 months ago) by benno
Branch: OPENBSD_6_6
Changes since 1.226: +5 -4 lines
Diff to previous 1.226 (colored) next main 1.227 (colored)

bgpd(8) can crash on nexthop changes or during startup in certain
configurations.

This is OpenBSD 6.6 errata 003 and combines the following commits from
-current:

---------------------------------------------
CVSROOT:        /cvs
Module name:    src
Changes by:     claudio@cvs.openbsd.org 2019/10/29 00:47:04

Modified files:
        usr.sbin/bgpd  : rde_rib.c

Log message:
Replace the fatal non existing prefix call with a pt_add() call that
actually inserts the missing prefix in the prefix tree. While for
regular updates to the Adj-RIB-Out this case is indeed not reachable
it is reachable when using 'export default-route'.
Problem reported and fix tested by Esa Kuusisto.
OK benno@
---------------------------------------------
CVSROOT:        /cvs
Module name:    src
Changes by:     claudio@cvs.openbsd.org 2019/10/29 23:27:50

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

Log message:
Add PREFIX_FLAG_STALE to mark prefixes in the Adj-RIB-Out as stale during
graceful reload. At the same time extend peer_dump() to force all updates
getting sent by adding every entry in the Adj-RIB-Out to the update tree
unless they are PREFIX_FLAG_DEAD or PREFIX_FLAG_STALE. The latter will be
removed during that stage since peer_dump() just did a full update of the
Adj-RIB-Out. Also fix prefix_withdraw to check the correct prefix flags
before removing a prefix from the update or withdraw tree.
OK benno@
---------------------------------------------
CVSROOT:        /cvs
Module name:    src
Changes by:     claudio@cvs.openbsd.org 2019/10/29 00:42:05

Modified files:
        usr.sbin/bgpd  : rde_rib.c

Log message:
Fix two cases where the nexthop_runners tail queue can get corrupted.
First by requeuing an element that is already on the list and second
by freeing a nexthop that is still on the list resulting in a use after
free. This should fix bgpd crashes seen by various people.
Problem report including backtrace from benno@
OK benno@

Revision 1.227 / (download) - annotate - [select for diffs], Wed Oct 30 05:27:50 2019 UTC (4 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.226: +5 -4 lines
Diff to previous 1.226 (colored)

Add PREFIX_FLAG_STALE to mark prefixes in the Adj-RIB-Out as stale during
graceful reload. At the same time extend peer_dump() to force all updates
getting sent by adding every entry in the Adj-RIB-Out to the update tree
unless they are PREFIX_FLAG_DEAD or PREFIX_FLAG_STALE. The latter will be
removed during that stage since peer_dump() just did a full update of the
Adj-RIB-Out. Also fix prefix_withdraw to check the correct prefix flags
before removing a prefix from the update or withdraw tree.
OK benno@

Revision 1.226 / (download) - annotate - [select for diffs], Wed Aug 14 11:57:21 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.225: +2 -11 lines
Diff to previous 1.225 (colored)

Rework the way ribs are stored in the RDE. Instead of a flat array that
gets enlarged use an array of pointers, so pointers to struct rib entries
remain valid after adding new RIBs. Also remove the global ribs pointer
and rib_valid() since they are no longer used since all the code uses now
rib_byid() instead.
OK benno@

Revision 1.225 / (download) - annotate - [select for diffs], Wed Aug 14 07:39:04 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.224: +6 -11 lines
Diff to previous 1.224 (colored)

There is no longer a reason to use two structs for RIBs where one is part
of the other. Just merge struct rib_desc into struct rib. Makes code simpler.
OK benno@

Revision 1.224 / (download) - annotate - [select for diffs], Tue Aug 13 12:16:20 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.223: +11 -10 lines
Diff to previous 1.223 (colored)

Instead of passing a struct prefix pointer to rde_filter() pass the 4 values
prefix_peer, prefix_vstate and prefix/prefixlen to the function. This removes
some ugly hacks in cases where the prefix was not available.
Also adjust the order of arguments of rde_attr_set() to match rde_filter().
OK benno@

Revision 1.223 / (download) - annotate - [select for diffs], Fri Aug 9 13:44:27 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.222: +7 -6 lines
Diff to previous 1.222 (colored)

Rename some of the prefix functions to make it clearer. Also rename
path_update to prefix_update since this is now more working on a prefix.
OK clang

Revision 1.222 / (download) - annotate - [select for diffs], Wed Aug 7 10:26:41 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.221: +6 -3 lines
Diff to previous 1.221 (colored)

Improve RIB reload behaviour. Especially when the rtable changes or the
route evaluation is modified. In both cases the softreconfig code will
now walk the RIB and ensure that everything is in proper sync.
Additionally remove 'route-collector yes|no' from the bgpd config, instead
use 'rde rib Loc-RIB no evaluate' with the benefit that you can alter
the setting now during runtime.
Tested and OK benno@

Revision 1.221 / (download) - annotate - [select for diffs], Mon Jul 22 07:32:16 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.220: +1 -4 lines
Diff to previous 1.220 (colored)

GC three prototypes whose function have gone long ago.

Revision 1.220 / (download) - annotate - [select for diffs], Wed Jul 17 10:13:26 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.219: +35 -15 lines
Diff to previous 1.219 (colored)

Change the Adj-RIB-Out to a per peer set of RB trees. The way RIB data
structures are linked does not scale for the Adj-RIB-Out and so inserts
and updates into the Adj-RIB-Out did not scale because of some linear
list traversals in hot paths.

A synthetic test with 4000 peers announcing one prefix each showed that
the initial convergence time dropped from around 1 hout to around 6min.

Note: because the Adj-RIB-Out is now per peer the order in which prefixes
are dumped in 'bgpctl show rib out' changed.

Tested and OK job@, benno@, phessler@

Revision 1.219 / (download) - annotate - [select for diffs], Mon Jul 1 07:07:08 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.218: +17 -23 lines
Diff to previous 1.218 (colored)

Unify the way object in the RDE are reference counted. The affected
structures are pt_entry, rde_aspath, rde_communities, and nexthop.
The functions are always called *_ref and *_unref also the behaviour
when the last reference is removed is unified and now the object is
removed inside of the unref function. The actual bean-counting is not
modified by this diff.
OK benno@

Revision 1.218 / (download) - annotate - [select for diffs], Mon Jun 24 06:39:49 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.217: +12 -11 lines
Diff to previous 1.217 (colored)

mrt dumps lost communities after the community rewrite.
Readd them by dumping them explicitly.
Tested by and OK benno@

Revision 1.217 / (download) - annotate - [select for diffs], Sat Jun 22 05:44:05 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.216: +6 -3 lines
Diff to previous 1.216 (colored)

Add a direct pointer from struct prefix to struct pt_entry.
This changes makes it possible to not use the struct rib_entry pointer
which will be used to optimize the Adj-RIB-Out.
Also adjust pt_ref() and pt_unref() so that the code can be written
a bit more compact. Also prefix_cmp() no longer needs to go via
rib_compare() and calls pt_prefix_cmp() directly.
OK phessler@

Revision 1.216 / (download) - annotate - [select for diffs], Thu Jun 20 13:38:21 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.215: +1 -3 lines
Diff to previous 1.215 (colored)

prefix_updateall() is only used internally, make it a static function.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Jun 20 13:18:19 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.214: +8 -2 lines
Diff to previous 1.214 (colored)

Change nexthop_update to run the list walk over all prefixes to run
asynchronously and therefor other tasks can make progress at the same
time. Additionally prefixes belonging to a RIB which does not run the
the decision process are no longer linked into the nexthop list.
This replaces the early return in prefix_updateall() and reduces the
time spent in nexthop_update().
OK benno@

Revision 1.214 / (download) - annotate - [select for diffs], Mon Jun 17 13:35:43 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.213: +5 -5 lines
Diff to previous 1.213 (colored)

Cleanup, remove some unneded spaces add some other where needed.
No binary change according to clang

Revision 1.213 / (download) - annotate - [select for diffs], Mon Jun 17 11:02:19 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.212: +67 -20 lines
Diff to previous 1.212 (colored)

Completley rewrite the community matching and handling code. All community
attributes are put into a new data structure when parsing the UPDATE.
The filter code can quickly lookup and modify this data structure.
When creating an UPDATE the data is put back into wire format.
Setups using a lot of communities benefit a lot from this.
Input and OK benno@

Revision 1.212 / (download) - annotate - [select for diffs], Fri May 31 09:46:31 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.211: +2 -1 lines
Diff to previous 1.211 (colored)

Exit the attribute loop early if there are no unknown attributes left
and the loop passed all attributes known by bgpd. Saves about 80% of
time in up_generate_attr().
OK phessler@

Revision 1.211 / (download) - annotate - [select for diffs], Thu Mar 7 07:42:36 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.210: +1 -13 lines
Diff to previous 1.210 (colored)

Do a better job at cleaning up the config on shutdown. Remove bits that
were missed before (e.g. network related objects). This helps to detect
memory leaks.
Start using new_config() and free_config() in all places where bgpd_config
structure are used. This way the struct is properly initialised and cleaned
up. Introduce copy_config() to only copy the values into the other struct
leaving the pointers as they were.
Looks good to benno@

Revision 1.210 / (download) - annotate - [select for diffs], Tue Feb 26 10:49:15 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.209: +2 -2 lines
Diff to previous 1.209 (colored)

Add support for '*', local-as and neighbor-as for ext-community matching
and setting. This allows rules like:
    ext-community * * # delete any ext-community
    ext-community ovs * # delete any ext-community of specified type
    ext-community rt 1.2.3.4:*
and
    ext-community rt 65001:local-as
    ext-community rt local-as:11111

Note: Sometimes the type of the ext-community is underspecified when using
wildchars or expands.  So 'ext-community rt *' or 'ext-community soo *' will
match for any of the 3 possible types (2-byte AS, 4-byte AS and IP address).
If local-as/neighbor-as is used as an expand of as-number like
    ext-community rt local-as:11111
then bgpd will default to the 4-byte AS type to encode the community.

OK benno@

Revision 1.209 / (download) - annotate - [select for diffs], Mon Feb 4 18:53:10 2019 UTC (5 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.208: +3 -1 lines
Diff to previous 1.208 (colored)

Implement as-override, a feature where the neighbor AS is replaced by the
local AS in AS paths. This is sometimes needed in bigger transport networks
where private AS numbers are used in multiple locations.
The implementation is done using a filterset which modifies the AS path -
somewhat inspired by the set attribute code. Setting as-override yes will add
    match from <neighbor> set { as-override }
to the start of the filter rules. Since this is filters the Adj-RIB-In still
holds the original path and so reloads changing the setting just work.
With and OK markus@

Revision 1.208 / (download) - annotate - [select for diffs], Mon Jan 21 02:07:56 2019 UTC (5 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.207: +21 -24 lines
Diff to previous 1.207 (colored)

Use Adj-RIB-Out to push UPDATE messages to peers instead of having another
set of RB trees of prefixes and atribute. Refactor most of the update code
which removes some strange buffer handling. By building the output queue
directly in the Adj-RIB-Out the top memory usage during startup is greatly
reduced which should help busy server.
Tested by phessler@ and myself

Revision 1.207 / (download) - annotate - [select for diffs], Sun Dec 30 13:53:07 2018 UTC (5 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.206: +14 -1 lines
Diff to previous 1.206 (colored)

add support for IPv6 VPN routes

The kernel bits are missing as of now. With input from claudio@ and kn@

OK claudio@

Revision 1.206 / (download) - annotate - [select for diffs], Wed Dec 19 15:26:42 2018 UTC (5 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.205: +5 -5 lines
Diff to previous 1.205 (colored)

Fold ext-communities into filter_community so that bgpd can match
multiple ext-communities at the same time as well. Additionally this fixes
parsing some of the ext-community types. Now all communities are handled
by one common struct.
OK benno@ plus some input from denis@

Revision 1.205 / (download) - annotate - [select for diffs], Mon Dec 17 11:24:30 2018 UTC (5 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.204: +1 -2 lines
Diff to previous 1.204 (colored)

path_empty() is not a function and does not need a prototype.

Revision 1.204 / (download) - annotate - [select for diffs], Tue Dec 11 09:02:14 2018 UTC (5 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.203: +3 -3 lines
Diff to previous 1.203 (colored)

Refactor aspath code a bit. Move cached source_as (for origin validation)
into struct aspath and pass that struct to aspath_match().
OK denis@

Revision 1.203 / (download) - annotate - [select for diffs], Wed Nov 28 08:32:27 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.202: +23 -20 lines
Diff to previous 1.202 (colored)

Start reworking community handling. Merge standard communities and large
communities into one filter_community struct and allow it that more then
one community can be used in filter rules (currently up to 3).
Also rework the code handling bgpctl show rib commands. The special IMSG
types for the various filters are gone and the code is in general simpler.
OK job@, phessler@

Revision 1.202 / (download) - annotate - [select for diffs], Sun Nov 4 12:34:54 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.201: +2 -3 lines
Diff to previous 1.201 (colored)

Introduce a real Adj-RIB-Out. At the same time remove the update_rib
introduced before 6.4 because it now can be replaced with the real RIB.
Main changes are:
- simplified 'show rib' handling since everything is now a real RIB
- path_update() is now returning if a prefix was not modified, added or moved
- softreconfig out case is simpler since path_update does all the magic now
- Adjust shutdown code to work with the Adj-RIB-Out
Tested and OK denis@, benno@

Revision 1.201 / (download) - annotate - [select for diffs], Wed Oct 31 14:50:07 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.200: +2 -9 lines
Diff to previous 1.200 (colored)

Remove tail queues which link peer, aspath and prefix together. These
lists are no longer needed and make it possible to share rde_aspath between
peers & prefixes. Instead of the lists the rde_aspath is now reference counted.
With this struct prefix is now the central place where everything is connected
to making the RIB a bit easier to handle.
With input and OK denis@

Revision 1.200 / (download) - annotate - [select for diffs], Mon Oct 29 09:28:31 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.199: +1 -3 lines
Diff to previous 1.199 (colored)

Replace some walkers using the aspath/prefix lists with a rib_dump walker.
network_flush() is now using rib_dump_new to walk the Adj-RIB-In and
remove all dynamically added announcements. peer_flush() got generalized
and is now used also in peer_down(). It also uses a walker to remove all
prefixes of a peer but does it in a synchronous way for now.
OK benno@

Revision 1.199 / (download) - annotate - [select for diffs], Thu Oct 25 15:49:42 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.198: +3 -2 lines
Diff to previous 1.198 (colored)

Calculate ASPATH_HEADER_SIZE correctly by using offsetof() instead of the
sizeof calculation that did not respect possible padding bytes.
OK sthen@ denis@

Revision 1.198 / (download) - annotate - [select for diffs], Wed Oct 24 08:26:37 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.197: +46 -53 lines
Diff to previous 1.197 (colored)

Major refactoring of the RIB handling code. Mainly change how the RIB is
walked. rib_dump_r() is now an internal function and instead the code gets
an additional callback for throttling the rib_dump code. This removes a
lot of similar code used to make sure the RDE is not walking to fast and
replaces it with simpler callbacks. The other big change is the removal
of struct rib pointers in other data structures. The rib pointers are not
stable because of a realloc() call happening when extending the array so
instead use the RIB ID as a reference.
Tested and OK denis@ and benno@

Revision 1.197 / (download) - annotate - [select for diffs], Mon Oct 15 10:44:47 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.196: +2 -1 lines
Diff to previous 1.196 (colored)

Use the up_rib tree to withdraw all prefixes of a peer which is used to
reload peers into a new RIB. Removes one additional full RIB tree walker.
OK benno@

Revision 1.196 / (download) - annotate - [select for diffs], Mon Oct 1 23:09:53 2018 UTC (5 years, 8 months ago) by job
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.195: +1 -6 lines
Diff to previous 1.195 (colored)

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@

Revision 1.195 / (download) - annotate - [select for diffs], Sat Sep 29 08:11:11 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.194: +15 -25 lines
Diff to previous 1.194 (colored)

Implement origin validation in bgpd. This introduces two new tables, the
roa-set for RPKI based origin validation and a origin-set which allows to
lookup a source-as / prefix pair.
For RPKI a config can be built like this:
  roa-set {
          165.254.255.0/24 source-as 15562
          193.0.0.0/21 maxlen 24 source-as 3333
  }
  deny from any ovs invalid
  match from any ovs valid set community local-as:42
  match from any ovs not-found set community local-as:43
Origin sets are similar but only match when the source-as / prefix pair is
valid.
  match from any origin-set ARINDB set community local-as:44
Committing this now so that further work can be done in tree.
OK benno@, job@

Revision 1.194 / (download) - annotate - [select for diffs], Sat Sep 29 07:43:36 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.193: +5 -1 lines
Diff to previous 1.193 (colored)

Introduce minimal tracking of announced prefixes. A per peer RB tree tracks
which prefixes were sent out as UPDATE. At withdraw time the RB tree can be
consulted to know if the withdraw actually needs to be sent to the peer.
This replaces the faulty heuristic that was used before and caused either
that unneeded withdraw to be sent or in the worst case failing to send a
necessary withdraw resulting in stuck routes.
OK benno@

Revision 1.193 / (download) - annotate - [select for diffs], Thu Sep 20 11:45:59 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.192: +2 -2 lines
Diff to previous 1.192 (colored)

Split up as_set into a set_table and an as_set. The first is what does
the lookup and will now also be used in roa-set tries. The as_set is glue
to add the name and dirty flag. Add an accessor to get the set data so
that the imsg sending and printing can be moved into the right places.
This is done mainly because roa-sets need similar but slightly different
versions and making the code more generic is the best way fixing this.
OK benno@

Revision 1.192 / (download) - annotate - [select for diffs], Thu Sep 20 11:06:04 2018 UTC (5 years, 8 months ago) by benno
Branch: MAIN
Changes since 1.191: +2 -2 lines
Diff to previous 1.191 (colored)

whitespace cleanup, ok claudio@

Revision 1.191 / (download) - annotate - [select for diffs], Tue Sep 18 15:14:07 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.190: +13 -2 lines
Diff to previous 1.190 (colored)

Backend for roa-sets. This combines as_sets and prefix-set tries to do
proper ROA checking. There is a new match function trie_roa_check which
does a trie traversal and looks for candidates and matches. If prefix
is not covered then ROA_UNKNOWN is returned, if prefix is covered by an
entry it will return ROA_INVALID unless the source-as / maxlen combo is
matching (ROA_VALID).
OK and input sthen@

Revision 1.190 / (download) - annotate - [select for diffs], Sun Sep 9 12:33:51 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.189: +8 -13 lines
Diff to previous 1.189 (colored)

Clean up prefix flag handling. First of all the dynamic networks no longer
need this and are now treated equally to the network statement in the config.
This makes bgpctl network delete <net> also remove a network which was defined
in the config.
While there remove the other use of flag which was done to support Adj-RIB-Out
but the direction we're taking is no longer needing that. Makes code simpler
again.
OK benno@

Revision 1.189 / (download) - annotate - [select for diffs], Sat Sep 8 15:25:27 2018 UTC (5 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.188: +4 -4 lines
Diff to previous 1.188 (colored)

implement or-longer filter op for prefix-sets. Allows one two write rules like
  deny from any prefix-set mynetworks or-longer
ok claudio, feature discussed with job and deraadt

Revision 1.188 / (download) - annotate - [select for diffs], Fri Sep 7 10:49:22 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.187: +26 -1 lines
Diff to previous 1.187 (colored)

Implement a fast presix-set lookup. This magic trie is able to match a
prefix addr/plen to a prefix-set spec addr/plen prefixlen min - max (a
prefix including prefixlen range). Every addr/plen pair is a node in the
trie and the prefixlen is added as a bitmask to those nodes.
For the lookup the any match is OK, there is no need to do longest or
best prefix matching.
Inspiration for this solution comes from the way bird implements this
which was done by Ondrej Zajicek santiago (at) crfreenet.org
OK benno@

Revision 1.187 / (download) - annotate - [select for diffs], Fri Sep 7 05:43:33 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.186: +2 -2 lines
Diff to previous 1.186 (colored)

Implement as-set a fast lookup table to be used instead of long list of
AS numbers in source-as, AS and transit-as filterstatements. These table
use bsearch to quickly verify if an AS is in the set or not.
The filter syntax is not fully set in stone yet.
OK denis@ benno@ and previously OK deraadt@

Revision 1.186 / (download) - annotate - [select for diffs], Wed Aug 8 13:08:54 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.185: +3 -1 lines
Diff to previous 1.185 (colored)

Update the RIB after a config reload in the background. This moves the
heavy bits into the background and so the RDE is able to process new
messages more or less instantly after a configuration reload.
Not all cases are covered yet but the bulk is.
While the backgorund process is running no new config can be loaded.
Tested by and OK benno@

Revision 1.185 / (download) - annotate - [select for diffs], Wed Aug 8 06:54:50 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.184: +9 -1 lines
Diff to previous 1.184 (colored)

hide rib[] internals in new rib_valid() function
ok claudio@

Revision 1.184 / (download) - annotate - [select for diffs], Mon Aug 6 08:13:31 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.183: +2 -2 lines
Diff to previous 1.183 (colored)

Pass the stale timestamp to path_remove_stale() removes a asp->peer dereference

Revision 1.183 / (download) - annotate - [select for diffs], Fri Aug 3 16:31:22 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.182: +30 -22 lines
Diff to previous 1.182 (colored)

Move nexthop and nexthop flags from the rde_aspath to struct prefix.
struct prefix will be slowly becomming the hub of the rib.
OK phessler@ job@

Revision 1.182 / (download) - annotate - [select for diffs], Tue Jul 31 15:30:04 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.181: +3 -3 lines
Diff to previous 1.181 (colored)

Reshuffle order in struct rde_peer a bit. No functional change.

Revision 1.181 / (download) - annotate - [select for diffs], Sun Jul 22 16:59:08 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.180: +11 -3 lines
Diff to previous 1.180 (colored)

Move nexthop into struct filterstate (including nexthop flags) and use
them whereever possible. In some places (path_update, softreconfig_out
handler) the nexthop state is temporarily folded back into the rde_aspath.
Tested and OK benno@

Revision 1.180 / (download) - annotate - [select for diffs], Fri Jul 20 14:58:20 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.179: +1 -7 lines
Diff to previous 1.179 (colored)

Move the nlri_get_prefix functions to util.c so that bgpctl can use them too.

Revision 1.179 / (download) - annotate - [select for diffs], Mon Jul 16 09:09:20 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.178: +2 -2 lines
Diff to previous 1.178 (colored)

Use struct filterstate in rde_update_dispatch() and pass it down to
functions like rde_update_update and path_update. This will allow to
move more pointers from rde_aspath to the prefix.
Looks good benno@

Revision 1.178 / (download) - annotate - [select for diffs], Wed Jul 11 19:05:41 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.177: +5 -8 lines
Diff to previous 1.177 (colored)

improve the path hash function (instead of just hashing the aspath put
most other attrs into the hash as well). At the same time use the full
64 bit of SipHash in various places.
Tested by and OK benno@ phessler@

Revision 1.177 / (download) - annotate - [select for diffs], Wed Jul 11 16:34:36 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.176: +4 -1 lines
Diff to previous 1.176 (colored)

On IMSG_CTL_SHOW_RIB_MEM also send back information of some of the
hash structures used in the RDE. Makes it fairly obvious that more
is needed in that area.
OK phessler@ benno@

Revision 1.176 / (download) - annotate - [select for diffs], Mon Jul 9 14:08:48 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.175: +10 -3 lines
Diff to previous 1.175 (colored)

Introduce a struct filterstate and pass this to rde_filter instead of
passing the asp. This is no longer using asp_get() and should be therefor
be a bit lighter. Will also allow to put more stuff into the state.
OK denis@ sthen@

Revision 1.175 / (download) - annotate - [select for diffs], Fri Jun 29 11:45:50 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.174: +4 -3 lines
Diff to previous 1.174 (colored)

Prepare the ground for allowing temporary aspath object living on the stack.
To do this path_copy() gets a second argument (dst, src) and a new function
path_prep() is introduced to initialize an aspath object. The current
path_copy() usage is replaced with path_copy(path_get(), asp) which does
the same. Additionally some const where added to the *_copy functions to
make it more obvious which is the source and target. Also the pftable_ref()
and rtlabel_ref() functions return now the id instead of void.
OK sthen@

Revision 1.174 / (download) - annotate - [select for diffs], Thu Jun 28 09:54:48 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.173: +2 -3 lines
Diff to previous 1.173 (colored)

Remove rde_aspath pointer from rde_filter since that argument can be fetched
from the prefix instead. While there also switch to prefix_peer from asp->peer
in rde_dump_rib_as(). Makes the code easier overall.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Jun 28 08:55:56 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored)

Instead of passing the rde_aspath to nexthop_modify() pass pointers to
the nexthop and the flags.

Revision 1.172 / (download) - annotate - [select for diffs], Thu Jun 28 08:07:21 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.171: +7 -5 lines
Diff to previous 1.171 (colored)

Pass a struct prefix to rde_filter and remove some of the arguments which
are now fetched from struct prefix. Currently some trickery is needed
for export default-route but this will get better once Adj-RIB-Out comes.
OK benno@

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jun 27 13:14:44 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.170: +5 -6 lines
Diff to previous 1.170 (colored)

Just put the aspath and the peer directly into the prefix struct.
Needed for upcoming changes.

Revision 1.170 / (download) - annotate - [select for diffs], Mon Jun 25 14:28:33 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.169: +5 -4 lines
Diff to previous 1.169 (colored)

Properly start reference counting struct nexthop. This removes the need for
some ugly workaround to make sure nexthop objects don't disapear while
still being referenced. During initial lookup of a nexthop a extra reference
is pulled but even that is now a bit cleaner than before.
Tested by job@, dennis@, benno@ OK job@ dennis@

Revision 1.169 / (download) - annotate - [select for diffs], Thu Jun 21 17:26:16 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.168: +1 -3 lines
Diff to previous 1.168 (colored)

Nothing is using the active and prefix count in struct rde_aspath.
Remove them to make the code simpler.
OK deraadt@ gsoares@

Revision 1.168 / (download) - annotate - [select for diffs], Sat Feb 10 05:54:31 2018 UTC (6 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored)

Follow rfc8277 more closely and make make sure bgpd is encoding VPNv4
withdraws they way other systems are doing it. Interop problem discovered
by Andrew Thrift. Tested by Andrew and job@.

Revision 1.167 / (download) - annotate - [select for diffs], Sat Feb 10 01:24:28 2018 UTC (6 years, 3 months ago) by benno
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

Add prefix-sets, lists of prefixes which can be used in place of a
prefix in a filter rule. Initial idea hashed out with job@ in Toronto.
This is WIP, i'm commiting it now so we can work on it in the tree.
ok florian@ claudio@

Revision 1.166 / (download) - annotate - [select for diffs], Wed Feb 7 00:02:02 2018 UTC (6 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.165: +9 -11 lines
Diff to previous 1.165 (colored)

Add plumbing inside of the prefix handling to put prefixes on either the
prefixes or updates list depending on flags passed to the functions.
While there also introduce a similar flag for rde_aspath and adjust
path_compare so that this flag is ignored (liked the linked one).
OK benno@

Revision 1.165 / (download) - annotate - [select for diffs], Mon Feb 5 23:29:59 2018 UTC (6 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.164: +14 -12 lines
Diff to previous 1.164 (colored)

Switch a few lists to tailqs. Mainly the prefix list per aspath needs
to be a queue so that we can use it in the Adj-RIB-Out case.
OK benno@

Revision 1.164 / (download) - annotate - [select for diffs], Mon Feb 5 03:55:54 2018 UTC (6 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.163: +39 -14 lines
Diff to previous 1.163 (colored)

Change struct prefix a bit. Make the aspath pointer opaque and remove the
direct pointer to the pt_prefix struct. To getter functions prefix_aspath()
and prefix_peer() added to make access of the opaque pointers possible.
Looks good henning@ and benno@

Revision 1.163 / (download) - annotate - [select for diffs], Sun Feb 4 05:08:16 2018 UTC (6 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.162: +5 -1 lines
Diff to previous 1.162 (colored)

Clenaup RIB handling in the RDE. Introduce some defines for Adj-RIB-In and
Adj-RIB-Out and use them consistently. Makes code easier to read.
OK benno@

Revision 1.162 / (download) - annotate - [select for diffs], Tue May 30 18:08:15 2017 UTC (7 years ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.161: +3 -1 lines
Diff to previous 1.161 (colored)

remove extended communities that have the transitive bit set from
routes announced to an ebgp peer (ref. rfc4360). While here remove the
pratial flag from extended and large communities.
ok claudio@

Revision 1.161 / (download) - annotate - [select for diffs], Sun May 28 12:21:36 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.160: +2 -4 lines
Diff to previous 1.160 (colored)

Implement an XON/XOFF protocol between the RDE and the SE to throttle
per control session and peer the generation of imsg in the RDE. This
reduces the memory pressure in the SE substantially and also a bit in
the RDE. Makes the RDE more responsive for bgpctl commands.
Tested by me with 100 peers * 2000 prefixes and by phessler@ on an AMS-IX
border router with 200+ session. Convergance time got quite a bit better.
OK phessler@

Revision 1.160 / (download) - annotate - [select for diffs], Wed Jan 25 03:21:55 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.159: +6 -5 lines
Diff to previous 1.159 (colored)

Hopefully the last of the struct rib rototilling. Peer just points to a
struct rib and not rib_desc since the full descriptor is almost never needed.
This should now allow the update code to be changed.

Revision 1.159 / (download) - annotate - [select for diffs], Wed Jan 25 00:15:38 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.158: +17 -17 lines
Diff to previous 1.158 (colored)

Switch rde_generate_update and rde_send_kroute to accept a struct rib instead
of the id. For this we move the rtableid into struct rib. Also move the update
code in rib.c up to where the kroute code is. Makes more senses like that.

Revision 1.158 / (download) - annotate - [select for diffs], Tue Jan 24 23:38:12 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.157: +11 -4 lines
Diff to previous 1.157 (colored)

Save some space in struct rib_entry so it is back to 64bytes (on 64bit archs).
Doing this by folding the lock flag into a pointer and providing an accessor
function for the rib pointer. This is an acceptable middle path for this
important structure.
OK benno@ on an earlier version

Revision 1.157 / (download) - annotate - [select for diffs], Mon Jan 23 22:53:52 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.156: +2 -2 lines
Diff to previous 1.156 (colored)

Rename rib pointer in struct prefix to re since it points to a rib_entry.
While there also remove a comment that is since a few years at least.
OK gcc

Revision 1.156 / (download) - annotate - [select for diffs], Mon Jan 23 22:47:59 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.155: +19 -14 lines
Diff to previous 1.155 (colored)

Introduce a struct rib sitting between struct rib_desc and struct rib_tree.
This way the tree becomes a bit better decoupled.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Jan 23 13:08:47 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.154: +3 -3 lines
Diff to previous 1.154 (colored)

Revert the struct rib_tree rename. I need a struct in between because of
how struct rib_entry is used.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Jan 23 12:25:19 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.153: +5 -6 lines
Diff to previous 1.153 (colored)

More rototilling, make rib_new and rib_find return a point to struct rib_desc

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jan 23 11:46:02 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.152: +3 -3 lines
Diff to previous 1.152 (colored)

Now rename struct rib_tree to struct rib. Again OK gcc

Revision 1.152 / (download) - annotate - [select for diffs], Mon Jan 23 11:43:40 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.151: +12 -12 lines
Diff to previous 1.151 (colored)

Rename struct rib to struct rib_desc. Mechanical change, OK gcc

Revision 1.151 / (download) - annotate - [select for diffs], Thu Oct 27 08:21:58 2016 UTC (7 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.150: +2 -2 lines
Diff to previous 1.150 (colored)

Huawei squatted on BGP Path Attribute 30, and Cisco squatted on 31.  So,
IANA moved the Large Communities attribute to 32, which is a nice pun on
the problem it is solving.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Oct 14 16:05:36 2016 UTC (7 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.149: +9 -2 lines
Diff to previous 1.149 (colored)

Add support for draft-ietf-idr-large-community

Joint work with Job Snijders, many thanks!
OK benno@ deraadt@

Revision 1.149 / (download) - annotate - [select for diffs], Fri Nov 6 16:23:26 2015 UTC (8 years, 7 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.148: +2 -1 lines
Diff to previous 1.148 (colored)

Radically improve the performance of bgpd filters.  Based on PF's skip
steps (and uses much of the same code).

In a torture test of ~600k prefix filters and 65k prefixes, convergance
time goes from 35 minutes to 30 seconds.

Many thanks to LONAP for providing a base configuration for torture
testing.

many discussions with claudio@, benno@, sthen@ and the rest of the bgpd crowd

OK sthen@ benno@

Revision 1.148 / (download) - annotate - [select for diffs], Sat Mar 14 03:52:42 2015 UTC (9 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.147: +1 -2 lines
Diff to previous 1.147 (colored)

rename rde_free_filter() to filterlist_free() and start using it outside
of the RDE to free the filterlists. Also refactor common code to merge
filterlists into its own function. Makes the code look nicer.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Aug 14 20:34:26 2013 UTC (10 years, 9 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.146: +8 -7 lines
Diff to previous 1.146 (colored)

Rewrite the internals of the RDE reload logic.
This is the first step to make bgpd reload non blocking in the RDE.
It also speeds up the reload time a fair bit in some cases (mainly if
you run with multiple RIBs and have larger filtersets) and it should also
fix a few edge cases on reloads.
Testing done by benno@, florian@ and sthen@ OK henning@ and benno@

Revision 1.146 / (download) - annotate - [select for diffs], Wed Jul 17 14:09:13 2013 UTC (10 years, 10 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.145: +2 -2 lines
Diff to previous 1.145 (colored)

on graceful restart, the number of prefixes could be counted wrong,
triping max-prefix.  fix it this way, at least until prefix accounting
is done better.
diff from florian@
ok claudio@

Revision 1.142.4.1 / (download) - annotate - [select for diffs], Thu Nov 29 20:06:16 2012 UTC (11 years, 6 months ago) by sthen
Branch: OPENBSD_5_2
Changes since 1.142: +4 -1 lines
Diff to previous 1.142 (colored) next main 1.143 (colored)

MFC fix for interoperability problem with some newer Junipers which don't
clear reserved bits:

-- -- --
By default mask the reserved bits and the ext len bit in the attribute
flags field. Some systems seem to start sending bad flags around which
cause session failures in bgpd. Make sure that bgpd ignores the must be
zero flags correctly and ensure that they are always reset to zero when
sending updates out.
Reported and patch tested by Laurent CARON, OK henning@

Members:
        rde.c:1.316->1.317
        rde.h:1.142->1.143
        rde_attr.c:1.90->1.91
-- -- --

Revision 1.145 / (download) - annotate - [select for diffs], Sun Oct 28 13:16:11 2012 UTC (11 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.144: +2 -2 lines
Diff to previous 1.144 (colored)

Change email address in copyright to one that is valid.

Revision 1.144 / (download) - annotate - [select for diffs], Wed Sep 12 05:56:22 2012 UTC (11 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.143: +5 -1 lines
Diff to previous 1.143 (colored)

Better graceful restart support (implementing more then just the EoR record).
This implements only the "Restarting Client" bits of the RFC -- in other
words bgpd will keep the FIB when the client restarts but it will not do GR
when restarting itself. The capability is still off by default (you need
"announce restart yes" to enable it).
Tested by Anders Berggren. OK sthen@

Revision 1.143 / (download) - annotate - [select for diffs], Sun Aug 12 14:24:56 2012 UTC (11 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.142: +4 -1 lines
Diff to previous 1.142 (colored)

By default mask the reserved bits and the ext len bit in the attribute
flags field. Some systems seem to start sending bad flags around which
cause session failures in bgpd. Make sure that bgpd ignores the must be
zero flags correctly and ensure that they are always reset to zero when
sending updates out.
Reported and patch tested by Laurent CARON, OK henning@

Revision 1.142 / (download) - annotate - [select for diffs], Wed Sep 21 08:59:01 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_1_BASE, OPENBSD_5_1
Branch point for: OPENBSD_5_2
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (colored)

Fix nexthop_modify() to reset the flags when called. Until now
set nexthop-self was sticky and so later set nexthop <IP> were
not applied.
Problem found and fix tested by Tony Sarendal. OK henning@

Revision 1.141 / (download) - annotate - [select for diffs], Tue Sep 20 21:19:06 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.140: +1 -7 lines
Diff to previous 1.140 (colored)

Move a few functions into util.c because bgpctl will need them soon.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Sep 18 09:31:25 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.139: +43 -38 lines
Diff to previous 1.139 (colored)

Reorder the headerfiles a bit. Move the bgpd specific prototypes out of
mrt.h. Now mrt.h includes only protocol specific defines.

Revision 1.139 / (download) - annotate - [select for diffs], Sat Sep 17 16:29:44 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.138: +3 -1 lines
Diff to previous 1.138 (colored)

Implement new mrt table dump format as specified in draft-ietf-grow-mrt.
Tested with IP and IPv6 sessions and against the libbgpdump parser.
OK henning@

Revision 1.138 / (download) - annotate - [select for diffs], Thu Nov 18 12:18:31 2010 UTC (13 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.137: +4 -1 lines
Diff to previous 1.137 (colored)

Accept but ignore (treat as withdraw) updates with AS_CONFED_* path
segments. Bgpd does not support confederations but it is too extreme
to close a session because a path contained such elements.
OK henning@, sthen@

Revision 1.137 / (download) - annotate - [select for diffs], Wed May 26 13:56:07 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.136 / (download) - annotate - [select for diffs], Wed May 19 12:44:15 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.135: +2 -1 lines
Diff to previous 1.135 (colored)

Add softreconfig support for peers changing the RIB. Done by first unloading
the old RIB and then via softreconfig in and a special softreconfig out loading
the new RIB.
Feature requested and testeded by Elisa Jasinska.
OK henning@

Revision 1.135 / (download) - annotate - [select for diffs], Mon May 17 16:08:20 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.134: +2 -1 lines
Diff to previous 1.134 (colored)

Implement two new filters, max-as-len and max-as-seq. The first is limiting
the length of an AS path (matches if the path is longer then the specified
lenght) the second matches when a sequence of the same AS number is longer
then the specified length).
max-as-len is good to protect crappy comercial bgp boxes from other crappy
comercial bgp boxes. max-as-seq was a feature request from SwissIX and maybe
EuroIX to find and filter prepends.
Additinal testing and OK sthen@

Revision 1.134 / (download) - annotate - [select for diffs], Mon May 3 13:09:38 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.133: +5 -7 lines
Diff to previous 1.133 (colored)

Make it possible to load multiple routing tables at the same time and use
those for alternate RIBs. This allows to use "rde rib TESTIT rtable 1".
NOTE: nexthop verification has changed for alternate tables. For now
nexthop will only be verified against the main routing table (id 0).
Because of this "nexthop qualify via bgp" may now compare the nexthops
against bgpd routes from a different RIB.
Tested by sthen@, OK to move on by henning@

Revision 1.133 / (download) - annotate - [select for diffs], Mon Mar 29 09:24:07 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.132: +3 -1 lines
Diff to previous 1.132 (colored)

I'm going to need community_ext_conv() outside of rde_attr.c soon, so move
the prototype to rde.h

Revision 1.132 / (download) - annotate - [select for diffs], Mon Mar 29 09:06:56 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

We always allocate rib ids dynamicaly so there is no need for allowing
fixed id allocation. Makes code simpler.
OK henning

Revision 1.131 / (download) - annotate - [select for diffs], Fri Mar 5 15:25:00 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.130: +3 -1 lines
Diff to previous 1.130 (colored)

Allow to filter for ext-community attributes. Currently only perfect matches
work but that's already better then nothing. OK sthen@

Revision 1.130 / (download) - annotate - [select for diffs], Wed Mar 3 13:52:39 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.129: +2 -9 lines
Diff to previous 1.129 (colored)

Replace enum rib_state with enum reconf_action since their doing the same.
NEW is now REINIT, ACTIVE is KEEP and DELETE and NONE stay the same.

Revision 1.129 / (download) - annotate - [select for diffs], Wed Jan 13 06:02:37 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.128: +20 -7 lines
Diff to previous 1.128 (colored)

Add support for BGP MPLS VPN aka RFC 4364. This is only the RDE part so
that it is possible to use OpenBGPD as a route-reflector for VPNv4.
Some clean up of the BGP MP code so that multiple protocols are easier
supported. kroute/kernel support not yet done but comming.
OK henning@, reyk@

Revision 1.128 / (download) - annotate - [select for diffs], Sun Jan 10 08:32:08 2010 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.127: +3 -2 lines
Diff to previous 1.127 (colored)

Generate a EoR marker in the update list instead of sending it independent
of the actual update dump. This will get us the right barrier and the EoR
is no longer sent way before the actual dump. Currently a nop since graceful
restart is turned off (unless you have announce restart yes in the config).
put it in henning@

Revision 1.127 / (download) - annotate - [select for diffs], Sun Jan 10 00:15:09 2010 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (colored)

Switch rib_dump() to use AID instead of AFs. OK henning@

Revision 1.126 / (download) - annotate - [select for diffs], Fri Dec 18 15:51:37 2009 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.125: +2 -3 lines
Diff to previous 1.125 (colored)

Merge rde_filter_community() with community_match() and kill a useless
indirection.

Revision 1.125 / (download) - annotate - [select for diffs], Wed Dec 16 15:40:55 2009 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.124: +5 -1 lines
Diff to previous 1.124 (colored)

Implement "set ext-community [delete] subtype key:value" to set and delete
extended communities as specified in RFC 4360. No matching implemented yet
and stuff like * and neighbor-as are neither supported but will be soon.
Looks good henning & sthen, manpage fixed by jmc

Revision 1.124 / (download) - annotate - [select for diffs], Tue Dec 8 14:03:40 2009 UTC (14 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.123: +3 -4 lines
Diff to previous 1.123 (colored)

Big AID change part two. This changes the mp capability into an array of
flags. This makes a lot of code much easier since the comparison is now
trivial. Additionally calculate the negotiated capabilities for a session
in the SE and pass that and only that to the RDE. This makes the decisions
in the RDE a lot easier.  OK henning@

Revision 1.123 / (download) - annotate - [select for diffs], Tue Dec 1 14:28:05 2009 UTC (14 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.122: +6 -6 lines
Diff to previous 1.122 (colored)

Use an artificial address family id in struct bgpd_addr and almost everywhere
else. Adds conversion functions to map AFI/SAFI and the Unix AF_ values
from and into AID used in bgpd.  This is needed to support things like MPLS
VPN and other upcomming changes that need to play a lot with AFI/SAFI pairs.
Mostly mechanical change, henning@ has no particular issues with this.
Must go in so that I can continue working.

Revision 1.122 / (download) - annotate - [select for diffs], Mon Oct 5 12:03:45 2009 UTC (14 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.121: +2 -1 lines
Diff to previous 1.121 (colored)

Load prefixes into new created RIBs at reload time by walking over the
Adj-RIB-In. This only works correctly when softreconfig in is enabled
(which is the default). This is needed to allow dynamic creation of
additional RIBs. OK henning@

Revision 1.121 / (download) - annotate - [select for diffs], Thu Aug 6 08:53:11 2009 UTC (14 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.120: +2 -1 lines
Diff to previous 1.120 (colored)

Implement the error handling as proposed in draft-ietf-idr-optional-transitive
for optional transitive attributes. In short if the partial bit is set on
an optional transitive attribute but the attribute fails validation ignore
the attribute or mark the path as ineligible instead of killing the session
with a NOTIFICATION. Tested, input and OK sthen, OK henning

Revision 1.120 / (download) - annotate - [select for diffs], Sat Jun 6 01:10:29 2009 UTC (15 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.119: +5 -5 lines
Diff to previous 1.119 (colored)

Some preliminary filter magic to support multiple RIBs on the filters.
It is ugly but does the trick for now. Filters will be rewritten anyway.
The rib specifier only makes sense on from rules. e.g. deny rib OMG from any

Revision 1.119 / (download) - annotate - [select for diffs], Sat Jun 6 01:07:01 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.118: +2 -1 lines
Diff to previous 1.118 (colored)

Only the main Loc-RIB should update the FIB for now. So introduce a
F_RIB_NOFIB flag and apply it on all RIBs that are not F_RIB_NOEVALUATE.

Revision 1.118 / (download) - annotate - [select for diffs], Sat Jun 6 01:02:51 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.117: +3 -2 lines
Diff to previous 1.117 (colored)

Only generate updates for peers that are member of the RIB that update is
comming from.

Revision 1.117 / (download) - annotate - [select for diffs], Thu Jun 4 21:53:43 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.116: +4 -1 lines
Diff to previous 1.116 (colored)

Implement rib_find and add a rib id to struct rde_peer.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Jun 4 04:46:42 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored)

Add "rde rib <name>" to the config and allow the rde to use these other RIBs.
Still a bit hackish, reload is missing and printconf as well. Looks good h@

Revision 1.115 / (download) - annotate - [select for diffs], Wed Jun 3 20:17:59 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

Better way to allocate new RIBs.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Jun 2 00:09:02 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.113: +3 -1 lines
Diff to previous 1.113 (colored)

Move the rest of the rib dump functions into rde_rib.c where it belongs.

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jun 1 23:54:50 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.112: +7 -8 lines
Diff to previous 1.112 (colored)

Use only one list to queue the dump contextes on. Use the list in struct
rib_context instead of the ctl specific rde_dump_ctx to make it more general.

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jun 1 22:49:06 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

Holy simplification batman. Use the per rib entry flags to lock entries
when interrupting rib dumps and now we no longer need evil RB magic to find
the next entry on restart.

Revision 1.111 / (download) - annotate - [select for diffs], Mon Jun 1 21:20:17 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.110: +7 -3 lines
Diff to previous 1.110 (colored)

Instead of storing a pointer to the RIB head in the RIB element use that
space for a flags field and the RIB id. In the end bgpd will be able to
lock RIB elements and therefore make it possible to interrupt all tree
walks.

Revision 1.110 / (download) - annotate - [select for diffs], Wed May 27 06:58:15 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.109: +4 -6 lines
Diff to previous 1.109 (colored)

Move update and withdraw code into own functions to simplify the necessary
changes to make multiple RIB functional. Also change the way we account the
prefixes per peer (for maxprefix check). Every prefix that was added to any
RIB is counted. OK henning@

Revision 1.109 / (download) - annotate - [select for diffs], Thu May 21 15:47:03 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.108: +2 -1 lines
Diff to previous 1.108 (colored)

Make it possible to turn off the decision process per RIB. This is mainly
used for the Adj-Rib-In. Also initialize the Adj-Rib-In correctly and mark
it a noevaluate.

Revision 1.108 / (download) - annotate - [select for diffs], Sun May 17 14:45:25 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.107: +4 -7 lines
Diff to previous 1.107 (colored)

F_LOCAL and F_ORIGINAL are gone. The Adj-Rib-In is now a distinct tree.
Fix pf table code by checking if the aspath has a pftableid set or not
instead of doing the F_LOCAL dance. This works because the in the
Adj-Rib-In it is impossible to set pftableid.

Revision 1.107 / (download) - annotate - [select for diffs], Sun May 17 12:25:15 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.106: +83 -48 lines
Diff to previous 1.106 (colored)

Rework most of the RDE to allow multiple RIBs. This is mostly preparation
work by changing the way the RDE DB is built. struct prefix and struct
pt_entry are simplified and extended with a rib_entry where the decision
tree is run on. From now on a prefix can only reside on one particular RIB
which simplifies the code a bit. Currently there are two fixed ribs
(adj-rib-in and the local-rib) which needs to be made more dynamic in
upcomming commits.
This is work in progress, the RDE seems to work for me and sthen@ (no flames
comming out of our testrouters but there is still a lot missing)
Move into the tree to simplify developement -- henning@

Revision 1.106 / (download) - annotate - [select for diffs], Thu Apr 23 19:23:27 2009 UTC (15 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.105: +4 -2 lines
Diff to previous 1.105 (colored)

Rework the way we handle announced networks. Instead of two freak rde_peers
use one that is less freaky. Merge bgpctl and config networks into one tree.
First step of a larger change in the RDE and this goes now in to allow to
move forward.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Mar 19 06:52:59 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.104: +3 -1 lines
Diff to previous 1.104 (colored)

Implement a attr_writebuf() function that works on a struct buf instead of
a pre allocated piece of memory. Will be used by newer mrt code.
OK henning@

Revision 1.104 / (download) - annotate - [select for diffs], Tue Jan 13 21:35:16 2009 UTC (15 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.103: +4 -4 lines
Diff to previous 1.103 (colored)

Replace NEW_ASPATH/NEW_AGGREGATOR with the naming from RFC4893,
AS4_PATH/AS4_AGGREGATOR. No binary change.

ok claudio

Revision 1.103 / (download) - annotate - [select for diffs], Fri Nov 21 17:41:22 2008 UTC (15 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.102: +3 -2 lines
Diff to previous 1.102 (colored)

Track nexthops when the underlying route is changing. Until now true nexthops
were only resolved when they were added. This calls for troubles if something
like ospfd starts to change the underlying routes.
Tested by gollo@, OK henning@

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jan 23 08:11:32 2008 UTC (16 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.101: +2 -1 lines
Diff to previous 1.101 (colored)

Add defines for extended communities. OK henning@

Revision 1.101 / (download) - annotate - [select for diffs], Tue Nov 27 01:13:54 2007 UTC (16 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.100: +2 -1 lines
Diff to previous 1.100 (colored)

Prefixes or actually pathes that would cause a rooting loops should not be
dropped when parsed but instead be added to the RIB marked as not eligible.
So the decision process does not pick them up as a valid route.
Tested and some ideas by Tony Sarendal (tony (at) polarcap (dot) org)

Revision 1.100 / (download) - annotate - [select for diffs], Fri Jun 1 04:17:30 2007 UTC (17 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.99: +1 -2 lines
Diff to previous 1.99 (colored)

Remove a stupid wrapper function that does nothing more then calling another
function with the same arguments.

Revision 1.99 / (download) - annotate - [select for diffs], Mon Apr 23 13:04:24 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.98: +34 -26 lines
Diff to previous 1.98 (colored)

Make bgpd 4-byte AS compatible. All internal representations of AS numbers
are now 4-byte instead of the old 2-byte numbers. The only exception are
communities because they can not be switched. The RDE will inflate and deflate
the ASPATH and AGGREGATOR attributes on demand and create the NEW_ASPATH and
NEW_AGGREGATOR field whenever needed. Both old and new stile sessions are
supported and can be mixed. Currently new stile sessions with the 4-byte AS
number capability turned on are only enabled if one of the AS numbers involved
is a 4-byte one.
This is based on an initial diff by Geoff Huston gih (at) apnic (dot) net
Cleanup, testing and bug-fixes by myself (via AS 3.10).
Currently mrt table dumps are producing incompatible output this will be fixed
afterwards -- this diff is already big enough.

"get it in if you think it is ready" henning@

Revision 1.98 / (download) - annotate - [select for diffs], Fri Apr 6 18:03:51 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.97: +5 -1 lines
Diff to previous 1.97 (colored)

Count the updates and withdraws for additional statisic gathering.
Discussed with henning@

Revision 1.97 / (download) - annotate - [select for diffs], Fri Jan 26 17:40:49 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.96: +17 -1 lines
Diff to previous 1.96 (colored)

Massiv rework of the control imsg flow. Main changes:
- dedicated pipe between the SE and the RDE for control messages
- restartable RB tree dumps in the RDE
- queuing limits both in the SE and RDE
The result is a dramatic decrease of memory consumption on operations like
bgpctl show rib. Previously all messages where first stored in the RDE
then passed to the SE where they got queued in case bgpctl was not fast enough.
Now only a small number of messages is generated and passed to the SE and
the SE has an additional limit instead of acting like an infinite buffer.
Without this the bgpd on bgpd.networx.ch would not survive a single minute.
looks good henning@

Revision 1.96 / (download) - annotate - [select for diffs], Fri Nov 10 14:47:32 2006 UTC (17 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

char -> u_char in a few places
apparently from Jeff Rizzo <riz@NetBSD.org> via "Thomas E. Spanjaard"
<tgen@netphreax.net>, ok claudio

Revision 1.95 / (download) - annotate - [select for diffs], Sun May 28 23:24:15 2006 UTC (18 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.94: +2 -1 lines
Diff to previous 1.94 (colored)

Even better nexthop delete behaviour. Do not delete nexthop if they are used
by filter sets or if the nexthop is currently looked up. With this the
"nexthop_update: non-existent nexthop" warning should be history. OK henning@

Revision 1.94 / (download) - annotate - [select for diffs], Sun May 28 22:07:54 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.93: +2 -1 lines
Diff to previous 1.93 (colored)

Preload and pin nexthop used in filtersets so the are validiated when used.
This will fix problems with set nexthop on outgoing filters. Found by
gluk@ OK henning@

Revision 1.93 / (download) - annotate - [select for diffs], Wed Apr 12 14:05:46 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.92: +2 -1 lines
Diff to previous 1.92 (colored)

It is no longer allowed to change attributes in place. This corrupts the
attribute cache. Instead remove attribute and readd it after beeing changed.
This should fix the "att_diff: equal attributes encountered" error seen by
Tony Sarendal. OK henning@

Revision 1.92 / (download) - annotate - [select for diffs], Wed Apr 5 13:24:29 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

remote_bgpid is stored in host byte order so a htonl() is needed when putting
the value on the wire. This solves the backward originator-ids seend by
Tony Sarendal. OK henning@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Apr 4 12:03:26 2006 UTC (18 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.90: +5 -4 lines
Diff to previous 1.90 (colored)

add "set nexthop self", force nexthop to be set to own address even with IBGP
requested & tested Falk Brockerhoff <fb@smartterra.de>, and tony sarendal
tested this too. claudio ok

Revision 1.90 / (download) - annotate - [select for diffs], Wed Mar 22 10:18:49 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.89: +3 -1 lines
Diff to previous 1.89 (colored)

Add a new SHOW imsg to send optional attributes to bgpctl. This can be used
to show communites in bgpctl output. Only send these messages if it they are
requested to reduce the overhead for simple listings. Looks good henning@

Revision 1.89 / (download) - annotate - [select for diffs], Thu Feb 9 21:05:09 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.88: +2 -1 lines
Diff to previous 1.88 (colored)

Implement "set community delete 65001:*" and friends. This will remove
communities from the path attributes. Useful to make sure that the ones you
set later are set by a (evil) peer.  OK henning@

Revision 1.88 / (download) - annotate - [select for diffs], Thu Feb 2 14:06:05 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

Implement new special community "neighbor-as". neighbor-as is expanded on
the fly to the remote AS of the current neighbor. This can be used to
simplify rulesets in a dramatic way -- going from a script based nightmare
down to a handfull rules. jajajaja henning@

Revision 1.87 / (download) - annotate - [select for diffs], Tue Jan 24 14:14:04 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.86: +4 -2 lines
Diff to previous 1.86 (colored)

Check if filter changed on a per peer basis. This should speed up the
table run done later as many filter evaluations can be skipped.
From the softreconfig in tree. Looks good henning@

Revision 1.86 / (download) - annotate - [select for diffs], Tue Jan 24 13:34:33 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

Finally start using the Adj-RIB-In. The most complex part is the modification
of path_update(). There are about 10 different ways how to update a path and
some of them are tricky. Looks good henning@

Revision 1.85 / (download) - annotate - [select for diffs], Fri Jan 20 16:40:17 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.84: +6 -4 lines
Diff to previous 1.84 (colored)

Proactively fix prefix counters. Currently only F_LOCAL prefixes exist but
as soon as F_ORIGINAL come the counters would no longer be correct and in the
end max-prefix would no longer work. Add additinal counters for F_ORIGINAL
prefixes and bump the correct conter depending on the prefix flags.
OK henning@

Revision 1.84 / (download) - annotate - [select for diffs], Fri Jan 20 16:06:12 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

Pass flags to prefix_move() so that a prefix that has both F_ORIGINAL and
F_LOCAL set can be moved correctly. This is more like a add as we have one
prefix more afterwards. Looks good henning@

Revision 1.83 / (download) - annotate - [select for diffs], Sat Jan 14 22:39:49 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.82: +11 -5 lines
Diff to previous 1.82 (colored)

Small step in supporting the Adj-RIB-In additionaly to the Local-RIB.
First step is to define two flags F_LOCAL and F_ORIGINAL. These flags
are used to distinguish prefix in the Local-RIB and those in the Adj-
RIB-In. Adapt prefix API and add additional checks so that no Adj-RIB-
In prefixes get mistakenly selected. Currently no F_ORIGINAL prefixes
are created but this may change soon. Looks good Henning.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jan 12 14:05:13 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.81: +5 -4 lines
Diff to previous 1.81 (colored)

Copy AS path in rde_filter() on demand instead of doing it before calling
rde_filter(). Adapt path_update() to this change too. path_update() does
a path_copy before linking the rde_aspath into the RIB. Looks good Henning.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Jan 10 16:11:12 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

The attributes cache broke the set community filterset because community_set()
modified the attribute data directly and corrupted the cache by doing it.
It is no longer allowed to modify attributes via attr_optget() -> change
attr->data. Instead remove the old attribute from the aspath and then add
a new modifed one again. Included in this change is the removal of a "feature"
that allowed only one community per AS. If you had problems to add multiple
communities via filters then this was the problem. Looks good Henning.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Jan 5 16:00:07 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.79: +12 -6 lines
Diff to previous 1.79 (colored)

Cache optional BGP attributes (mostly communities) and use a simple
pointer plus a ref counter to link the attributes to the path object.
Saves +/- 10M on 11 full feeds. Looks good Henning

Revision 1.79 / (download) - annotate - [select for diffs], Tue Jan 3 22:49:17 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.78: +3 -1 lines
Diff to previous 1.78 (colored)

Track some (memory) statistics in the RDE. Accessible via bgpctl.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jan 3 22:19:59 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.77: +4 -4 lines
Diff to previous 1.77 (colored)

Move functions shared with bgpctl into new file util.c. Simplifies the
link between bgpctl and bgpd mostly because of rde_attr.c.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Dec 30 17:20:21 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.76: +1 -3 lines
Diff to previous 1.76 (colored)

There is no attr_mp_nexthop() function, remove the prototype.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Dec 30 16:40:15 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.75: +1 -2 lines
Diff to previous 1.75 (colored)

Remove unused attr_optlen()

Revision 1.75 / (download) - annotate - [select for diffs], Fri Dec 30 14:07:40 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.74: +1 -2 lines
Diff to previous 1.74 (colored)

Use sys/hash.h instead of own built functions that work similar.
While there reorder some structs to help with alignment.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Nov 29 21:11:07 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

Add a flags field to struct prefix which will be used shortly. Remove the peer
pointer so that the size does not grow. Adding 4 bytes to struct prefix would
result in 64MB more memory usage on one of my systems.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Nov 2 13:19:30 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.72: +3 -1 lines
Diff to previous 1.72 (colored)

Implement filterset_equal() and rde_filter_equal(). Both return 1 if
the two passed filter(set)s are equal or 0 otherwise. rde_filter_equal()
has an additional argument dir to specify which direction should be considered.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Nov 1 15:21:54 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.71: +7 -5 lines
Diff to previous 1.71 (colored)

Softreconfig out support. On config reload filter changes of outgoing rules
will propagte directly to the neighbors. There is no need to restart bgpd
in that case. Currently not optimal but a good start. "get it in" henning@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Nov 1 14:37:16 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.70: +6 -2 lines
Diff to previous 1.70 (colored)

Major cleanup in rde_update.c. Merge equal code used in different places
into own functions. Move up_dump_upcall() into rde.c and rename it
rde_up_dump_upcall(). This is needed for the next step.
up_test_update() tests if an update or withdraw is needed and up_generate()
creates the updates.  "get it in" henning@ (he is eager on softreconfig out)

Revision 1.70 / (download) - annotate - [select for diffs], Wed Aug 10 08:34:06 2005 UTC (18 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

Pass the correct peer to rde_apply_set(). rde_apply_set() needs to know
the peer where the prefix came from so that prepend-neighbor works.
Extend rde_filter() and make sure that the correct peer is passed.
Until now most cases resulted in a NULL peer causing a nasty crash that
was found by David Ulevitch. OK henning@

Revision 1.69 / (download) - annotate - [select for diffs], Fri Jul 29 12:38:40 2005 UTC (18 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.68: +6 -2 lines
Diff to previous 1.68 (colored)

Add another piece to the IPv6 puzzle. This time code to generate MP updates.
Does not affect IPv4 minimaly tested for IPv6 because we still don't have an
IPv6 capable neighbor. henning@ ya

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jul 1 12:10:21 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.67: +1 -2 lines
Diff to previous 1.67 (colored)

The newly introduced function filterset_free() existed already as
rde_free_set(), I just missed it when I was looking for it.
Kill rde_free_set() and use the more correct filterset_free() from now on.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jul 1 09:19:24 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored)

Make the pftable filter set use the name2id "cache" like the route labels.
This saves 14 bytes per aspath. OK henning@

Revision 1.66 / (download) - annotate - [select for diffs], Wed Jun 29 09:43:26 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored)

rtlabel support via filter sets. Just use "set rtlabel foobar" in filters
network and neighbor statements and the routes are labeled accordingly.
While doing that fix some mem-leaks by introducing filterset_free() and
remove the free on send option of send_filterset().
This took a bit longer because we need to carefully track the rtlabel id
refcnts or bad things may happen on reloads.
henning@ looks fine

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jun 10 09:58:09 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

Introduce attr_optlen() to get the total lenght of an optional attribute
plus header. Soon needed.

Revision 1.64 / (download) - annotate - [select for diffs], Tue Apr 12 14:32:00 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (colored)

Introduce a per prefix weight.  The weight is used to tip prefixes with equal
long AS pathes in one or the other direction.  It weights a prefix at a very
late stage in the decision process. This is a nice bgpd feature to traffic
engineer networks where most AS pathes are equally long.
OK henning@

Revision 1.63 / (download) - annotate - [select for diffs], Fri Mar 11 12:54:20 2005 UTC (19 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.62: +14 -13 lines
Diff to previous 1.62 (colored)

Finally commit the transparent-as and nexthop no-modify stuff I wrote on the
way to FOSDEM. With transparent-as set to ye bgpd will not prepend his own
AS for sent updates. NB the neighbor needs to set "enforce neighbor-as no"
or it will not like the received AS paths. With set nexthop no-modify bgpd
will change the nexthop as done normaly.
OK henning@ man page update with help of jmc@

Revision 1.62 / (download) - annotate - [select for diffs], Thu Dec 23 15:08:43 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.61: +17 -20 lines
Diff to previous 1.61 (colored)

sort structs for most optimal alignment, help mickey, claudio ok

Revision 1.61 / (download) - annotate - [select for diffs], Tue Nov 23 13:07:01 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.60: +5 -4 lines
Diff to previous 1.60 (colored)

Switch from a single filter_set to a linked list of sets. With this change
it is possible to specify multiple communities. This is also the first step
to better bgpd filters. OK henning@

Revision 1.60 / (download) - annotate - [select for diffs], Thu Nov 11 13:06:45 2004 UTC (19 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.59: +3 -2 lines
Diff to previous 1.59 (colored)

Store the local v4 and v6 address of a session. For IPv4 sessions the first
IPv6 address with global scope of the interface used by the session is used.
In any case the local endpoint of the session is used for one of the two no
matter what scope.
OK henning@

Revision 1.59 / (download) - annotate - [select for diffs], Thu Nov 11 10:35:15 2004 UTC (19 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored)

New config statement "rde route-age [evaluate|ignore]". If set to evaluate
the best path selection will not only be based on the path attributes but
also on the age of the prefix. This is an extension to the RFC. The default
is ignore but previously it was implicitly set to evaluate.
OK henning@ man page OK jaredy@ jmc@

Revision 1.58 / (download) - annotate - [select for diffs], Wed Nov 10 12:41:58 2004 UTC (19 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

Remove no longer needed code. OK henning@

Revision 1.57 / (download) - annotate - [select for diffs], Tue Sep 28 15:48:52 2004 UTC (19 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

gcc-ism.  We don't want it, we don't need it.
OK henning@ noticed by deraadt@

Revision 1.56 / (download) - annotate - [select for diffs], Tue Sep 28 12:09:31 2004 UTC (19 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Add prepend-neighbor feature. Prepend the remote-as n times similar to
prepend-self. Only for incomming UPDATEs. OK henning@

Revision 1.55 / (download) - annotate - [select for diffs], Fri Aug 13 14:03:20 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.54: +3 -1 lines
Diff to previous 1.54 (colored)

Fix minor issues with IPv6 dumps and add a function for dumping the RIB table
protocol independent. This new dump format is not (yet) supported by the
mrtd route_btoa tool. OK henning@

Revision 1.54 / (download) - annotate - [select for diffs], Thu Aug 12 10:24:16 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Just ignore RFC2545 and the silly idea of using link local addresses as
nexthop. This makes the code a lot simpler. OK henning@

Revision 1.53 / (download) - annotate - [select for diffs], Tue Aug 10 13:02:08 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.52: +5 -3 lines
Diff to previous 1.52 (colored)

switch nexthop in struct filter_set form struct in_addr to struct bgpd_addr
OK henning@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Aug 10 12:57:18 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.51: +8 -7 lines
Diff to previous 1.51 (colored)

Correctly set the MED in outgoing UPDATEs. OK henning@

Revision 1.51 / (download) - annotate - [select for diffs], Fri Aug 6 12:04:08 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.50: +69 -58 lines
Diff to previous 1.50 (colored)

Monster diff to get one step closer to IPv6 support.
Cleanup path attribute handling. First of all kill struct attr_flags, all
those infos are now in struct rde_aspath. Second move attribute parser
functions into rde.c, rde_attr.c is shared between bgpd and bgpctl.
Third reimplementation of the nexthop handling. Make it IPv6 ready and
fix some major bug relating to "set nexthop".
henning@ OK if it breaks nothing

Revision 1.50 / (download) - annotate - [select for diffs], Thu Aug 5 20:56:12 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

As usual cleanup on exit. OK henning@

Revision 1.49 / (download) - annotate - [select for diffs], Thu Aug 5 18:44:19 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.48: +14 -23 lines
Diff to previous 1.48 (colored)

Cleanup aspath specific functions and api. Mainly switch to a refcnt based
allocation. This helps to save a bit of RAM. looks good henning@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Aug 5 15:58:21 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

rename and move prefix_equal() to prefix_compare() which returns -1, 0, 1
similar to memcmp() and all other compare functions in bgpd. OK henning@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jul 30 14:44:30 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.46: +2 -1 lines
Diff to previous 1.46 (colored)

Add new announce type "default-route" which will only announce the default
route to the specified neighbor. Idea and OK henning@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jul 28 16:02:14 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored)

The default localpreference is 100 and not 0. Found and ok henning@

Revision 1.45 / (download) - annotate - [select for diffs], Tue Jul 13 17:57:20 2004 UTC (19 years, 11 months ago) by jaredy
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

fix some typos

ok henning otto

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jul 5 16:54:53 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.43: +3 -1 lines
Diff to previous 1.43 (colored)

implement "set nexthop blackhole" and "set nexthop reject"
blackhole/reject routes will be entered to the kernel for matching ones.
this is intended to be used with the Cymru Bogon Route Server Project
(http://www.cymru.com/BGP/bogon-rs.html) and similar services, claudio ok

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jun 24 23:15:58 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.42: +9 -4 lines
Diff to previous 1.42 (colored)

First step at multiprotocol support, only partially done.
OK henning@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jun 22 20:28:58 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.41: +25 -5 lines
Diff to previous 1.41 (colored)

Make the RDE IPv6 ready missing is the message handling. The internal
prefix tree changed form a hash table to a per AF RB tree.
OK henning@ some ideas are from Brent Graveland.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jun 20 18:35:12 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

at least somewhat consistently name the TAILQ_ENTRYs... this confused me
more than once

Revision 1.40 / (download) - annotate - [select for diffs], Fri May 21 15:36:40 2004 UTC (20 years ago) by claudio
Branch: MAIN
Changes since 1.39: +5 -3 lines
Diff to previous 1.39 (colored)

RFC 2796 bgp route reflector support. This is very useful in conjunction
with templates. looks good, go for it henning@

Revision 1.39 / (download) - annotate - [select for diffs], Mon May 17 12:39:32 2004 UTC (20 years ago) by djm
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

extend filter language to allow basic setting of COMMUNITIES attribute.
ok claudio@

Revision 1.38 / (download) - annotate - [select for diffs], Fri May 7 10:06:15 2004 UTC (20 years, 1 month ago) by djm
Branch: MAIN
Changes since 1.37: +6 -1 lines
Diff to previous 1.37 (colored)

add a filter option to dump prefixes learned in UPDATEs into a PF table,
intended for building realtime BGP blacklists (e.g. with spamd);
ok claudio & henning

Revision 1.37 / (download) - annotate - [select for diffs], Sat Apr 10 17:27:28 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.36: +1 -11 lines
Diff to previous 1.36 (colored)

move the API_* and SAFI_* defines to where they belong

Revision 1.36 / (download) - annotate - [select for diffs], Thu Mar 11 17:12:51 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.35: +6 -2 lines
Diff to previous 1.35 (colored)

Add basic support for communities. Currently it is only possible to filter
on communities, e.g match from any community 24640:* set localpref 666
OK henning@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 11 14:22:23 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

Shutdown the RDE cleanly on exit. Plug some memleaks. OK henning@

Revision 1.34 / (download) - annotate - [select for diffs], Fri Mar 5 22:21:32 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

Plug some memory leaks in rde. Based on a patch by Patrick Latifi.
Added attr_move() so that we can copy the attribute before calling the filter.
path_update() will now use the passed attribute so it can't be simply reused.
OK henning@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 1 16:02:01 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored)

Make it possible to diable the decision process. This is a feature only useful
for route-collectors. OK henning@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Feb 27 20:53:56 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

remove unneded peer pointer in struct prefix and change a in_addr_t to
struct in_addr. OK henning@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Feb 26 16:16:41 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.30: +6 -1 lines
Diff to previous 1.30 (colored)

show rib infrastructure. At least full dumps and per as dumps. Per prefix
dump need some more work. OK henning@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Feb 26 14:00:33 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.29: +4 -3 lines
Diff to previous 1.29 (colored)

Implement "enforce neighbor-as yes|no" which is by default on for ebgp
neighbors. While doing that check also that the nexthop is valid (not class D
or E and not in 127/8 range). Kill some TODO and XXX and rename the british
neighbour to neighbor as used everywhere else. OK henning@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Feb 19 23:07:00 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.28: +8 -4 lines
Diff to previous 1.28 (colored)

Add support for basic filters. Nothing optimized and it has some issues but
this is a huge step forward. OK henning@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Feb 18 23:18:16 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.27: +8 -8 lines
Diff to previous 1.27 (colored)

Correctly handle parse errors in aspath and prefixes. Also do input aspath
loop detection. OK henning@

Revision 1.27 / (download) - annotate - [select for diffs], Wed Feb 18 16:36:09 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.26: +5 -2 lines
Diff to previous 1.26 (colored)

Bring the path attribute parsing on big step closer to the RFC.
Check that evry attribut is only allowed once and ensure that the
mandatory attributes are present.
no objections henning@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Feb 16 13:21:46 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Basic aspath match function needed for filters and the "show rib" bgpctl
command. OK henning@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Feb 16 12:58:45 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.24: +5 -2 lines
Diff to previous 1.24 (colored)

Add basic functions to print aspath in human readable format. OK henning@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Feb 16 12:53:15 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.23: +6 -2 lines
Diff to previous 1.23 (colored)

Make the path attribute handling more RFC conformant. Also move the
parser to rde_attr.c where it belongs. Still missing: better aspath loop
detection (should be done afterwards) and some basic error checking for
optional attributes. OK henning@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Feb 9 01:56:18 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.22: +5 -5 lines
Diff to previous 1.22 (colored)

replace a bunch of u_long by u_int32_t

Revision 1.22 / (download) - annotate - [select for diffs], Mon Feb 2 18:06:32 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

Somehow I missed this peace in one of my last commits. OK henning@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 17 19:35:36 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.20: +9 -9 lines
Diff to previous 1.20 (colored)

Make it possible to announce own networks. In the RDE these prefixes are
attached to a pseudo peer and inserted like all other prefixes into the RIB.
OK henning@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jan 13 16:08:04 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.19: +5 -4 lines
Diff to previous 1.19 (colored)

Fix the aspath_* functions to allow empty aspath. A empty aspath is one
with len 0. Needed vor ibgp and local network announcements.
OK henning@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 13 13:45:50 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

Implement a max-prefix and a announce none | self | all neighbor statement.
The first limits the number of sent prefixes per peer the latter controls
which prefix we do annouce to the neighbor.
Another looks good from henning@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jan 13 13:34:56 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

Better update error handling. Ensure that the session goes down and
ignore all queued updates after an error. Looks good henning@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jan 13 13:18:03 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.16: +5 -1 lines
Diff to previous 1.16 (colored)

Dump and send RIB to the neighbor if his session is comming up.
Now bgpctl neighbor <IP> up does work as expected.
Looks good from henning@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jan 12 13:33:16 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored)

Nexthop announcement fixup. There are different rules for ibgp and ebgp.
For ibgp the nexthop is normally passed unmodified unless the nexthop is
equal to the remote peer ip. To ebgp peers the nexthop is changed to the
local session ip unless the remote peer ip and the nexthop are on the same
subnet. OK henning@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jan 11 21:47:20 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.14: +13 -27 lines
Diff to previous 1.14 (colored)

Move all struct in_addr to either struct bgpd_addr or in_addr_t whichever
is more appropriate. The rde uses now in most cases struct bgpd_addr.
OK henning@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jan 11 20:13:00 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (colored)

Add to the IMSG_SESSION_UP message the local and remote address of the
peer session. This is needed to set the correct nexthop address in outgoing
bgp UPDATES. OK henning@

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jan 10 22:25:42 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.12: +4 -1 lines
Diff to previous 1.12 (colored)

Implement as path prepends. At least one prepend is needed for ebgp
neighbors. Fix a bug in the update generation. If no path attributes are
available e.g. a packet with only withdraws we need to set (and write) the
bgp path attribute field to zero. With this change we are able to send
valid updates to our neighbors with one exception: the nexthop field which
needs to be changed for ebgp neighbors.
OK henning@

Revision 1.12 / (download) - annotate - [select for diffs], Sat Jan 10 16:20:29 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.11: +49 -28 lines
Diff to previous 1.11 (colored)

RDE update generation. First we queue all updates and withdraws on a per
peer basis. A queue runner will dequeue and package those messages to valid
bgp UPDATE messages and send them to the SE.
Not yet done is per peer type attribute handling (like aspath prepends and
nexthop modifications) and the queue runner could be a tad smarter. All in
all this gives us a good starting point for the missing parts.
OK henning@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jan 6 10:51:14 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

2004 OK henning@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 30 13:03:27 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

typos from david

Revision 1.9 / (download) - annotate - [select for diffs], Fri Dec 26 22:41:01 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.8: +1 -2 lines
Diff to previous 1.8 (colored)

"when you try to be very smart, something breaks horribly"
zap aspath->state, which was a copy of aspath->nexthop->state, for a tiny
little bit faster access. tho, it happened what had to happen, they ran
out of sync.
it's just not worth it.

also add a missinf LIST_INIT.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Dec 26 21:30:20 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.7: +12 -2 lines
Diff to previous 1.7 (colored)

move struct nexthop definition to rde.h

Revision 1.7 / (download) - annotate - [select for diffs], Thu Dec 25 23:22:13 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 (colored)

RDE part of the nexthop verification puzzle.
The RDE just tracks the nexthop IPs and reacts on nexthop messages
from the parent.

ok henning@

Revision 1.6 / (download) - annotate - [select for diffs], Tue Dec 23 15:59:02 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.5: +7 -4 lines
Diff to previous 1.5 (colored)

Send updates to the main process so they can be added to the kernel
routing table. OK henning@

Revision 1.5 / (download) - annotate - [select for diffs], Sun Dec 21 22:16:53 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.4: +2 -3 lines
Diff to previous 1.4 (colored)

overhaul the write buffering code.
introduce msgbuf API and bundle all info needed for the write buffers in a
struct msgbuf.
also switch to a write queue per handled connection (each bgp session, each
pipe) instead of one big one.
fixes some subtle problems and is overall nicer.

ok claudio@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Dec 21 16:11:34 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.3: +9 -12 lines
Diff to previous 1.3 (colored)

yet more from the castathon; most aspath functions where accessing non-
aligned memory (u_int16_t) therefor crashed the RDE on my sparc64. All
buffer specific functions use now void * instead of u_char * so most cast
are now history. Tested on sparc64 and i386. OK henning@

Revision 1.3 / (download) - annotate - [select for diffs], Fri Dec 19 01:15:47 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +6 -6 lines
Diff to previous 1.2 (colored)

knf & 64-bit cleanup; henning ok

Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 18 22:22:22 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (colored)

First step for configuration merges in the RDE. Currently this will not
work correctly because the peer id changes on config reload. The code in
the RDE per se should be OK.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Dec 17 11:46:54 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN

welcome, bgpd
started by me some time ago with moral support from theo, the proceeded up to
the point where the session engine worked correctly. claudio jeker joined
then and did a lot of work in the RDE.
it is not particulary usefull as application right now as parts are still
missing but is imported to enable more people to work on it.
status:
BGP sessions get established fine, OPEN messages and then KEEPALIVEs
exchanged etc. session FSM works fine; NOTIFICATIONs are handled fine, and
all connection drops etc I provoked get handled fine.
Incoming UPDATE messgages are parsed well and the data entered to the RIB,
the decision process is not yet there, neither is outgoing UPDATEs or sync
to the kernel routing table.

not connected to the builds yet.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.