OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.625 / (download) - annotate - [select for diffs], Wed May 22 08:41:14 2024 UTC (2 weeks, 3 days ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.624: +15 -14 lines
Diff to previous 1.624 (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.624 / (download) - annotate - [select for diffs], Wed Mar 20 09:35:46 2024 UTC (2 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.623: +6 -6 lines
Diff to previous 1.623 (colored)

Cleanup AID handling.

- Loops over all valid AID should start with AID_MIN and go up to AID_MAX - 1
   e.g. for (i = AID_MIN; i < AID_MAX; i++)
  If for some reason AID_UNSPEC must be handled make that explicit in the
  for loop.

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

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

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

OK tb@

Revision 1.623 / (download) - annotate - [select for diffs], Thu Feb 22 06:45:22 2024 UTC (3 months, 2 weeks ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.622: +8 -1 lines
Diff to previous 1.622 (colored)

Workaround for gcc3 - the use of anonymous unions now makes it complain
when named initializers use fields within these anonymous unions.

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

ok claudio@

Revision 1.622 / (download) - annotate - [select for diffs], Sat Feb 3 00:11:34 2024 UTC (4 months ago) by jsg
Branch: MAIN
Changes since 1.621: +2 -1 lines
Diff to previous 1.621 (colored)

add missing fatal() call in rde_peer_send_rrefresh()

found by "if statement not indented" smatch warning
ok claudio@

Revision 1.621 / (download) - annotate - [select for diffs], Fri Feb 2 16:10:33 2024 UTC (4 months ago) by claudio
Branch: MAIN
Changes since 1.620: +3 -4 lines
Diff to previous 1.620 (colored)

Cleanup a couple of fatal messages to be less bad.

Revision 1.620 / (download) - annotate - [select for diffs], Tue Jan 30 13:50:09 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.619: +31 -49 lines
Diff to previous 1.619 (colored)

Convert he ATTR_ASPATH and ATTR_AS4_PATH handlers in rde_attr_parse()
to new ibuf API.

Various aspath functions are modified to work better with ibufs.
aspath_inflate() now only works with ibufs and is a lot simpler.
aspath_verify() does all the checks using the ibuf api and therefor
most length checks can be skipped.
aspath_asprint() and the new internal aspath_strsize() and aspath_snprint()
are totally overhauled -- including some bugs that got squashed.
OK tb@

Revision 1.619 / (download) - annotate - [select for diffs], Thu Jan 25 11:13:35 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.618: +9 -3 lines
Diff to previous 1.618 (colored)

Use RFC7606 treat-as-withdraw for ORIGIN attributes with an invalid value.

OK tb@

Revision 1.618 / (download) - annotate - [select for diffs], Thu Jan 25 09:46:12 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.617: +59 -62 lines
Diff to previous 1.617 (colored)

Convert most attributes in rde_attr_parse() to new ibuf API.

This skips ATTR_ASPATH and ATTR_AS4_PATH for now, those will follow soon.
Reshuffle checks a little bit. While ibuf_get does ensure that enough data
is available do a precise size check to ensure that only the expected amount
of data is available.

OK tb@

Revision 1.617 / (download) - annotate - [select for diffs], Wed Jan 24 14:51:11 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.616: +9 -15 lines
Diff to previous 1.616 (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.616 / (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.615: +197 -255 lines
Diff to previous 1.615 (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.615 / (download) - annotate - [select for diffs], Tue Jan 23 14:39:10 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.614: +4 -3 lines
Diff to previous 1.614 (colored)

Split cases and call peer_stale() individually instead of using a
conditional argument.
OK tb@

Revision 1.614 / (download) - annotate - [select for diffs], Mon Jan 15 15:44:50 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.613: +175 -219 lines
Diff to previous 1.613 (colored)

Convert the simple bits of imsg handling over to the new imsg API.

OK tb@

Revision 1.613 / (download) - annotate - [select for diffs], Thu Dec 14 13:52:37 2023 UTC (5 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.612: +3 -3 lines
Diff to previous 1.612 (colored)

Mostly straightforward conversion to imsg_get_fd() only the handling
of the control socket needs a local variable since imsg_get_fd() can
only be called once on an imsg.
OK tb@

Revision 1.612 / (download) - annotate - [select for diffs], Tue Nov 7 11:18:35 2023 UTC (7 months ago) by claudio
Branch: MAIN
Changes since 1.611: +10 -10 lines
Diff to previous 1.611 (colored)

Rename struct imsgbuf *ibuf to *imsgbuf in all places.
ibuf should be reserved for struct ibuf * values.
OK tb@

Revision 1.611 / (download) - annotate - [select for diffs], Mon Oct 16 10:25:45 2023 UTC (7 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.610: +35 -13 lines
Diff to previous 1.610 (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.610 / (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.609: +6 -28 lines
Diff to previous 1.609 (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.609 / (download) - annotate - [select for diffs], Fri Aug 4 09:20:12 2023 UTC (10 months ago) by claudio
Branch: MAIN
Changes since 1.608: +3 -2 lines
Diff to previous 1.608 (colored)

Instead of forcing a NUL into struct ctl_neighbor descr adjust the
peer matching code to only match at maximum sizeof(n->descr) bytes
using strncmp().
OK tb@

Revision 1.608 / (download) - annotate - [select for diffs], Wed Jul 12 14:45:42 2023 UTC (10 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.607: +32 -84 lines
Diff to previous 1.607 (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.578.2.2 / (download) - annotate - [select for diffs], Wed Jul 12 12:44:19 2023 UTC (10 months, 3 weeks ago) by tb
Branch: OPENBSD_7_2
Changes since 1.578.2.1: +5 -9 lines
Diff to previous 1.578.2.1 (colored) to branchpoint 1.578 (colored) next main 1.579 (colored)

In rde_attr_parse() if an attribute causes a parse error which results in
a treat-as-withdraw consume the full attribute by updating plen else the
parser will fail parsing a possible next element which results in a
session reset.

Initial report by Ben Cox (ben at benjojo.co.uk)
OK tb@
from claudio

This is errata/7.2/028_bgpd.patch.sig

Revision 1.597.4.2 / (download) - annotate - [select for diffs], Wed Jul 12 12:41:43 2023 UTC (10 months, 3 weeks ago) by tb
Branch: OPENBSD_7_3
Changes since 1.597.4.1: +5 -9 lines
Diff to previous 1.597.4.1 (colored) to branchpoint 1.597 (colored) next main 1.598 (colored)

In rde_attr_parse() if an attribute causes a parse error which results in
a treat-as-withdraw consume the full attribute by updating plen else the
parser will fail parsing a possible next element which results in a
session reset.

Initial report by Ben Cox (ben at benjojo.co.uk)
OK tb@
from claudio

This is errata/7.3/006_bgpd.patch.sig

Revision 1.607 / (download) - annotate - [select for diffs], Wed Jul 12 12:31:28 2023 UTC (10 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.606: +5 -9 lines
Diff to previous 1.606 (colored)

In rde_attr_parse() if an attribute causes a parse error which results in
a treat-as-withdraw consume the full attribute by updating plen else the
parser will fail parsing a possible next element which results in a
session reset.

Initial report by Ben Cox (ben at benjojo.co.uk)
OK tb@

Revision 1.606 / (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.605: +4 -10 lines
Diff to previous 1.605 (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.597.4.1 / (download) - annotate - [select for diffs], Mon May 1 05:13:59 2023 UTC (13 months, 1 week ago) by tb
Branch: OPENBSD_7_3
Changes since 1.597: +6 -5 lines
Diff to previous 1.597 (colored)

Rework the way transit provider AID masks are built and sent to the RDE.
ASPA provider AS sets can include optional limitations to inet/inet6 these
limits are represented in the TAS_AID bit masks (2bits per AS).
Introduce a TAS_AID_SIZE() makro that returns the size in bytes of this
bit mask (rounded to the next uint32_t).
Without this change aspa objects with AID specific elements trigger a
fatal error condition when the config is loaded.
OK tb@ job@
from claudio

Fix missing whitespace in bgpd(8) output
from job

This is errata/7.3/001_bgpd.patch.sig

Revision 1.605 / (download) - annotate - [select for diffs], Thu Apr 20 15:44:45 2023 UTC (13 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.604: +6 -5 lines
Diff to previous 1.604 (colored)

Rework the way transit provider AID masks are built and sent to the RDE.
ASPA provider AS sets can include optional limitations to inet/inet6 these
limits are represented in the TAS_AID bit masks (2bits per AS).
Introduce a TAS_AID_SIZE() makro that returns the size in bytes of this
bit mask (rounded to the next uint32_t).
Without this change aspa objects with AID specific elements trigger a
fatal error condition when the config is loaded.
OK tb@ job@

Revision 1.604 / (download) - annotate - [select for diffs], Thu Apr 20 12:53:27 2023 UTC (13 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.603: +173 -3 lines
Diff to previous 1.603 (colored)

Implement IMSG_CTL_SHOW_FLOWSPEC and IMSG_FLOWSPEC_FLUSH and add bits for
IMSG_FLOWSPEC_ADD and IMSG_FLOWSPEC_REMOVE received from bgpctl via SE.
OK tb@

Revision 1.603 / (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.602: +35 -3 lines
Diff to previous 1.602 (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.602 / (download) - annotate - [select for diffs], Wed Apr 19 07:12:22 2023 UTC (13 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.601: +89 -1 lines
Diff to previous 1.601 (colored)

Implement code to pass the flowspec config over to the RDE. The parent
process tracks which prefixes are added / removed and issues the
corresponding imsg calls.
Right now the RDE does nothing with the received information.
OK tb@

Revision 1.601 / (download) - annotate - [select for diffs], Thu Apr 13 15:51:16 2023 UTC (13 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.600: +4 -10 lines
Diff to previous 1.600 (colored)

Simplify how IMSG_CTL_SHOW_RIB_COMMUNITIES is constructed. This can just
call imsg_compose() and be done with it.
OK tb@

Revision 1.600 / (download) - annotate - [select for diffs], Fri Apr 7 13:49:03 2023 UTC (14 months ago) by claudio
Branch: MAIN
Changes since 1.599: +5 -4 lines
Diff to previous 1.599 (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.599 / (download) - annotate - [select for diffs], Mon Apr 3 10:48:00 2023 UTC (14 months ago) by claudio
Branch: MAIN
Changes since 1.598: +37 -17 lines
Diff to previous 1.598 (colored)

Add first step of flowspec support. This adds the bits to establish a
connection with SAFI 133. Right now any sent UPDATE with SAFI 133 is
simply ignored. At the moment SAFI 134 (flowspec for L3VPN) is unsupported.
OK tb@

Revision 1.598 / (download) - annotate - [select for diffs], Tue Mar 28 08:32:42 2023 UTC (14 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.597: +7 -7 lines
Diff to previous 1.597 (colored)

Switch role logic in rde_aspa_validity() since this may need to be extended.
OK tb@ mbuhl@

Revision 1.544.2.2 / (download) - annotate - [select for diffs], Tue Mar 21 21:10:28 2023 UTC (14 months, 2 weeks ago) by bluhm
Branch: OPENBSD_7_1
Changes since 1.544.2.1: +3 -3 lines
Diff to previous 1.544.2.1 (colored) to branchpoint 1.544 (colored) next main 1.545 (colored)

Improve length checks for ATTR_MP_REACH_NLRI.
Based on a report by cjt (melissa_cjt at 163.com)
from claudio@;  OK tb@

this is errata/7.1/027_bgpd.patch.sig

Revision 1.578.2.1 / (download) - annotate - [select for diffs], Tue Mar 21 21:10:06 2023 UTC (14 months, 2 weeks ago) by bluhm
Branch: OPENBSD_7_2
Changes since 1.578: +3 -3 lines
Diff to previous 1.578 (colored)

Improve length checks for ATTR_MP_REACH_NLRI.
Based on a report by cjt (melissa_cjt at 163.com)
from claudio@;  OK tb@

this is errata/7.2/023_bgpd.patch.sig

Revision 1.597 / (download) - annotate - [select for diffs], Tue Mar 21 14:52:36 2023 UTC (14 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE
Branch point for: OPENBSD_7_3
Changes since 1.596: +3 -3 lines
Diff to previous 1.596 (colored)

Improve length checks for ATTR_MP_REACH_NLRI.
Based on a report by cjt (melissa_cjt at 163.com)
OK tb@

Revision 1.596 / (download) - annotate - [select for diffs], Mon Mar 13 16:52:42 2023 UTC (14 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.595: +11 -6 lines
Diff to previous 1.595 (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.595 / (download) - annotate - [select for diffs], Fri Mar 10 07:57:15 2023 UTC (15 months ago) by claudio
Branch: MAIN
Changes since 1.594: +23 -26 lines
Diff to previous 1.594 (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.594 / (download) - annotate - [select for diffs], Thu Mar 9 13:12:19 2023 UTC (15 months ago) by claudio
Branch: MAIN
Changes since 1.593: +66 -37 lines
Diff to previous 1.593 (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.593 / (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.592: +3 -6 lines
Diff to previous 1.592 (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.592 / (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.591: +24 -38 lines
Diff to previous 1.591 (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.591 / (download) - annotate - [select for diffs], Tue Jan 24 14:13:12 2023 UTC (16 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.590: +31 -3 lines
Diff to previous 1.590 (colored)

Implement filter and control message matching for ASAP.

This adds avs (ASPA validation state) which can be 'unknown', 'valid'
or 'invalid'. It behaves similar to ovs but the ASPA validation state
of paths from iBGP sessions is 'unknown' and the role of the ebgp session
is important to get the right validation state.

OK tb@

Revision 1.590 / (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.589: +118 -57 lines
Diff to previous 1.589 (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.589 / (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.588: +12 -13 lines
Diff to previous 1.588 (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.588 / (download) - annotate - [select for diffs], Wed Jan 18 13:20:00 2023 UTC (16 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.587: +3 -3 lines
Diff to previous 1.587 (colored)

Improve pending checks in poll loop by ordering them by trigger frequency
and by making peer_imsg_pending() a true O(1) function.
OK tb@

Revision 1.587 / (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.586: +99 -5 lines
Diff to previous 1.586 (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.586 / (download) - annotate - [select for diffs], Mon Jan 16 10:37:08 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.585: +2 -2 lines
Diff to previous 1.585 (colored)

Fix bad MP logic in the route refresh handling.
Found by and fix provided by Zenon Mousmoulas (@zmousm)

Revision 1.585 / (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.584: +7 -13 lines
Diff to previous 1.584 (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.584 / (download) - annotate - [select for diffs], Wed Jan 11 17:10:25 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.583: +20 -19 lines
Diff to previous 1.583 (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.583 / (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.582: +45 -1 lines
Diff to previous 1.582 (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.582 / (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.581: +4 -4 lines
Diff to previous 1.581 (colored)

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

Revision 1.581 / (download) - annotate - [select for diffs], Wed Dec 14 14:16:20 2022 UTC (17 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.580: +7 -5 lines
Diff to previous 1.580 (colored)

Do the IPv4 specific MP capability check only once per update/withdraw
instead of per prefix.
OK sthen@

Revision 1.580 / (download) - annotate - [select for diffs], Fri Nov 18 10:17:23 2022 UTC (18 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.579: +6 -1 lines
Diff to previous 1.579 (colored)

Add plumbing for ASPA support. This implements the parser and part of the
logic in the rtr process. It does not implement the new RTR messages yet
but it is possible to specify an aspa-set in the config. Also the validation
code in the RDE is missing so this does not do anything.
With this in it will be possible to extend rpki-client to publish an
aspa-set as part of the openbgpd config file.
OK tb@

Revision 1.579 / (download) - annotate - [select for diffs], Mon Nov 7 22:48:35 2022 UTC (19 months ago) by mbuhl
Branch: MAIN
Changes since 1.578: +2 -1 lines
Diff to previous 1.578 (colored)

Fix a memory leak in the error path of rde_dump_ctx_new.
ctx is leaked in case of an allocation in prefix_dump_new,
prefix_dump_subtree, rib_dump_new, or rib_dump_subtree fails.

Found by CodeChecker.

OK claudio@

Revision 1.578 / (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
Branch point for: OPENBSD_7_2
Changes since 1.577: +2 -2 lines
Diff to previous 1.577 (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.577 / (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.576: +23 -13 lines
Diff to previous 1.576 (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.576 / (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.575: +10 -68 lines
Diff to previous 1.575 (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.575 / (download) - annotate - [select for diffs], Fri Sep 9 13:33:24 2022 UTC (20 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.574: +33 -9 lines
Diff to previous 1.574 (colored)

Implement the F_SHORTER filter by doing explicit lookups for each possible
prefixlen. Even for IPv6 this is much faster than a full table walk.
OK tb@

Revision 1.574 / (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.573: +12 -14 lines
Diff to previous 1.573 (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.573 / (download) - annotate - [select for diffs], Wed Aug 31 15:51:44 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.572: +1 -6 lines
Diff to previous 1.572 (colored)

Remove IMSG_CTL_SHOW_RIB_HASH and struct rde_hashstats which are no
longer used. Also cleanup some hash sizes which are also no longer used.
OK tb@

Revision 1.572 / (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.571: +1 -6 lines
Diff to previous 1.571 (colored)

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

Revision 1.571 / (download) - annotate - [select for diffs], Wed Aug 31 11:25:36 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.570: +11 -1 lines
Diff to previous 1.570 (colored)

Make sure that only one roa softreconfig runner is run at any time.
If a run takes to long drop the current update and wait for the next update.
OK benno@

Revision 1.570 / (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.569: +1 -2 lines
Diff to previous 1.569 (colored)

Switch nexthop hash to a RB tree.
OK benno@

Revision 1.569 / (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.568: +4 -7 lines
Diff to previous 1.568 (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.568 / (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.567: +1 -5 lines
Diff to previous 1.567 (colored)

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

Revision 1.567 / (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.566: +1 -5 lines
Diff to previous 1.566 (colored)

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

Revision 1.566 / (download) - annotate - [select for diffs], Mon Aug 29 14:57:27 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.565: +3 -1 lines
Diff to previous 1.565 (colored)

Export pending update and withdraw as part of struct peer_stats.
OK tb@

Revision 1.565 / (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.564: +64 -55 lines
Diff to previous 1.564 (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.564 / (download) - annotate - [select for diffs], Wed Aug 17 15:15:26 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.563: +14 -14 lines
Diff to previous 1.563 (colored)

Convert bzero() to memset(), bcmp() to memcmp() and bcopy() to memcpy().

The memory regions passed to memcpy() can not overlap so no need for memmove().
OK tb@ deraadt@

Revision 1.563 / (download) - annotate - [select for diffs], Tue Aug 16 08:14:58 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.562: +2 -10 lines
Diff to previous 1.562 (colored)

Do not send kroutes from the RDE to the FIB with the true_nexthop but
instead use exit_nexthop (the nexthop from BGP). The FIB code can then
do the lookup and replace the nexthop in the FIB.

This solves an issue when multiple nexthops change concurrently. In the
RDE the decision process handles these changes ansynchronously which
resulted in bad true_nexthops to be sent to the FIB. The exit_nethop
is stable so the data sent to the FIB is always correct.

Fix a bug in netxhop tracking introduced in 1.280. On RTM_CHANGE when the
nexthop of a kroute changes a knexthop_send_update() must be sent but
knexthop_track() does not do that because the kroute did not change.
Introduce a knexthop_update() function for this case instead.

OK tb@

Revision 1.562 / (download) - annotate - [select for diffs], Wed Aug 10 14:17:01 2022 UTC (21 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.561: +6 -10 lines
Diff to previous 1.561 (colored)

More kroute_nexthop cleanup. Mainly use direct assignment instead of
memcpy(). Additionally replace a bzero() with memset() and remove to
superfluous bzero calls.
OK tb@

Revision 1.561 / (download) - annotate - [select for diffs], Wed Aug 10 11:11:02 2022 UTC (21 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.560: +7 -8 lines
Diff to previous 1.560 (colored)

Fix logic in network_dump_upcall()

The nexthop can be valid but still a NULL pointer. In that case just set
the aid like it is done for invalid nexthops. If the nexthop is set by
explicitly specifying one then include the exit_nexthop, that is the
nexthop that is relevant for BGP. Further cleanup the function as usual.
OK tb@

Revision 1.544.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.544: +2 -3 lines
Diff to previous 1.544 (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.560 / (download) - annotate - [select for diffs], Thu Jul 28 13:11:50 2022 UTC (22 months, 1 week ago) by deraadt
Branch: MAIN
Changes since 1.559: +9 -9 lines
Diff to previous 1.559 (colored)

whitespace found during a read-thru; ok claudio

Revision 1.559 / (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.558: +2 -3 lines
Diff to previous 1.558 (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.558 / (download) - annotate - [select for diffs], Sat Jul 23 08:44:06 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.557: +1 -2 lines
Diff to previous 1.557 (colored)

There is no need to set kf.flags to F_KERNEL here.
From a previous diff that was reverted because of a different issue.
was OK tb@

Revision 1.557 / (download) - annotate - [select for diffs], Fri Jul 22 17:26:58 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.556: +2 -1 lines
Diff to previous 1.556 (colored)

Revert previous commit. The RTP_MINE checks on struct kroute_full are
not correct because kr_tofull() replaces RTP_MINE with the real priority.
Noticed because of incorrect nexthop selection.

Revision 1.556 / (download) - annotate - [select for diffs], Fri Jul 22 11:17:48 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.555: +1 -2 lines
Diff to previous 1.555 (colored)

Retire the F_KERNEL flag, it got superseded by route priority and RTP_MINE.

Only problem is when route(8) is used to modify/delete a bgpd owned route.
Exact behaviour for that is still a bit unclear but F_KERNEL does not help
in this case either. In the kr_fib_delete/change remove F_BGPD_INSERTED
in that case as a first step.
OK tb@

Revision 1.555 / (download) - annotate - [select for diffs], Tue Jul 19 10:26:19 2022 UTC (22 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.554: +27 -27 lines
Diff to previous 1.554 (colored)

Use kf for all struct kroute_full variables. Makes code more consistent.
OK tb@

Revision 1.554 / (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.553: +21 -1 lines
Diff to previous 1.553 (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.553 / (download) - annotate - [select for diffs], Mon Jul 11 16:51:01 2022 UTC (22 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.552: +2 -4 lines
Diff to previous 1.552 (colored)

When dumping prefixes for bgpctl just use prefix_eligible() to know if
a prefix is eligible / valid.
OK tb@

Revision 1.552 / (download) - annotate - [select for diffs], Fri Jul 8 08:11:25 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.551: +57 -10 lines
Diff to previous 1.551 (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.551 / (download) - annotate - [select for diffs], Thu Jul 7 13:55:52 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.550: +23 -21 lines
Diff to previous 1.550 (colored)

Skip dmetric related code for the Adj-RIB-Out since there is no decision
process there.
OK tb@

Revision 1.550 / (download) - annotate - [select for diffs], Thu Jul 7 12:38:19 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.549: +3 -1 lines
Diff to previous 1.549 (colored)

Properly break out of the loop setting the PREF flags.

Revision 1.549 / (download) - annotate - [select for diffs], Thu Jul 7 12:16:04 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.548: +24 -8 lines
Diff to previous 1.548 (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.548 / (download) - annotate - [select for diffs], Thu Jul 7 10:46:54 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.547: +16 -71 lines
Diff to previous 1.547 (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.547 / (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.546: +55 -6 lines
Diff to previous 1.546 (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.546 / (download) - annotate - [select for diffs], Wed May 25 16:03:34 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.545: +5 -5 lines
Diff to previous 1.545 (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.545 / (download) - annotate - [select for diffs], Fri May 6 15:51:09 2022 UTC (2 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.544: +3 -3 lines
Diff to previous 1.544 (colored)

Relax the limitation of what is an acceptable unicast IP.

Remove the IN_BADCLASS() check which filters out the experimental IPv4
address space. Now there are no more experiments in IPv4 and so there
is less reason for these network daemons to deny such an IP.
Everything still disallows multicast IPs (224/4) and loopback (127/8)
a few also disallow 0/8 but this is not consistent.

In any case using 240/4 in production is a really bad idea but it is
not up to this software to prevent you from being a fool.

OK deraadt@ tb@

Revision 1.544 / (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.543: +12 -13 lines
Diff to previous 1.543 (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.543 / (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.542: +9 -9 lines
Diff to previous 1.542 (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.542 / (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.541: +40 -10 lines
Diff to previous 1.541 (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.541 / (download) - annotate - [select for diffs], Mon Mar 21 10:15:34 2022 UTC (2 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.540: +3 -3 lines
Diff to previous 1.540 (colored)

Rename F_CTL_ACTIVE and F_PREF_ACTIVE to the more correct
F_CTL_BEST and F_PREF_BEST. This is used to mark the one
best path in bgpctl. When ECMP support is added then more
then one path can be active.
OK tb@

Revision 1.540 / (download) - annotate - [select for diffs], Thu Mar 3 13:06:15 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.539: +11 -16 lines
Diff to previous 1.539 (colored)

Move rde_send_kroute() from rde_generate_updates() to prefix_evaluate().
rde_generate_updates() should only handle RIB updates and the logic
for rde_send_kroute() may change in the future.
Refactor code to simplify it a bit and make it clear that to delete a
prefix from the FIB only the prefix/len is needed.
OK tb@

Revision 1.539 / (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.538: +3 -5 lines
Diff to previous 1.538 (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.538 / (download) - annotate - [select for diffs], Mon Feb 28 12:52:38 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.537: +5 -1 lines
Diff to previous 1.537 (colored)

In the Adj-RIB-Out specific dump functions assert that PREFIX_FLAG_ADJOUT
is set. Similar checks are done for updates and withdraws.
OK tb@

Revision 1.537 / (download) - annotate - [select for diffs], Sat Feb 26 11:48:50 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.536: +2 -2 lines
Diff to previous 1.536 (colored)

Remove excessive ;

Revision 1.536 / (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.535: +9 -5 lines
Diff to previous 1.535 (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.535 / (download) - annotate - [select for diffs], Thu Feb 24 14:54:03 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.534: +12 -8 lines
Diff to previous 1.534 (colored)

struct prefix holds path_id_tx for the path id sent to peers when
add-path send is enabled. Start using this instead of 0. Currently
nothing sets path_id_tx to any value != 0 so this is the same but
a bit more correct.
OK tb@

Revision 1.534 / (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.533: +119 -119 lines
Diff to previous 1.533 (colored)

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

Revision 1.533 / (download) - annotate - [select for diffs], Thu Jan 20 18:06:20 2022 UTC (2 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.532: +4 -4 lines
Diff to previous 1.532 (colored)

Make sure that all poll loops properly restart the poll loop on EINTR.
Also either fail hard or restart after other errors. In anycase do not
look at pollfds after an error.
OK benno@

Revision 1.532 / (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.531: +133 -46 lines
Diff to previous 1.531 (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.531 / (download) - annotate - [select for diffs], Tue Jul 27 07:50:01 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.530: +7 -3 lines
Diff to previous 1.530 (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.530 / (download) - annotate - [select for diffs], Fri Jun 25 09:25:48 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.529: +7 -8 lines
Diff to previous 1.529 (colored)

The network flush code only operates on peerself (like all the other
network commands). Instead of passing the peer as argument to the tree
walker just default to peerself in network_flush_upcall().
OK benno@

Revision 1.529 / (download) - annotate - [select for diffs], Fri Jun 25 09:23:26 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.528: +17 -17 lines
Diff to previous 1.528 (colored)

Do the multiprotocol check first for the IPv4 case. So it is the same
everywhere.
OK benno@

Revision 1.528 / (download) - annotate - [select for diffs], Thu Jun 24 13:03:31 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.527: +35 -61 lines
Diff to previous 1.527 (colored)

Simplify the multiprotocol handling by moving the while loops out of the
switch statement. This way common code is referenced only once.
OK sthen@

Revision 1.517.2.1 / (download) - annotate - [select for diffs], Fri Jun 18 17:55:22 2021 UTC (2 years, 11 months ago) by benno
Branch: OPENBSD_6_9
Changes since 1.517: +28 -6 lines
Diff to previous 1.517 (colored) next main 1.518 (colored)

During bgpd(8) config reloads prefixes of the wrong address family
could leak to peers resulting in session resets.

Original commit in -current:

  revision 1.525
  date: 2021/06/17 08:43:06;  author: claudio;  state: Exp;  lines: +31 -9;  commitid: Rrf7ysc$
  In Rev 1.511 I moved peer related checks from inside up_generate_updates()
  to rde_generate_updates() but forgot to add the same checks to
  rde_softreconfig_out(). As a result a config reload could result in
  prefixes for a not-negotiated address family to leak into the Adj-RIB-Out.
  Adjust both rde_generate_updates() and rde_softreconfig_out() to use the
  same filter logic.
  Also adjust rde_up_flush_upcall() to pass the peer as argument instead of
  using prefix_peer(). The up_generate_updates() call there does not need
  any filtering since the walker runs on the Adj-RIB-Out and just withdraws
  everything.
  OK job@ on a previous diff

This is errata/6.9/009_bgpd.patch.sig.

Revision 1.527 / (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.526: +83 -7 lines
Diff to previous 1.526 (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.526 / (download) - annotate - [select for diffs], Thu Jun 17 10:28:36 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.525: +25 -29 lines
Diff to previous 1.525 (colored)

Refactor common code for peer filtering out into rde_skip_peer()
and use it in the two places that need to keep in sync.
OK sthen@

Revision 1.525 / (download) - annotate - [select for diffs], Thu Jun 17 08:43:06 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.524: +31 -9 lines
Diff to previous 1.524 (colored)

In Rev 1.511 I moved peer related checks from inside up_generate_updates()
to rde_generate_updates() but forgot to add the same checks to
rde_softreconfig_out(). As a result a config reload could result in
prefixes for a not-negotiated address family to leak into the Adj-RIB-Out.
Adjust both rde_generate_updates() and rde_softreconfig_out() to use the
same filter logic.
Also adjust rde_up_flush_upcall() to pass the peer as argument instead of
using prefix_peer(). The up_generate_updates() call there does not need
any filtering since the walker runs on the Adj-RIB-Out and just withdraws
everything.
OK job@ on a previous diff

Revision 1.524 / (download) - annotate - [select for diffs], Thu May 27 16:32:13 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.523: +3 -1 lines
Diff to previous 1.523 (colored)

Stop processing UPDATES if the peer is not up.
When the RDE issues an UPDATE NOTIFICATION because of some fatal error
like max-prefix count reached the peer is put into state PEER_ERR by
rde_update_err() and all UDPDATEs that are still queued should be dropped.
Noticed and OK deraadt@, OK job@

Revision 1.523 / (download) - annotate - [select for diffs], Thu May 27 14:32:08 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.522: +9 -22 lines
Diff to previous 1.522 (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.522 / (download) - annotate - [select for diffs], Thu May 27 08:38:42 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.521: +13 -9 lines
Diff to previous 1.521 (colored)

Fix how the rde_eval_all flag is tracked. Make sure it is correctly set
when a new peer shows up or during a reload. Tracking this during runtime
just does not work reliably (especially  for reloads).
Problem noticed and fix tested by Pier Carlo Chiodi

Revision 1.521 / (download) - annotate - [select for diffs], Tue May 25 14:18:44 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.520: +6 -22 lines
Diff to previous 1.520 (colored)

Instead of the old way of prefix withdraw on a bad AS4_PATH treat it with
prefix withdraw as required by RFC6793. Also update the documentation to
reference RFC6793 instead of the older 4893.
OK sthen@

Revision 1.520 / (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.519: +43 -20 lines
Diff to previous 1.519 (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.519 / (download) - annotate - [select for diffs], Tue Apr 27 09:07:10 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.518: +2 -2 lines
Diff to previous 1.518 (colored)

Fix notification sub-error code for syntactically incorrect nexthops.
The right suberror is ERR_UPD_NEXTHOP.
Reported by cjt (melissa_cjt at 163.com)
OK benno@

Revision 1.518 / (download) - annotate - [select for diffs], Sat Apr 24 17:04:24 2021 UTC (3 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.517: +1 -3 lines
Diff to previous 1.517 (colored)

remove bgpd warning message exposed by "bgpctl show rib peer out" for
non-existant peer; the bgpctl command exposes the error itself
ok claudio

Revision 1.517 / (download) - annotate - [select for diffs], Fri Apr 16 06:20:29 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE
Branch point for: OPENBSD_6_9
Changes since 1.516: +8 -1 lines
Diff to previous 1.516 (colored)

Add back IMSG_RECONF_ROA_ITEM in the parent imsg handler. It is needed
for origin-sets. Found by and reminder procter@
OK deraadt@

Revision 1.516 / (download) - annotate - [select for diffs], Tue Mar 2 09:45:07 2021 UTC (3 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.515: +25 -7 lines
Diff to previous 1.515 (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.515 / (download) - annotate - [select for diffs], Tue Feb 16 08:29:16 2021 UTC (3 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.514: +171 -53 lines
Diff to previous 1.514 (colored)

Add RTR support to OpenBGPD. Add basic support for the protocol.
The RTR client runs in a new process where the protocol handling is done
and when new data is available all sources are merged into one ROA set
which is then loaded into the RDE. The roa-set from the config is also
handled by the new RTR engine.
Tested by and ok job@

Revision 1.514 / (download) - annotate - [select for diffs], Mon Jan 25 09:15:24 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.513: +21 -5 lines
Diff to previous 1.513 (colored)

RFC6472 discourages the use of AS_SET segements in ASPATH attributes.
The main reason is that AS_SET does not play nice with RPKI ROA.

Introduce a per neighbor and global config option
    'reject as-set yes' and 'reject as-set no'
If set to yes received UPDATES with AS_SET segements are rejected.
This is done the same way other ASPATH soft-errors are handled. The UPDATE
is marked invalid and all prefixes are treated as withdraws.
`bgpctl show rib in error` can be used to show prefixes that where denied
and treated as withdraws because of errors.

By default this feature is off.

OK benno@

Revision 1.513 / (download) - annotate - [select for diffs], Mon Jan 18 12:15:36 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.512: +37 -41 lines
Diff to previous 1.512 (colored)

Change struct bgpd_addr VPN encoding. Instead of including two almost
equal versions put the RD and lable stack right into struct bgpd_addr.
For non-VPN addresses these extra fields are ignored. Since VPN and non-VPN
addresses encode the prefix in the same way now some code can be simplified.
In most cases a fallthrough or reuse of encoding functions is now possible.
It should also reduce the size of struct bgpd_addr a bit.
OK denis@

Revision 1.512 / (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.511: +5 -3 lines
Diff to previous 1.511 (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.511 / (download) - annotate - [select for diffs], Sat Jan 9 16:49:41 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.510: +16 -2 lines
Diff to previous 1.510 (colored)

Move peer related checks from up_test_update() to rde_generate_updates()
both the export check and the address family check should be done as
early as possible since these peers will not need any kind of updates
to happen. Also remove the non-standard ORIGINATOR_ID check.
With this up_test_update() becomes a simple true/false function which
makes the rest of the code a bit simpler.
OK benno@

Revision 1.510 / (download) - annotate - [select for diffs], Wed Dec 30 07:29:56 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.509: +59 -2 lines
Diff to previous 1.509 (colored)

Implement IMSG_CTL_SHOW_SET to get information about roa-set, as-sets and
prefix-sets loaded into the RDE. For now only the number of prefixes or
asnumbers are shown plus the time since the last change was done to the table.
OK benno@

Revision 1.509 / (download) - annotate - [select for diffs], Wed Dec 30 07:02:10 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.508: +4 -6 lines
Diff to previous 1.508 (colored)

Use correct IMSG type in fatal message. Also reformat some not so long lines.
Bad IMSg name noticed by proctor@

Revision 1.508 / (download) - annotate - [select for diffs], Tue Dec 29 15:30:34 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.507: +11 -24 lines
Diff to previous 1.507 (colored)

In preparation for RTR support change the representation of the roa-set
in the parent to a simple RB tree based on struct roa. With this overlapping
ROAs (same prefix & source-as but different maxlen) are now merged in the RDE
when the lookup trie is constructed.
OK benno@

Revision 1.507 / (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.506: +79 -18 lines
Diff to previous 1.506 (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.506 / (download) - annotate - [select for diffs], Thu Nov 5 14:44:59 2020 UTC (3 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.505: +6 -5 lines
Diff to previous 1.505 (colored)

Mark some common symbols of RDE and SE as static so that linking
with -fno-common does not fail.
OK bcook@

Revision 1.505 / (download) - annotate - [select for diffs], Thu Nov 5 11:52:59 2020 UTC (3 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.504: +2 -3 lines
Diff to previous 1.504 (colored)

Kill bgpd_process, nothing uses it anymore. Instead pass the process
type directly to log init. One less common in bgpd.
OK benno@

Revision 1.504 / (download) - annotate - [select for diffs], Thu Nov 5 11:51:13 2020 UTC (3 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.503: +11 -5 lines
Diff to previous 1.503 (colored)

Refactor the filterset handling of nexthops. Instead of depending on
bgpd_process and changing the behaviour that way add a new filterset
type ACTION_SET_NEXTHOP_REF which is used when the nexthop reference
of the union is used. Adjust the RDE to convert ACTION_SET_NEXTHOP to
ACTION_SET_NEXTHOP_REF when receiving the filtersets.
OK benno@

Revision 1.503 / (download) - annotate - [select for diffs], Wed Oct 21 06:56:32 2020 UTC (3 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.502: +3 -5 lines
Diff to previous 1.502 (colored)

rde_update_dispatch() was switched to void some time ago. There is no
need to use or set error anymore.
OK deraadt@

Revision 1.502 / (download) - annotate - [select for diffs], Sat May 2 14:12:17 2020 UTC (4 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.501: +5 -3 lines
Diff to previous 1.501 (colored)

The warning "bad AGGREGATOR, AS 0 not allowed ..." is not very helpful.
Make it a log_debug() instead to reduce the noise seen on most full feeds.
The DFZ is currently not clean enough to properly drop AS 0 in that case.
OK job@ deraadt@

Revision 1.501 / (download) - annotate - [select for diffs], Wed Feb 12 10:33:56 2020 UTC (4 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.500: +2 -2 lines
Diff to previous 1.500 (colored)

Move the code to figure out the alternate IP address (IPv6 addr for IPv4
sessions and vice versa) from the RDE to the SE. The SE is the right place
for this since there getsockname(2) fetches the local address and so the
alternate one can be fetched there as well.
With this the route pledge is no longer needed in the RDE and the pledge
is now just "stdio recvfd".
OK benno@

Revision 1.500 / (download) - annotate - [select for diffs], Fri Jan 24 05:44:05 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.499: +2 -3 lines
Diff to previous 1.499 (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.499 / (download) - annotate - [select for diffs], Fri Jan 10 13:22:26 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.498: +19 -5 lines
Diff to previous 1.498 (colored)

'export default-route' still requires an output filter rule to announce
the prefix. When reloading the config the export needs to be redone as
part of softreconfig out else fixing the filters has no effect and a
session reset is required.
Note: changing the export setting still needs a session reset
OK benno@

Revision 1.498 / (download) - annotate - [select for diffs], Thu Jan 9 13:31:52 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.497: +22 -533 lines
Diff to previous 1.497 (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.497 / (download) - annotate - [select for diffs], Thu Jan 9 11:55:25 2020 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.496: +4 -4 lines
Diff to previous 1.496 (colored)

Convert the lastchange of a prefix from time(NULL) to getmonotime() which
uses CLOCK_MONOTONIC. Convert the control messages to return the relative
age of the prefix instead of the absolute age. Adjust the mrt dump code
to stil dump the route age in seconds since epoch as defined in the RFC.
With this all times in bgpd are now based on CLOCK_MONOTONIC.
OK denis@

Revision 1.496 / (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.495: +2 -2 lines
Diff to previous 1.495 (colored)

eye burning whitespace

Revision 1.495 / (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.494: +102 -94 lines
Diff to previous 1.494 (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.494 / (download) - annotate - [select for diffs], Tue Dec 31 11:53:46 2019 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.493: +1 -3 lines
Diff to previous 1.493 (colored)

reloadtime is not needed anymore.

Revision 1.493 / (download) - annotate - [select for diffs], Mon Dec 16 10:35:02 2019 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.492: +68 -72 lines
Diff to previous 1.492 (colored)

Instead of passing the peer id down to peer specific functions do the lookup
in the imsg handler and pass a struct rde_peer pointer to those functions.
OK denis@

Revision 1.492 / (download) - annotate - [select for diffs], Fri Dec 13 14:10:56 2019 UTC (4 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.491: +8 -8 lines
Diff to previous 1.491 (colored)

In rde_dispatch_imsg_session() reorder the case blocks a bit so they
group better together.

Revision 1.491 / (download) - annotate - [select for diffs], Wed Nov 27 01:21:54 2019 UTC (4 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.490: +9 -13 lines
Diff to previous 1.490 (colored)

struct ctl_show_rib does not need aspath_len since this information is
known through the imsg lenght.
OK benno@

Revision 1.489.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.489: +63 -12 lines
Diff to previous 1.489 (colored) next main 1.490 (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.490 / (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.489: +63 -12 lines
Diff to previous 1.489 (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.489 / (download) - annotate - [select for diffs], Fri Sep 27 14:50:39 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.488: +70 -53 lines
Diff to previous 1.488 (colored)

Move the rde_send_pftable_commit() our of the prefix_update and withdraw
function and up higher in the call stack. While there also make sure that
flushing announced networks does the pftable dance. This is now also using
prefix_withdraw like most other code. Reshuffle rde_update_dispatch() a bit
so that all returns are before the first update or withdraw call. After that
the code always exits via the end of the function where the commit happens.
OK benno@

Revision 1.488 / (download) - annotate - [select for diffs], Fri Sep 27 10:33:07 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.487: +31 -12 lines
Diff to previous 1.487 (colored)

Implement F_SHORTER in the prefix lookup code for bgpctl. F_SHORTER will
match all prefixes that have a shorter prefixlen than the one in the request.
It will print all routes which cover the specified prefix.
OK job@ sthen@

Revision 1.487 / (download) - annotate - [select for diffs], Wed Aug 14 11:57:21 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.486: +81 -71 lines
Diff to previous 1.486 (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.486 / (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.485: +30 -30 lines
Diff to previous 1.485 (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.485 / (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.484: +8 -11 lines
Diff to previous 1.484 (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.484 / (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.483: +12 -12 lines
Diff to previous 1.483 (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.483 / (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.482: +116 -58 lines
Diff to previous 1.482 (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.482 / (download) - annotate - [select for diffs], Wed Aug 7 06:55:53 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.481: +22 -2 lines
Diff to previous 1.481 (colored)

Implement the last few missing bits of RFC7607 and ensure that the AS in
AGGREGATOR and AS4_AGGREGATOR are non zero. All other cases have already
been covered.
OK benno@

Revision 1.481 / (download) - annotate - [select for diffs], Mon Aug 5 08:46:55 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.480: +32 -62 lines
Diff to previous 1.480 (colored)

Cleanup config reload in the RDE. Use the bgpd_conf struct to store sets
and l3vpns instead of temporary globals. Also rework rde_reload_done to
free filters and sets earlier. The soft-reconfiguration process no longer
needs the previous filters / sets to do its work since there is a full
Adj-RIB-Out.
OK benno@

Revision 1.480 / (download) - annotate - [select for diffs], Mon Aug 5 08:36:19 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.479: +12 -26 lines
Diff to previous 1.479 (colored)

Change the order how filtersets are passed during config reloads. Instead
of sending them after e.g. the filter rule send them before. The benefit
is that the filterset is present when a rule is added and so the filter
rule is complete at that moment.
OK benno@

Revision 1.479 / (download) - annotate - [select for diffs], Wed Jul 24 20:25:27 2019 UTC (4 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.478: +1 -2 lines
Diff to previous 1.478 (colored)

mrt.h only needs to be included by mrt.c
ok claudio@

Revision 1.478 / (download) - annotate - [select for diffs], Tue Jul 23 13:07:32 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.477: +3 -1 lines
Diff to previous 1.477 (colored)

Make sure that pfd is not overflown, can not happen unless the mrt count
is off.

Revision 1.477 / (download) - annotate - [select for diffs], Tue Jul 23 06:26:44 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.476: +7 -5 lines
Diff to previous 1.476 (colored)

Clean up RIB related kroute code. Introduce a way to flush a FIB table
from the RDE. Make sure that all nexthops don't get removed in the FIB
when a FIB table is removed. This should only happen for the main FIB.
Remove F_RIB_HASNOFIB which is just confusing since there is already
F_RIB_NOFIB and F_RIB_NOFIBSYNC.
OK benno@

Revision 1.476 / (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.475: +195 -75 lines
Diff to previous 1.475 (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.475 / (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.474: +4 -4 lines
Diff to previous 1.474 (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.474 / (download) - annotate - [select for diffs], Tue Jun 25 09:04:42 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.473: +2 -1 lines
Diff to previous 1.473 (colored)

Initialize the peer id of peerself to PEER_ID_SELF before adding it to
peer table. Fixes an endless loop of peer_down errors on shutdown.

Revision 1.473 / (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.472: +10 -10 lines
Diff to previous 1.472 (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.472 / (download) - annotate - [select for diffs], Sat Jun 22 05:36:40 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.471: +2 -2 lines
Diff to previous 1.471 (colored)

Adjust peer id allocation a bit. Use defines for the various special
values and intervals. Mostly the same with the exception that peerself
is now id 1 and the first peer has id 2 -- was 0 and 1 before.
OK kn@, benno@

Revision 1.471 / (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.470: +7 -5 lines
Diff to previous 1.470 (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.470 / (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.469: +5 -5 lines
Diff to previous 1.469 (colored)

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

Revision 1.469 / (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.468: +99 -72 lines
Diff to previous 1.468 (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.468 / (download) - annotate - [select for diffs], Sun Mar 31 17:02:47 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.467: +8 -4 lines
Diff to previous 1.467 (colored)

Don't use memcpy for struct bgpd_config, the pointers and lists in that
struct will most probably be wrong. Instead merge the sets and roa table
over by hand so that we know the data is correct and valid.
OK denis@ deraadt@

Revision 1.467 / (download) - annotate - [select for diffs], Sat Mar 23 13:09:56 2019 UTC (5 years, 2 months ago) by denis
Branch: MAIN
Changes since 1.466: +2 -2 lines
Diff to previous 1.466 (colored)

Unbreak route origin validation

OK benno@

Revision 1.466 / (download) - annotate - [select for diffs], Wed Mar 13 14:35:39 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.465: +3 -3 lines
Diff to previous 1.465 (colored)

Swap arguments of rde_dump_match_peer() to match peer_matched() in session.c

Revision 1.465 / (download) - annotate - [select for diffs], Thu Mar 7 07:42:36 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.464: +22 -35 lines
Diff to previous 1.464 (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.464 / (download) - annotate - [select for diffs], Wed Feb 27 04:31:56 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.463: +3 -3 lines
Diff to previous 1.463 (colored)

Convert the remote and local addresses in struct peer to be bgpd_addrs
instead of sockaddr_storage. This again helps protability and simplifies
some code. sa2addr now takes an optional pointer to return the port of
the sockaddr.
OK benno@

Revision 1.463 / (download) - annotate - [select for diffs], Thu Feb 14 10:34:54 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.462: +2 -2 lines
Diff to previous 1.462 (colored)

Use -1 instead of the less portable INFTIM for the poll timeout.
Result is the same.

Revision 1.462 / (download) - annotate - [select for diffs], Mon Feb 11 15:44:25 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.461: +70 -69 lines
Diff to previous 1.461 (colored)

The definition of VPNs in bgpd was never super elegant. The 'depend on
mpeX' config was a bit redundant. Also to make it more flexible (e.g. having
more than one mpeX interface per rdomain the syntax was changed.

To make this possible especially the network distribution logic had to be
adjusted and cleaned up. This should in general make network statements
well defined and conflicts between 'network A.B.C.D/N' and e.g. 'network static'
are handled in a well defined way ('network A.B.C.D/N' has preference).

With and OK dlg@, OK denis@

Revision 1.461 / (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.460: +56 -75 lines
Diff to previous 1.460 (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.460 / (download) - annotate - [select for diffs], Sun Jan 20 23:27:48 2019 UTC (5 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.459: +19 -2 lines
Diff to previous 1.459 (colored)

Support group descriptions in control messages that accept a neighbor
description. With this it is possible to show rib a group of peers, to show
or signal a group of peers all at once.
OK sthen@ benno@

Revision 1.459 / (download) - annotate - [select for diffs], Fri Jan 18 23:30:45 2019 UTC (5 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.458: +3 -1 lines
Diff to previous 1.458 (colored)

Don't store the mpe information in struct ktable but instead pass the
ifindex from the RDE over. This will allow to import prefixes to multiple
mpe interfaces in one rdomain.
OK dlg@

Revision 1.458 / (download) - annotate - [select for diffs], Mon Dec 31 08:53:09 2018 UTC (5 years, 5 months ago) by florian
Branch: MAIN
Changes since 1.457: +2 -1 lines
Diff to previous 1.457 (colored)

unbreak tree; found the hard way by otto

Revision 1.457 / (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.456: +85 -1 lines
Diff to previous 1.456 (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.456 / (download) - annotate - [select for diffs], Sun Dec 30 13:05:09 2018 UTC (5 years, 5 months ago) by benno
Branch: MAIN
Changes since 1.455: +6 -10 lines
Diff to previous 1.455 (colored)

remove unused F_ANN_DYNAMIC/F_PREFIX_ANNOUNCED handling in network_delete()
ok claudio@

Revision 1.455 / (download) - annotate - [select for diffs], Wed Dec 26 13:24:28 2018 UTC (5 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.454: +2 -2 lines
Diff to previous 1.454 (colored)

unbreak VPN routes installation into FIB

OK claudio@

Revision 1.454 / (download) - annotate - [select for diffs], Sat Dec 22 16:12:40 2018 UTC (5 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.453: +36 -4 lines
Diff to previous 1.453 (colored)

bgpctl can cause bgpd to do a lot of work (e.g. dumping all of the RIB)
but then bgpctl can quickly exit and bgpd still has to do all the work.
Instead introduce a terminate imsg to stop such long running commands if
bgpctl closes the connection before the run is over.
OK benno@, sthen@, deraadt@

Revision 1.453 / (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.452: +6 -5 lines
Diff to previous 1.452 (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.452 / (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.451: +6 -12 lines
Diff to previous 1.451 (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.451 / (download) - annotate - [select for diffs], Thu Nov 29 15:11:27 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.450: +23 -2 lines
Diff to previous 1.450 (colored)

In peer_down() we have to flush the Adj-RIB-Out. As soon as the peer state
is PEER_DOWN no updates will be processed anymore and quick flush can be made.
Fixes a memory leak and a use-after-free of the peer id in a bgpctl code path.
OK job@

Revision 1.450 / (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.449: +16 -21 lines
Diff to previous 1.449 (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.449 / (download) - annotate - [select for diffs], Sat Nov 10 11:19:01 2018 UTC (5 years, 6 months ago) by denis
Branch: MAIN
Changes since 1.448: +2 -2 lines
Diff to previous 1.448 (colored)

fix error message when querying a non-existent table

OK claudio@

Revision 1.448 / (download) - annotate - [select for diffs], Thu Nov 8 09:59:45 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.447: +28 -2 lines
Diff to previous 1.447 (colored)

Introduce rde_update_queue_pending() similar to rib_dump_pending() it checks
if there are any neighbors that have pending updates. If so the timeout of
the poll loop is set to 0 so that the work is completet ASAP.
The regress test was not working because of this. The RDE was stuck in poll()
instead of sending the updates out.
Tested and OK denis@

Revision 1.447 / (download) - annotate - [select for diffs], Thu Nov 8 09:53:38 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.446: +2 -2 lines
Diff to previous 1.446 (colored)

Committed wrong version. Check the flags against the fib flags from the
config and not the old flags. Needed so that changing flags and rtableid
at the same time works.

Revision 1.446 / (download) - annotate - [select for diffs], Thu Nov 8 09:50:30 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.445: +6 -5 lines
Diff to previous 1.445 (colored)

Only whack the RIB and recreate it if the the FIB distribution flags changed
or the rtableid changed and there is a FIB. In the NOFIB case changing the
rtableid has no effect. Fixes a problem introduced with keeping the default
ribs alive and Adj-RIB-In/Out.
Probelm found, tested and OK denis@

Revision 1.445 / (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.444: +68 -123 lines
Diff to previous 1.444 (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.444 / (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.443: +1 -2 lines
Diff to previous 1.443 (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.443 / (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.442: +111 -42 lines
Diff to previous 1.442 (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.442 / (download) - annotate - [select for diffs], Mon Oct 29 09:22:48 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.441: +5 -9 lines
Diff to previous 1.441 (colored)

Fix route-collector mode by allowing the RDE to disable the decision process
on reload but after that not allowing it to be re-enabled. So now it is
possible to enable route-collector mode again but it is still not possible
to turn it of via reload. Problem reported by Aaron A. Glenn.
OK benno@

Revision 1.441 / (download) - annotate - [select for diffs], Fri Oct 26 06:48:59 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.440: +7 -7 lines
Diff to previous 1.440 (colored)

When walking the list of ribs use continue instead of break after the
rib_valid() check. The list of ribs can have holes.
OK benno@

Revision 1.440 / (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.439: +128 -180 lines
Diff to previous 1.439 (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.439 / (download) - annotate - [select for diffs], Wed Oct 24 08:18:14 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.438: +16 -22 lines
Diff to previous 1.438 (colored)

Pass down the right nexthop to rde_dump_rib_as() so that dumping the
Adj-RIB-Out prints the right (modified) nexthop. Found by Marko Cupac.
OK benno@

Revision 1.438 / (download) - annotate - [select for diffs], Mon Oct 22 07:46:55 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.437: +13 -6 lines
Diff to previous 1.437 (colored)

Properly throttle dumping of prefixes to peers. Eventhough we got the XON/XOFF
messages the RDE did not act based on them. This mostly ensures that large
UPDATE runs (e.g. on peer up) are not flodding the imsg queue and therfore
delaying other imsgs.
OK denis@ benno@

Revision 1.437 / (download) - annotate - [select for diffs], Thu Oct 18 12:19:09 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.436: +4 -5 lines
Diff to previous 1.436 (colored)

In rde_update_queue_runner() reset eor on every loop else a spurious and
most probably wrong EoR could be sent out because the variable persisted
over iterations.

Revision 1.436 / (download) - annotate - [select for diffs], Thu Oct 18 09:28:53 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.435: +1 -2 lines
Diff to previous 1.435 (colored)

Remove unneeded break, there is one just after and makes the XON and XOFF
blocks look the same.

Revision 1.435 / (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.434: +2 -30 lines
Diff to previous 1.434 (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.434 / (download) - annotate - [select for diffs], Sun Oct 14 10:21:30 2018 UTC (5 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.433: +6 -1 lines
Diff to previous 1.433 (colored)

Unbreak mrt table dumps. Make sure to call rib_dump_r for the mrt dump
context once every poll loop until finished or data is queued.
OK benno@

Revision 1.433 / (download) - annotate - [select for diffs], Wed Oct 3 11:36:39 2018 UTC (5 years, 8 months ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.432: +29 -1 lines
Diff to previous 1.432 (colored)

add filter option based on origin validation state

OK claudio@

Revision 1.432 / (download) - annotate - [select for diffs], Mon Oct 1 23:09:53 2018 UTC (5 years, 8 months ago) by job
Branch: MAIN
Changes since 1.431: +2 -1 lines
Diff to previous 1.431 (colored)

Expose BGP Origin Validation state in bgpctl show commands

OK denis@ claudio@

Revision 1.431 / (download) - annotate - [select for diffs], Sun Sep 30 10:56:47 2018 UTC (5 years, 8 months ago) by denis
Branch: MAIN
Changes since 1.430: +2 -2 lines
Diff to previous 1.430 (colored)

vstate might be used uninitialized

OK claudio@

Revision 1.430 / (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.429: +112 -57 lines
Diff to previous 1.429 (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.429 / (download) - annotate - [select for diffs], Sat Sep 29 07:58:06 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.428: +5 -1 lines
Diff to previous 1.428 (colored)

With the introduction of sets the config that is shipped to the RDE got
potentially much bigger. In bad cases the SE activated the config way
before the RDE which is not ideal. Introduce IMSG_RECONF_DRAIN which
acts as a barrier and ensures that both childs got all the config.
Only after that the IMSG_RECONF_DONE message is sent activating
the config in the childs more or less simultaneous.
OK benno@

Revision 1.428 / (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.427: +4 -1 lines
Diff to previous 1.427 (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.427 / (download) - annotate - [select for diffs], Tue Sep 25 08:08:38 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.426: +8 -4 lines
Diff to previous 1.426 (colored)

Fix loading of roa-sets in the RDE. From a much bigger diff but this
goes in now since it fixes a real issue.

Revision 1.426 / (download) - annotate - [select for diffs], Fri Sep 21 04:55:27 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.425: +44 -7 lines
Diff to previous 1.425 (colored)

Implement code to parse, print and reload roa-set tables.
This is sharing a lot of code with prefixset which makes all a bit easier.
A roa-set is defined like this:
roa-set "test2" {
  1.2.3.0/24 source-as 1,
  1.2.8.0/22 maxlen 24 source-as 3
}
No support for acting on this data yet.
Put it in deraadt@, OK benno@, input and OK denis@

Revision 1.425 / (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.424: +4 -5 lines
Diff to previous 1.424 (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.424 / (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.423: +2 -2 lines
Diff to previous 1.423 (colored)

whitespace cleanup, ok claudio@

Revision 1.423 / (download) - annotate - [select for diffs], Fri Sep 14 10:22:11 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.422: +3 -2 lines
Diff to previous 1.422 (colored)

Extend as_set to allow for different sized objects to be added. The only
requirement is that the first value of the struct is a 32bit ID which is
used in the bsearch. This allows to add more than just as numbers to a
set. as_set_match now returns a pointer to this data or NULL if not found.
OK benno@

Revision 1.422 / (download) - annotate - [select for diffs], Sun Sep 9 15:02:26 2018 UTC (5 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.421: +4 -4 lines
Diff to previous 1.421 (colored)

use rib_valid() to check if a rib is useable. ok claudio@

Revision 1.421 / (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.420: +15 -16 lines
Diff to previous 1.420 (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.420 / (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.419: +61 -36 lines
Diff to previous 1.419 (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.419 / (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.418: +54 -6 lines
Diff to previous 1.418 (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.418 / (download) - annotate - [select for diffs], Wed Sep 5 09:49:57 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.417: +2 -3 lines
Diff to previous 1.417 (colored)

Change the way as_compare() and aspath_match() handle 'neighbor-as'. Instead
of doing the condition before calling aspath_match() just pass the neighbor-as
down to as_compare() which then has all needed data for the lookup. While
doing this also remove one of the as fields in struct filter_as since the
min/max fields can be reused for unary operations.
OK denis@ phessler@

Revision 1.417 / (download) - annotate - [select for diffs], Wed Sep 5 07:31:29 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.416: +11 -8 lines
Diff to previous 1.416 (colored)

Change verification of communities a bit. Move the flag checking first since
it is currently terminal and then do the length check. If that one triggers
do a treat-as-withdraw but at the same time drop the bad attribute since it
is better to not have invalid attributes in the Adj-RIB-In since most code
does not expect that.
OK benno@

Revision 1.416 / (download) - annotate - [select for diffs], Wed Aug 29 19:47:47 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.415: +21 -15 lines
Diff to previous 1.415 (colored)

Make it possible to filter the RIB for invalid path which resulted in withdrawn
prefixes. This way it should be possible to inspect which prefixes have been
removed. While there also fix dumping of the Adj-RIB-In when requested to do so.
OK sthen@ denis@

Revision 1.415 / (download) - annotate - [select for diffs], Wed Aug 29 11:46:28 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.414: +6 -2 lines
Diff to previous 1.414 (colored)

When 'log updates' is enabled make sure that the case of an invalid path
can be distinguished from a withdraw that was caused by a deny filter.
OK sthen@

Revision 1.414 / (download) - annotate - [select for diffs], Thu Aug 9 12:54:06 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.413: +3 -1 lines
Diff to previous 1.413 (colored)

While softreconfig is running set the poll timeout to 0 so that the
runner makes progress and does not get hold back by poll sleeping at
the same time fds are still serviced first if they have data pending.

Revision 1.413 / (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.412: +102 -14 lines
Diff to previous 1.412 (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.412 / (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.411: +10 -10 lines
Diff to previous 1.411 (colored)

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

Revision 1.411 / (download) - annotate - [select for diffs], Mon Aug 6 15:59:01 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.410: +19 -3 lines
Diff to previous 1.410 (colored)

Validate the prefix sent in a  network delete call before trying to delete
it. We should not trust this input too much as found by Pierre Emeriaud.
OK benno@

Revision 1.410 / (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.409: +2 -2 lines
Diff to previous 1.409 (colored)

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

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

Replace two asp->peer with prefix_peer(p) which is the same.

Revision 1.408 / (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.407: +21 -22 lines
Diff to previous 1.407 (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.407 / (download) - annotate - [select for diffs], Fri Aug 3 14:10:39 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.406: +77 -35 lines
Diff to previous 1.406 (colored)

Reshuffle the way bgpd does the softreload after filter changes.
Walk each rib at most once and push it from there to all RIBs or peers
that need the update. Makes the logic more streight and so easier to run
in background.
Tested by and OK phessler@

Revision 1.406 / (download) - annotate - [select for diffs], Thu Aug 2 12:49:00 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.405: +11 -11 lines
Diff to previous 1.405 (colored)

Make a few more rde specific functions static.

Revision 1.405 / (download) - annotate - [select for diffs], Thu Aug 2 12:46:02 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.404: +2 -3 lines
Diff to previous 1.404 (colored)

Make free_prefixsets() accept a NULL pointer. Makes it behave more like
all other free functions bgpd has.

Revision 1.404 / (download) - annotate - [select for diffs], Thu Aug 2 09:46:35 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.403: +20 -5 lines
Diff to previous 1.403 (colored)

This brings the network code more in line with what regular update
processing does. It adds the prefix to Adj-RIB-In and if "log update" is
set it will also log the addition and removal of a prefix.
OK benno@

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

There is no longer the need to be careful in rde_softreconfig_in() when
traversing the prefix list. Since a while Adj-RIB-In is fully independent
and so updating the local RIB does not modify that list.
OK benno@

Revision 1.402 / (download) - annotate - [select for diffs], Fri Jul 27 12:03:17 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.401: +3 -3 lines
Diff to previous 1.401 (colored)

log_info -> log_debug since this is debug noise.

Revision 1.401 / (download) - annotate - [select for diffs], Tue Jul 24 12:58:37 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.400: +6 -1 lines
Diff to previous 1.400 (colored)

Add some debug log messages telling which RIBs and peers get sofreconfigured
during reload.
OK henning@

Revision 1.400 / (download) - annotate - [select for diffs], Tue Jul 24 10:10:58 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.399: +12 -10 lines
Diff to previous 1.399 (colored)

Use prefix_nexthop() to access the nexthop instead of dereferencing the
field in asp directly. This is a step to move the prefix from rde_aspath
to struct prefix.
OK benno@

Revision 1.399 / (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.398: +28 -22 lines
Diff to previous 1.398 (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.398 / (download) - annotate - [select for diffs], Sun Jul 22 06:03:17 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.397: +4 -4 lines
Diff to previous 1.397 (colored)

Adjust a log message and make sure that the data pointer is never increased
beyond the end. There was no access to it but still bad style.
OK tb@

Revision 1.397 / (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.396: +1 -148 lines
Diff to previous 1.396 (colored)

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

Revision 1.396 / (download) - annotate - [select for diffs], Fri Jul 20 14:49:15 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.395: +13 -13 lines
Diff to previous 1.395 (colored)

Rename rde_update_get_prefix and friends to nlri_get_prefix. Will be moved
to util.c shortly so that bgpctl can use those functions too.

Revision 1.395 / (download) - annotate - [select for diffs], Fri Jul 20 14:14:43 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.394: +6 -8 lines
Diff to previous 1.394 (colored)

Rename rde_update_extract_prefix to extract_prefix and make it static.
This is just an internal of the the rde_update_get_prefix functions.

Revision 1.394 / (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.393: +35 -33 lines
Diff to previous 1.393 (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.393 / (download) - annotate - [select for diffs], Fri Jul 13 08:18:11 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.392: +5 -2 lines
Diff to previous 1.392 (colored)

Move aspath_verify() and aspath_inflate() into util.c so bgpctl can use them.
With this it gets a bit easier to parse MRT update messages in bgpctl.
OK benno@ phessler@

Revision 1.392 / (download) - annotate - [select for diffs], Wed Jul 11 17:35:07 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.391: +3 -3 lines
Diff to previous 1.391 (colored)

Bump some of the hash table size to more resonable numbers.
Still probably not optimal but less bad.

Revision 1.391 / (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.390: +13 -1 lines
Diff to previous 1.390 (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.390 / (download) - annotate - [select for diffs], Tue Jul 10 15:13:35 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.389: +7 -47 lines
Diff to previous 1.389 (colored)

rde_update_get_prefix() and friends should also verify the prefixlen.
This way the check can be removed from rde_update_dispatch() which is
just a duplicate of the general failure case of rde_update_get_prefix().
OK benno@ phessler@

Revision 1.389 / (download) - annotate - [select for diffs], Tue Jul 10 12:38:50 2018 UTC (5 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.388: +2 -2 lines
Diff to previous 1.388 (colored)

the check "if (nc->rtableid)"

is used as an indicator that we are dealing with network statements from within
rdomain <n> { } blocks.

That needs to check against the rdomain we are running in instead.

ok claudio@

Revision 1.388 / (download) - annotate - [select for diffs], Tue Jul 10 09:12:52 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.387: +21 -24 lines
Diff to previous 1.387 (colored)

Switch also the aspath in rde_update_dispatch() to one on the stack.
Simplifies the code a bit.
OK denis@ phessler@

Revision 1.387 / (download) - annotate - [select for diffs], Tue Jul 10 08:00:09 2018 UTC (5 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.386: +2 -2 lines
Diff to previous 1.386 (colored)

compare the right things here: we want to know if the flag has changed.
Found with claudios help and patience.
ok phessler@ claudio@

Revision 1.386 / (download) - annotate - [select for diffs], Mon Jul 9 14:44:02 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.385: +17 -42 lines
Diff to previous 1.385 (colored)

Move the max prefix checker into rde_update_update() instead of doing it
3 times outside.
OK sthen@

Revision 1.385 / (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.384: +43 -54 lines
Diff to previous 1.384 (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.384 / (download) - annotate - [select for diffs], Thu Jul 5 10:25:26 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.383: +11 -30 lines
Diff to previous 1.383 (colored)

Simplify rde_softreconfig_in(). There is no need to run the prefix through
the previous filter. path_update() and prefix_remove() are both smart enough
to handle the various cases correctly. Should reduce reload time with large
rulesets.
OK phessler@

Revision 1.383 / (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.382: +17 -20 lines
Diff to previous 1.382 (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.382 / (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.381: +15 -17 lines
Diff to previous 1.381 (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.381 / (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.380: +6 -32 lines
Diff to previous 1.380 (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.380 / (download) - annotate - [select for diffs], Wed Jun 13 09:33:51 2018 UTC (5 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.379: +4 -2 lines
Diff to previous 1.379 (colored)

Deprecate announce (all|self|none|default-route)
The announce keyword was overloaded and confused a lot of operators, time
to clean it up and while there incorporate RFC8212 guideline for propagation.
- `announce all` is the new default but the default deny filter will
  make sure that by default nothing is leaked
- `announce self` is no more and results in syntax error
- `announce none` is now `export none`
- `announce default-route` becomes `export default-route`
- the filters are switched to a default deny rule both incoming and outgoing

You most certainly need to adjust your config!

Best is to change the config in advance by using `announce all` explicitly on
all neighbors and adding `deny from any` and `deny to any` at the start of
your filters and adjust the rest of the filters to still produce the same
result.  `bgpd -nv -f bgpd.conf ` and `bgpctl show rib out nei foo` are good
tools to verify the changes.
Lots of discussions with job@, deraadt@, sthen@
OK job@

Revision 1.379 / (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.378: +12 -6 lines
Diff to previous 1.378 (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.378 / (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.377: +91 -4 lines
Diff to previous 1.377 (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.377 / (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.376: +6 -6 lines
Diff to previous 1.376 (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.376 / (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.375: +7 -7 lines
Diff to previous 1.375 (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.375 / (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.374: +61 -56 lines
Diff to previous 1.374 (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.374 / (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.373: +13 -9 lines
Diff to previous 1.373 (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.373 / (download) - annotate - [select for diffs], Tue Nov 14 22:04:50 2017 UTC (6 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.372: +2 -2 lines
Diff to previous 1.372 (colored)

Inverse logic, issue found by henning@. MPLS VPN is still broken though.

Revision 1.372 / (download) - annotate - [select for diffs], Thu Sep 14 18:16:28 2017 UTC (6 years, 8 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.371: +3 -3 lines
Diff to previous 1.371 (colored)

fix accounting for received prefixes per neighbor

noticed by deraadt@ and job@

OK benno@ deraadt@ job@

Revision 1.371 / (download) - annotate - [select for diffs], Fri Aug 11 16:02:53 2017 UTC (6 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.370: +11 -22 lines
Diff to previous 1.370 (colored)

softreconfig in and out are on by default for ever and machines now have
enough memory that it does not make sense to provide these knobs anymore.
They just make the code more complex for no much gain.
OK phessler@, benno@

Revision 1.370 / (download) - annotate - [select for diffs], Thu Aug 10 15:44:09 2017 UTC (6 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.369: +4 -3 lines
Diff to previous 1.369 (colored)

Fix a comment and line length. Noted by Dennis fondras.
ok benno@

Revision 1.369 / (download) - annotate - [select for diffs], Thu Aug 10 14:12:34 2017 UTC (6 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.368: +6 -1 lines
Diff to previous 1.368 (colored)

handle extended communities in bgpctl.
From Dennis Fondras, thanks!
ok phessler@

Revision 1.368 / (download) - annotate - [select for diffs], Mon May 29 13:10:40 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.367: +5 -8 lines
Diff to previous 1.367 (colored)

After some consideration, revert last commit and don't abuse rde_dump_done.
IMSG_CTL_SHOW_RIB_PREFIX case is not using rib_dump_r and so should not use
rde_dump_done, instead send the IMSG_CTL_END msg and free the ctx directly.
This is easier to understand.

Revision 1.367 / (download) - annotate - [select for diffs], Mon May 29 12:48:11 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.366: +7 -2 lines
Diff to previous 1.366 (colored)

Fix crash in IMSG_CTL_SHOW_RIB_PREFIX handling. The ctx is not added to
the list in that case so don't try to LIST_REMOVE it.
Problem found by benno@

Revision 1.366 / (download) - annotate - [select for diffs], Sun May 28 20:15:02 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.365: +7 -1 lines
Diff to previous 1.365 (colored)

Print when we send or recv an EOR marker.
Req by and OK benno@

Revision 1.365 / (download) - annotate - [select for diffs], Sun May 28 20:10:59 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.364: +5 -5 lines
Diff to previous 1.364 (colored)

Close imsg pipes later in the process. The shutdown code still tires to
send imsgs and so the SE and RDE crashed because of this late in shutdown.
OK benno@ phessler@

Revision 1.364 / (download) - annotate - [select for diffs], Sun May 28 12:21:36 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.363: +115 -14 lines
Diff to previous 1.363 (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.363 / (download) - annotate - [select for diffs], Sat May 27 18:12:23 2017 UTC (7 years ago) by phessler
Branch: MAIN
Changes since 1.362: +2 -1 lines
Diff to previous 1.362 (colored)

Allow an administrator to disable the bgp loop detection algorithm,
which is useful in very limited situations.

Angry dragons and grues will hunt for you, if you use it.

OK claudio@ sthen@ benno@

Revision 1.362 / (download) - annotate - [select for diffs], Sat May 27 10:33:15 2017 UTC (7 years ago) by phessler
Branch: MAIN
Changes since 1.361: +3 -2 lines
Diff to previous 1.361 (colored)

Allow OpenBGPD to selectively choose which local ASN to use per-peer.
This is intended to be used for ASN migrations, not for permanent use.

You MUST use filters to protect yourself from receiving your own routes.
There be dragons and grues.

OK claudio@ benno@

Revision 1.361 / (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.360: +26 -25 lines
Diff to previous 1.360 (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.360 / (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.359: +176 -176 lines
Diff to previous 1.359 (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.359 / (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.358: +2 -2 lines
Diff to previous 1.358 (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.358 / (download) - annotate - [select for diffs], Tue Jan 24 04:22:42 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.357: +8 -6 lines
Diff to previous 1.357 (colored)

sync log.c from relayd et al to bgpd.

there is still a little difference regarding handling of the verbosity
value that will be handled later.

ok claudio@ florian@

Revision 1.357 / (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.356: +4 -4 lines
Diff to previous 1.356 (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.356 / (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.355: +25 -24 lines
Diff to previous 1.355 (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.355 / (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.354: +37 -35 lines
Diff to previous 1.354 (colored)

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

Revision 1.354 / (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.353: +2 -2 lines
Diff to previous 1.353 (colored)

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

Revision 1.353 / (download) - annotate - [select for diffs], Thu Nov 10 09:18:33 2016 UTC (7 years, 6 months ago) by phessler
Branch: MAIN
Changes since 1.352: +8 -20 lines
Diff to previous 1.352 (colored)

draft-ietf-idr-optional-transitive-00 became RFC 7606

changes from the draft to the RFC:
 - PARTIAL flag is no longer considered protection
 - for some attrs, a length of 0 is invalid

OK florian@

Revision 1.352 / (download) - annotate - [select for diffs], Tue Oct 18 19:47:52 2016 UTC (7 years, 7 months ago) by benno
Branch: MAIN
Changes since 1.351: +4 -4 lines
Diff to previous 1.351 (colored)

"Terminate the session after number prefixes have been received" means
that max-prefix 1 will close the session on the first prefix which is
off by one to what one would expect. Change it to No. received >
max-prefix, which is also in line with other implementations.
Found by jbg@ and deraadt@.
ok phessler@ deraadt@ henning@ claudio@

Revision 1.351 / (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.350: +26 -1 lines
Diff to previous 1.350 (colored)

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

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

Revision 1.350 / (download) - annotate - [select for diffs], Sat Sep 3 16:22:17 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.349: +16 -10 lines
Diff to previous 1.349 (colored)

Simplify shutdown process.

On shutdown, there's no need to use kill(2) to kill the child
processes. Just closing the IPC sockets will make the children receive
an EOF, break out from the event loop and then exit.

Tha advantages of this "pipe teardown" are:
* simpler code;
* no need to pledge "proc" in the parent process;
* removal of a (hard to trigger) PID reuse race condition.

ok benno@ claudio@

Revision 1.349 / (download) - annotate - [select for diffs], Fri Sep 2 14:00:29 2016 UTC (7 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.348: +4 -2 lines
Diff to previous 1.348 (colored)

work on making log.c similar in all daemons:

move daemon-local functions into new logmsg.c, and reduce
the (mostly whitespace) differences so that log.c's can be diffed easily.

ok claudio@, feedback from henning@, deraadt@, reyk@

Revision 1.348 / (download) - annotate - [select for diffs], Mon Aug 8 21:44:00 2016 UTC (7 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.347: +2 -2 lines
Diff to previous 1.347 (colored)

Use exit(3) instead of _exit(2) in the child processes.

Since recently the child processes call exec() after fork(), so they
should stop using _exit(2) and use exit(3) instead when shutting down.

Ok claudio@

Revision 1.347 / (download) - annotate - [select for diffs], Thu Jul 21 10:13:58 2016 UTC (7 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.346: +13 -6 lines
Diff to previous 1.346 (colored)

Remove a fatal() in peer_up when the local addrs of a peer can't be figured out.
Instead bring the session down and wait for admin help.
OK henning@, benno@, phessler@

Revision 1.346 / (download) - annotate - [select for diffs], Fri Jun 3 17:36:37 2016 UTC (8 years ago) by benno
Branch: MAIN
Changes since 1.345: +2 -2 lines
Diff to previous 1.345 (colored)

Add operators =, !=, - (range), >< (exclsive range) to the as-path
filters (AS, peer-as, source-as, transit-as).

Add a use case (block illegal AS numbers) to the bgpd.conf example.

feedback from claudio, sthen, florian,
ok florian@ phessler@

Revision 1.345 / (download) - annotate - [select for diffs], Tue Dec 22 21:36:57 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.344: +2 -2 lines
Diff to previous 1.344 (colored)

commited -> committed

Revision 1.344 / (download) - annotate - [select for diffs], Thu Dec 3 09:26:59 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.343: +2 -2 lines
Diff to previous 1.343 (colored)

claudio questioned the need for pledge(unix) in the rde, and i think
he is right.
ok claudio@

Revision 1.343 / (download) - annotate - [select for diffs], Fri Nov 6 16:23:26 2015 UTC (8 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.342: +5 -1 lines
Diff to previous 1.342 (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.342 / (download) - annotate - [select for diffs], Sun Oct 25 18:45:04 2015 UTC (8 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.341: +3 -2 lines
Diff to previous 1.341 (colored)

Only run the rib_dump_runner() if there is something pending and the
control socket has not many messages queued.

Revision 1.341 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:09 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.340: +3 -3 lines
Diff to previous 1.340 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.340 / (download) - annotate - [select for diffs], Wed Oct 7 20:26:16 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.339: +5 -1 lines
Diff to previous 1.339 (colored)

In theory, bgpd should be happy with tame "stdio unix route recvfd".
Let's hear from people's experiences by commiting it.

Revision 1.339 / (download) - annotate - [select for diffs], Mon Sep 21 09:47:15 2015 UTC (8 years, 8 months ago) by phessler
Branch: MAIN
Changes since 1.338: +3 -2 lines
Diff to previous 1.338 (colored)

Let us log all updates sent from an individual peer.  Since this can be
applied to a group, also let us disable logging on a sub-member of the
group.  Very handy for debugging naughty peers on a router with multiple
peers.

OK benno@

Revision 1.338 / (download) - annotate - [select for diffs], Sat Sep 19 16:24:08 2015 UTC (8 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.337: +3 -3 lines
Diff to previous 1.337 (colored)

Use correct function name in error message

Revision 1.337 / (download) - annotate - [select for diffs], Sun Aug 30 23:20:43 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.336: +7 -7 lines
Diff to previous 1.336 (colored)

rename a variable "err" to "error"

Revision 1.336 / (download) - annotate - [select for diffs], Tue Aug 4 14:46:38 2015 UTC (8 years, 10 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.335: +3 -3 lines
Diff to previous 1.335 (colored)

Give more precise errors, to help track when bgpd quits

OK florian@ benno@ sthen@ deraadt@

Revision 1.335 / (download) - annotate - [select for diffs], Mon Jul 20 16:10:38 2015 UTC (8 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.334: +67 -74 lines
Diff to previous 1.334 (colored)

Make bgpd execute the RDE and session engine process instead of just forking.
This way ASLR and stack cookies are per process.
With input from benno@ and deraadt@
OK benno@

Revision 1.334 / (download) - annotate - [select for diffs], Sat Jul 18 22:52:39 2015 UTC (8 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.333: +20 -14 lines
Diff to previous 1.333 (colored)

give bgpd's fatal() varargs and use it to instrument bgpd fatal()
calls to aid in debugging
henning@ "makes sense to me", sthen@ "yes please", ok phessler@

Revision 1.333 / (download) - annotate - [select for diffs], Thu Jul 16 17:26:57 2015 UTC (8 years, 10 months ago) by blambert
Branch: MAIN
Changes since 1.332: +2 -2 lines
Diff to previous 1.332 (colored)

fix pasto in error string

ok claudio@

Revision 1.332 / (download) - annotate - [select for diffs], Sun Jun 21 12:16:29 2015 UTC (8 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.331: +14 -3 lines
Diff to previous 1.331 (colored)

There is a race between sending notifications to the SE and getting a new
peer_up event in the RDE. This can be triggered by graceful restart. So
remove the panic and replace it with roughly what peer_down does.
OK phessler and henning

Revision 1.331 / (download) - annotate - [select for diffs], Fri Jun 19 14:54:12 2015 UTC (8 years, 11 months ago) by phessler
Branch: MAIN
Changes since 1.330: +9 -4 lines
Diff to previous 1.330 (colored)

show the number of (currently) known prefixes and the max-prefix limit,
when we terminate the session.

since we terminate the session as soon as we go above the limit, show
'>' since there may be more that we haven't/won't process.

OK benno@

Revision 1.330 / (download) - annotate - [select for diffs], Sat Mar 14 03:52:42 2015 UTC (9 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.329: +5 -5 lines
Diff to previous 1.329 (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.329 / (download) - annotate - [select for diffs], Wed Oct 8 16:15:37 2014 UTC (9 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.328: +4 -3 lines
Diff to previous 1.328 (colored)

Use reallocarray() throughout to spot multiplicative int overflow.
ok henning benno

Revision 1.328 / (download) - annotate - [select for diffs], Sun Apr 13 10:36:41 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.327: +2 -2 lines
Diff to previous 1.327 (colored)

fix language/spelling in error string

ok claudio@

Revision 1.327 / (download) - annotate - [select for diffs], Wed Jan 22 04:08:08 2014 UTC (10 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.326: +10 -2 lines
Diff to previous 1.326 (colored)

Fix a bug where stale routes were not properly flushed on sessions announcing
the graceful restart capability.  The bug is triggered when a router does not
reconnect before the graceful restart timeout fires.
This removes the checks for the CAPA_GR_FORWARD flag in the timeout and
IMSG_SESSION_RESTARTED handler.
CAPA_GR_RESTARTING is indicating that bgpd is currently doing a graceful
restart for this neighbor and therefore the SE must issue a flush of stale
routes in some way.
CAPA_GR_FORWARD on the other hand is only indicating that the neighbor
actually preserved the forwarding state which is too strict for the timeout
handler.
Tested by sthen@, florian@ and benno@

Revision 1.326 / (download) - annotate - [select for diffs], Wed Nov 13 20:41:01 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.325: +5 -4 lines
Diff to previous 1.325 (colored)

from claudio
"Let msgbuf_write return -1 with errno EAGAIN. The users then must
check if this was the case and readd the event or poll again.  The
current handling in the imsg code is wrong for sure."

ok gilles, benno

Revision 1.325 / (download) - annotate - [select for diffs], Wed Aug 14 20:34:26 2013 UTC (10 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.324: +244 -270 lines
Diff to previous 1.324 (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.324 / (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.323: +9 -2 lines
Diff to previous 1.323 (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.323 / (download) - annotate - [select for diffs], Wed Jul 10 15:56:06 2013 UTC (10 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.322: +5 -20 lines
Diff to previous 1.322 (colored)

Change the way the RDE updates its peer list. The SE is now always sending
a IMSG_SESSION_ADD message to the RDE when a peer comes up or when a reload
happens. The IMSG_SESSION_ADD has the full current config of the peer and
so the RDE should end up with correct values. This affects mostly maxprefix
and the RIB settings. OK henning@

Revision 1.322 / (download) - annotate - [select for diffs], Fri May 31 23:10:12 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.321: +8 -1 lines
Diff to previous 1.321 (colored)

Unfuck BGP MPLS VPNs that got broken by the last few reload related commits.
OK henning@

Revision 1.316.2.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.316: +2 -2 lines
Diff to previous 1.316 (colored) next main 1.317 (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.321 / (download) - annotate - [select for diffs], Tue Sep 18 10:10:00 2012 UTC (11 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.320: +3 -1 lines
Diff to previous 1.320 (colored)

Expose the local weight in the ctl_show_rib struct so bgpctl can print it.
OK sthen@ henning@

Revision 1.320 / (download) - annotate - [select for diffs], Tue Sep 18 09:45:51 2012 UTC (11 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.319: +3 -1 lines
Diff to previous 1.319 (colored)

Only allow one reload request at a time in bgpd. Needed for further work.
OK sthen@, benno@, henning@

Revision 1.319 / (download) - annotate - [select for diffs], Mon Sep 17 18:03:28 2012 UTC (11 years, 8 months ago) by miod
Branch: MAIN
Changes since 1.318: +2 -2 lines
Diff to previous 1.318 (colored)

Unbreak. gcc 2 at least complains if a declaration is ended by two semicolons.

Revision 1.318 / (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.317: +122 -3 lines
Diff to previous 1.317 (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.317 / (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.316: +2 -2 lines
Diff to previous 1.316 (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.316 / (download) - annotate - [select for diffs], Sun May 27 18:52:07 2012 UTC (12 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE
Branch point for: OPENBSD_5_2
Changes since 1.315: +98 -10 lines
Diff to previous 1.315 (colored)

Extend the network code to allow attributes to be passed in with prefixes.
In the end this will allow anyone to use MRT table dumps to load prefixes
into a bgpd instance. For example you can download the RIPE dumps and load
full-feeds onto your laptop until the poor thing dies.
OK henning@ sthen@

Revision 1.315 / (download) - annotate - [select for diffs], Tue May 22 20:38:17 2012 UTC (12 years ago) by claudio
Branch: MAIN
Changes since 1.314: +2 -2 lines
Diff to previous 1.314 (colored)

Fix a warning message to print the correct information. OK henning@ sthen@

Revision 1.314 / (download) - annotate - [select for diffs], Thu Apr 12 17:31:05 2012 UTC (12 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.313: +5 -5 lines
Diff to previous 1.313 (colored)

The ebgp flags is just a truth value and it is better to not == 1 compares.
OK henning@ sthen@

Revision 1.313 / (download) - annotate - [select for diffs], Sat Apr 7 17:25:51 2012 UTC (12 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.312: +1 -4 lines
Diff to previous 1.312 (colored)

The Route Distinguishers should not be used to control distribution.
Found by and fix tested by Rimi Philippe

Revision 1.312 / (download) - annotate - [select for diffs], Tue Mar 27 18:22:07 2012 UTC (12 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.311: +3 -1 lines
Diff to previous 1.311 (colored)

Introduce F_CTL_ACTIVE a flag to only show selected pathes.
Requested and OK deraadt@, OK henning@

Revision 1.311 / (download) - annotate - [select for diffs], Tue Sep 20 21:19:06 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.310: +3 -2 lines
Diff to previous 1.310 (colored)

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

Revision 1.310 / (download) - annotate - [select for diffs], Mon Sep 19 11:18:11 2011 UTC (12 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.309: +1 -3 lines
Diff to previous 1.309 (colored)

remove an unused ctl struct and remove some unneeded values from
struct ctl_show_rib since bgpctl does not look at them at all.

Revision 1.309 / (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.308: +7 -2 lines
Diff to previous 1.308 (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.308 / (download) - annotate - [select for diffs], Sat Jul 9 02:51:18 2011 UTC (12 years, 11 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.307: +1 -9 lines
Diff to previous 1.307 (colored)

remove that rlimit code, rc.d and login classes do it much betterer these
days. screaming bob ok claudio

Revision 1.307 / (download) - annotate - [select for diffs], Tue Feb 15 12:26:37 2011 UTC (13 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.306: +3 -3 lines
Diff to previous 1.306 (colored)

Use log_as() to print the offending neighbor-as instead of printing it
as an int. This way 4-byte ASes should be printed nicely.
OK deraadt@ henning@

Revision 1.306 / (download) - annotate - [select for diffs], Sat Jan 29 17:10:45 2011 UTC (13 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.305: +11 -8 lines
Diff to previous 1.305 (colored)

improve error msg when enforce-neighbor-as is on and the path doesn't
start with the neighbor-as. makes finding the offender easier.
from Sebastian Benoit <benoit-lists at fb12.de>, claudio agrees

Revision 1.305 / (download) - annotate - [select for diffs], Thu Jan 27 17:19:09 2011 UTC (13 years, 4 months ago) by sthen
Branch: MAIN
Changes since 1.304: +2 -2 lines
Diff to previous 1.304 (colored)

change a logged error from 'enforce remote-as' to the correct
'enforce neighbor-as'; from Sebastian Benoit on tech@.

Revision 1.304 / (download) - annotate - [select for diffs], Thu Dec 23 17:41:40 2010 UTC (13 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.303: +10 -1 lines
Diff to previous 1.303 (colored)

Increase the DATA limit in the RDE to the max value and do the same
for NOFILE in the session engine.
OK henning, sthen@

Revision 1.303 / (download) - annotate - [select for diffs], Tue Nov 30 15:33:06 2010 UTC (13 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.302: +2 -1 lines
Diff to previous 1.302 (colored)

Do what the comment actually says. Ignore the full attribute not only the
header. ATTR_UNDEF is still a bit strange though but at least it will now
parse and ignore such a freak attribute correctly.

Revision 1.302 / (download) - annotate - [select for diffs], Wed Nov 24 00:58:10 2010 UTC (13 years, 6 months ago) by sthen
Branch: MAIN
Changes since 1.301: +2 -2 lines
Diff to previous 1.301 (colored)

fix spelling in an error message

Revision 1.301 / (download) - annotate - [select for diffs], Thu Nov 18 12:18:31 2010 UTC (13 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.300: +16 -4 lines
Diff to previous 1.300 (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.297.2.1 / (download) - annotate - [select for diffs], Mon Nov 15 14:15:47 2010 UTC (13 years, 6 months ago) by stephan
Branch: OPENBSD_4_8
Changes since 1.297: +2 -2 lines
Diff to previous 1.297 (colored) next main 1.298 (colored)

MFC, original commit from claudio@
(r1.300 of rde.c and r1.313 of session.c):
- - - - - - - - - - - - - -
Make sure that the initial configuration of the child is zeroed out
by using calloc(). This fixes an issue where the RDE would start up
as route-collector because uninitialized memory made the RDE switch
to that mode.
OK henning@, sthen@, phessler@
- - - - - - - - - - - - - -

ok claudio@

Revision 1.300 / (download) - annotate - [select for diffs], Wed Nov 10 15:14:36 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.299: +2 -2 lines
Diff to previous 1.299 (colored)

Make sure that the initial configuration of the child is zeroed out
by using calloc(). This fixes an issue where the RDE would start up
as route-collector because uninitialized memory made the RDE switch
to that mode.
OK henning@, sthen@, phessler@

Revision 1.299 / (download) - annotate - [select for diffs], Fri Oct 15 07:43:02 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.298: +24 -11 lines
Diff to previous 1.298 (colored)

Add a few more wanrings to the UPDATE parser. Mainly to warn when
attributes are ignored or UPDATEs are invalidated and withdrawn.
While there use % to check if a attribute is a multiple of X.
OK henning@, sthen@

Revision 1.298 / (download) - annotate - [select for diffs], Thu Sep 2 14:03:21 2010 UTC (13 years, 9 months ago) by sobrado
Branch: MAIN
Changes since 1.297: +6 -6 lines
Diff to previous 1.297 (colored)

remove trailing spaces and tabs from source code; no binary changes
(verified by both sthen@ and me).

ok sthen@; "just commit it" claudio@

Revision 1.297 / (download) - annotate - [select for diffs], Wed Jul 14 09:00:08 2010 UTC (13 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE
Branch point for: OPENBSD_4_8
Changes since 1.296: +10 -12 lines
Diff to previous 1.296 (colored)

Fix a mrt fd leak by moving the block which closes finished dumps.
The previous location also depended on poll results and in most cases was
therefor not entered because finished dumps are not added to the poll array.
Problem reported by Peter Haag, OK henning@

Revision 1.296 / (download) - annotate - [select for diffs], Wed May 26 13:56:07 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.295: +6 -6 lines
Diff to previous 1.295 (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.295 / (download) - annotate - [select for diffs], Wed May 19 12:44:14 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.294: +103 -8 lines
Diff to previous 1.294 (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.294 / (download) - annotate - [select for diffs], Mon May 17 15:49:29 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.293: +185 -36 lines
Diff to previous 1.293 (colored)

Last bits of MPLS VPN support. Hook kernel routing tables and RIB together.
This adds a bit of new config to specify the mapping between an rdomain and
the BGP MPLS VPN instance, example:
rdomain 1 {
        descr "CUSTOMER1"
	rd 65003:1
	import-target rt 65003:3
	export-target rt 65003:1
	depend on mpe0
	network 192.168.224/24
}
The "depend on mpe0" is a but ugly but for now this is the quickest way to
figure out which interface bgp should use to insert the MPLS routes.

A big side-effect of this diff is that networks are now internally
distributed through kroute.c.
This needs some kernel changes that will follow hopefully soon.
OK henning@

Revision 1.293 / (download) - annotate - [select for diffs], Tue May 4 10:25:31 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.292: +14 -2 lines
Diff to previous 1.292 (colored)

Assuming that a prefixlen 32 is a host route is not clever when IPv6 comes
into play. Check the AID and use 32 or 128 based on the address family.
Now bgpctl show rib <IPv6 addr> works like in the IPv4 case.
Bug reported and fix made during yesterday's Swinog BE#85

Revision 1.292 / (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.291: +18 -11 lines
Diff to previous 1.291 (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.291 / (download) - annotate - [select for diffs], Tue Apr 13 09:09:48 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.290: +36 -73 lines
Diff to previous 1.290 (colored)

Instead of passing AF specific struct kroutes over imsgs use a struct
kroute_full structure that is AF independent and has all information in
it. Simplifies the communication between processes and reduces the number
of imsg types. This is another step to add FIB support to BGP MPLS VPNs.

Revision 1.290 / (download) - annotate - [select for diffs], Tue Mar 30 15:43:30 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.289: +2 -2 lines
Diff to previous 1.289 (colored)

Hmpf, aid2af() leftover from the time I did the transition that should not
be there. network X set nexthop Y failed because of this.

Revision 1.289 / (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.288: +2 -2 lines
Diff to previous 1.288 (colored)

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

Revision 1.288 / (download) - annotate - [select for diffs], Wed Mar 3 13:52:39 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.287: +7 -7 lines
Diff to previous 1.287 (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.287 / (download) - annotate - [select for diffs], Tue Feb 9 13:29:15 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.286: +2 -2 lines
Diff to previous 1.286 (colored)

Don't hardcode the AID to AID_INET6 when sending MP EoR updates.
This will allow AID_VPN_IPv4 to do EoRs as well.

Revision 1.286 / (download) - annotate - [select for diffs], Mon Feb 8 17:21:37 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.285: +5 -2 lines
Diff to previous 1.285 (colored)

Unbreak IPv6 local address lookups. Some idiot aka me optimised a loop and
because of that either the IPv4 or IPv6 local address was not set. Because
of this prefixes were sent out with all zero nexthops.

Revision 1.285 / (download) - annotate - [select for diffs], Mon Feb 8 17:16:36 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.284: +2 -2 lines
Diff to previous 1.284 (colored)

It is enough that peer->capa.mp[i] is non zero. It does not need to be 1.

Revision 1.284 / (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.283: +176 -29 lines
Diff to previous 1.283 (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.283 / (download) - annotate - [select for diffs], Mon Jan 11 01:34:35 2010 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.282: +46 -36 lines
Diff to previous 1.282 (colored)

Make sure we do not add trailing garbage while parsing a prefix that has a
prefixlen that is not a multiple of 8. Found while reading the RFC.
OK henning@

Revision 1.282 / (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.281: +41 -15 lines
Diff to previous 1.281 (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.281 / (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.280: +7 -10 lines
Diff to previous 1.280 (colored)

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

Revision 1.280 / (download) - annotate - [select for diffs], Tue Jan 5 08:49:57 2010 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.279: +4 -1 lines
Diff to previous 1.279 (colored)

Make sure that all important config variables are synced on a reload in
the SE. This got more important since we use the reload all the time now.
Found out the hard way and fix tested by Laurent CARON

Revision 1.279 / (download) - annotate - [select for diffs], Thu Dec 31 15:34:02 2009 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.278: +17 -55 lines
Diff to previous 1.278 (colored)

Instead of passing the config via arguments to the childs on bootup issue
a config reload as first step in bootup. This allows childs to start with
an empty config and a lot of special cleanup code can bite the dust.
Testing by myself and sthen@ with a few configs (more testing welcome).
Seems like a good idea henning@ & sthen@

Revision 1.278 / (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.277: +2 -2 lines
Diff to previous 1.277 (colored)

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

Revision 1.277 / (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.276: +17 -1 lines
Diff to previous 1.276 (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.276 / (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.275: +80 -67 lines
Diff to previous 1.275 (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.275 / (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.274: +27 -41 lines
Diff to previous 1.274 (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.274 / (download) - annotate - [select for diffs], Wed Nov 11 13:48:34 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.273: +2 -1 lines
Diff to previous 1.273 (colored)

Plug two memory leaks in error pathes. Found by parfait. OK henning, jsg

Revision 1.273 / (download) - annotate - [select for diffs], Mon Nov 2 20:38:15 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.272: +8 -2 lines
Diff to previous 1.272 (colored)

Implement IMSG_CTL_LOG_VERBOSE similar to ospfd. Even though bgpd has almost
no log_debug() it makes more sense to make all routing daemons behave the same.

Revision 1.272 / (download) - annotate - [select for diffs], Wed Oct 28 15:54:13 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.271: +2 -2 lines
Diff to previous 1.271 (colored)

Free correct buffer.

Revision 1.271 / (download) - annotate - [select for diffs], Mon Oct 26 09:27:58 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.270: +29 -25 lines
Diff to previous 1.270 (colored)

Better error handling when doing mrt dumps (e.g. when there is no more space
on the disk). Before the SE spinned and the RDE may even crash in these events.
Found by Elisa Jasinska. OK henning@

Revision 1.270 / (download) - annotate - [select for diffs], Mon Oct 12 15:19:30 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.269: +6 -3 lines
Diff to previous 1.269 (colored)

Only dump AFI/SAFI pairs that are active. For IPv6 check the announced and
received MP capability for IPv4 this does not work when announce capabilities
no is set so check if announce IPv4 none was set in the config.
The capabilities code needs rework since those checks are very error prone.
With this we don't leak unneeded EOR markers for other AFI/SAFI pairs.

Revision 1.269 / (download) - annotate - [select for diffs], Mon Oct 12 13:14:47 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.268: +7 -4 lines
Diff to previous 1.268 (colored)

Send correct EOR updates. peer_send_eor() does not accept the AFI_ALL and
SAFI_ALL shortcuts. This should fix issues with Juniper boxes that started
when I enabled more capabilities by default.
Fix and report by rivo nurges (rix at estpak dot ee) Thanks.

Revision 1.268 / (download) - annotate - [select for diffs], Thu Oct 8 09:27:56 2009 UTC (14 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.267: +1 -4 lines
Diff to previous 1.267 (colored)

remove an unused variable, ok claudio@ henning@

Revision 1.267 / (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.266: +55 -8 lines
Diff to previous 1.266 (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.266 / (download) - annotate - [select for diffs], Mon Oct 5 11:35:48 2009 UTC (14 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.265: +3 -3 lines
Diff to previous 1.265 (colored)

draft-ietf-idr-restart is RFC 4724 since quite some time.
Fix function name in a warning message.

Revision 1.265 / (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.264: +77 -30 lines
Diff to previous 1.264 (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.264 / (download) - annotate - [select for diffs], Mon Jun 29 12:22:16 2009 UTC (14 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.263: +12 -14 lines
Diff to previous 1.263 (colored)

Unfuck mrt table dumps and plug a memory leak while there.

Revision 1.263 / (download) - annotate - [select for diffs], Mon Jun 22 11:14:14 2009 UTC (14 years, 11 months ago) by sthen
Branch: MAIN
Changes since 1.262: +3 -1 lines
Diff to previous 1.262 (colored)

Log a warning when "enforce remote-as" is triggered. ok claudio@

Revision 1.262 / (download) - annotate - [select for diffs], Sun Jun 7 05:56:24 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.261: +2 -2 lines
Diff to previous 1.261 (colored)

Change the way fds passed over a socket are retreived on the receiving side.

Currently the receiver fetches an imsg via imsg_get() and if he expects
an fd, he then calls imsg_get_fd() to fetch the next fd queued on the
imsgbuf from which the imsg came.

This changes hides the fd queueing mechanism to the API user.  When closing
an imsg with an fd, the message is flagged so that the receiving end knows
it must dequeue the fd in imsg_get() and return it with the imsg structure.
This way there is no (less) possible screw up from imsg_get_fd() not being
called directly after imsg_get() by the user. The retreived imsg is
self-contained.

ok pyr@, "I like that" henning@

Revision 1.261 / (download) - annotate - [select for diffs], Sun Jun 7 00:30:23 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.260: +21 -2 lines
Diff to previous 1.260 (colored)

First attempt at reload support for RIBs. There is some magic that I do
not fully understand but at least no flames are comming out of my test
box anymore.

Revision 1.260 / (download) - annotate - [select for diffs], Sat Jun 6 21:21:37 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.259: +16 -40 lines
Diff to previous 1.259 (colored)

Fix bgpctl show rib prefix/len command. Problem reported by Insan Praja.

Revision 1.259 / (download) - annotate - [select for diffs], Sat Jun 6 06:33:15 2009 UTC (15 years ago) by eric
Branch: MAIN
Changes since 1.258: +4 -7 lines
Diff to previous 1.258 (colored)

sync bgpd/bgpctl with the common imsg code, making it lib ready as well.

ok claudio@ pyr@

Revision 1.258 / (download) - annotate - [select for diffs], Sat Jun 6 06:04:10 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.257: +24 -6 lines
Diff to previous 1.257 (colored)

Make it possible to select the RIB that a show command should show.

Revision 1.257 / (download) - annotate - [select for diffs], Sat Jun 6 01:10:29 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.256: +66 -54 lines
Diff to previous 1.256 (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.256 / (download) - annotate - [select for diffs], Sat Jun 6 01:02:51 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.255: +6 -2 lines
Diff to previous 1.255 (colored)

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

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

Minor cleanup.

Revision 1.254 / (download) - annotate - [select for diffs], Fri Jun 5 19:52:32 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.253: +6 -6 lines
Diff to previous 1.253 (colored)

Make it possible to bind peers to a specified RIB. Now only filters and
bgpctl are missing to have full support of multiple RIBs.

Revision 1.253 / (download) - annotate - [select for diffs], Fri Jun 5 17:36:49 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.252: +96 -48 lines
Diff to previous 1.252 (colored)

Change the way we do mrt dumps in the rde (from the retarded only one dump
possible to as many as you like). The mrt dumps are now done with the same
tree walking code as the control messages. Makes the RDE respond a bit faster
and use less memory while dumping.

Revision 1.252 / (download) - annotate - [select for diffs], Thu Jun 4 22:08:19 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.251: +20 -8 lines
Diff to previous 1.251 (colored)

Make mrt understand alternate RIB plus remove some other static rib references.
There is still a problem with the mrt dumps because we only allow one in the
RDE. This needs some additional work.

Revision 1.251 / (download) - annotate - [select for diffs], Thu Jun 4 05:29:06 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.250: +10 -9 lines
Diff to previous 1.250 (colored)

Export networks to be redistributed into all ribs for now.

Revision 1.250 / (download) - annotate - [select for diffs], Thu Jun 4 04:46:42 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.249: +21 -7 lines
Diff to previous 1.249 (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.249 / (download) - annotate - [select for diffs], Tue Jun 2 01:02:28 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.248: +12 -65 lines
Diff to previous 1.248 (colored)

Make show rib as and show rib community use the same dump code as the other
show rib commands. This makes the output sorted by prefix and not some rather
randomly output.

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

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

Revision 1.247 / (download) - annotate - [select for diffs], Mon Jun 1 23:54:49 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.246: +9 -10 lines
Diff to previous 1.246 (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.246 / (download) - annotate - [select for diffs], Wed May 27 06:58:15 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.245: +61 -62 lines
Diff to previous 1.245 (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.245 / (download) - annotate - [select for diffs], Sun May 17 14:45:25 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.244: +8 -8 lines
Diff to previous 1.244 (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.244 / (download) - annotate - [select for diffs], Sun May 17 13:22:10 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.243: +4 -15 lines
Diff to previous 1.243 (colored)

Simplify the IMSG_CTL_SHOW_NETWORK case and make it actually work by sending
the imsgs back to the right pid and not some more or less random address.

Revision 1.243 / (download) - annotate - [select for diffs], Sun May 17 12:25:15 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.242: +114 -101 lines
Diff to previous 1.242 (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.242 / (download) - annotate - [select for diffs], Mon May 11 19:16:21 2009 UTC (15 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.241: +5 -2 lines
Diff to previous 1.241 (colored)

Make bgpctl show network print both AF_INET and AF_INET6 as mentioned in the
man page. Problem found by Rod Whitworth. OK sthen@

Revision 1.241 / (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.240: +45 -67 lines
Diff to previous 1.240 (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.240 / (download) - annotate - [select for diffs], Wed Mar 18 19:45:09 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.239: +3 -2 lines
Diff to previous 1.239 (colored)

Correctly check for MRT_TABLE_DUMP_MP and don't send the config to the SE.
Make mrt table-mp dumps actually work. Found on the plane from NRT to ZRH.
OK henning@

Revision 1.239 / (download) - annotate - [select for diffs], Fri Mar 13 16:05:40 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.238: +3 -5 lines
Diff to previous 1.238 (colored)

No need for a line break, makes code a bit more compact.

Revision 1.238 / (download) - annotate - [select for diffs], Fri Mar 13 06:25:04 2009 UTC (15 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.237: +5 -4 lines
Diff to previous 1.237 (colored)

Next step in mrt cleanup. Switch buf_write to a smarter version of itself.
Doing more the stuff msgbuf_write does and switch the only user -- mrt --
over to use this simpler way of writing out stuff.

Revision 1.237 / (download) - annotate - [select for diffs], Fri Mar 13 05:43:51 2009 UTC (15 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.236: +10 -11 lines
Diff to previous 1.236 (colored)

Move mrt code over to use the msgbuf way of queuing buffers instead of rolling
an own version. More cleanup to come.

Revision 1.236 / (download) - annotate - [select for diffs], Fri Mar 13 04:19:43 2009 UTC (15 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.235: +10 -2 lines
Diff to previous 1.235 (colored)

More paranoia when parsing empty updates. Make sure they are really empty and
don't come with some additional stuff attached to them.
OK henning@

Revision 1.230.2.1 / (download) - annotate - [select for diffs], Fri Jan 30 22:39:47 2009 UTC (15 years, 4 months ago) by claudio
Branch: OPENBSD_4_3
Changes since 1.230: +17 -9 lines
Diff to previous 1.230 (colored) next main 1.231 (colored)

Bring in from reliability fix from -current rev. 1.234
OK henning@ sthen@

Add a ugly workaround for the problem where an invalid AS4_PATH is passed
over mulitple hops and causes bgpd to close the connection. This is what
the RFC requires us to do but the result is a DoS against all OpenBGPD
routers when somebody injects such a bad optional transitive attribute
because the intermediate routers don't give a damn about it.
As a result we now ignore such bad prefixes and don't allow them in the
decision process. The handling of optional transitive attributes needs to
be rethinked because all of them can be abused in such a way.
Idea OK by a few + henning@, tested myself against my crappy regress test
suite that needs way more work.

Revision 1.232.2.1 / (download) - annotate - [select for diffs], Fri Jan 30 22:37:34 2009 UTC (15 years, 4 months ago) by claudio
Branch: OPENBSD_4_4
Changes since 1.232: +17 -9 lines
Diff to previous 1.232 (colored) next main 1.233 (colored)

Bring in from reliability fix from -current rev. 1.234
OK henning@ sthen@

Add a ugly workaround for the problem where an invalid AS4_PATH is passed
over mulitple hops and causes bgpd to close the connection. This is what
the RFC requires us to do but the result is a DoS against all OpenBGPD
routers when somebody injects such a bad optional transitive attribute
because the intermediate routers don't give a damn about it.
As a result we now ignore such bad prefixes and don't allow them in the
decision process. The handling of optional transitive attributes needs to
be rethinked because all of them can be abused in such a way.
Idea OK by a few + henning@, tested myself against my crappy regress test
suite that needs way more work.

Revision 1.235 / (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.234: +9 -9 lines
Diff to previous 1.234 (colored)

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

ok claudio

Revision 1.234 / (download) - annotate - [select for diffs], Sun Dec 28 15:19:21 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.233: +14 -6 lines
Diff to previous 1.233 (colored)

Add a ugly workaround for the problem where an invalid AS4_PATH is passed
over mulitple hops and causes bgpd to close the connection. This is what
the RFC requires us to do but the result is a DoS against all OpenBGPD
routers when somebody injects such a bad optional transitive attribute
because the intermediate routers don't give a damn about it.
As a result we now ignore such bad prefixes and don't allow them in the
decision process. The handling of optional transitive attributes needs to
be rethinked because all of them can be abused in such a way.
Idea OK by a few + henning@, tested myself against my crappy regress test
suite that needs way more work.

Revision 1.233 / (download) - annotate - [select for diffs], Fri Dec 12 16:02:49 2008 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.232: +6 -6 lines
Diff to previous 1.232 (colored)

Follow RFC 4271 more closely by sending the correct error back for optional
attributes and use the correct lenght in some other error cases.
OK sthen@

Revision 1.232 / (download) - annotate - [select for diffs], Sun Jun 15 10:03:46 2008 UTC (15 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE
Branch point for: OPENBSD_4_4
Changes since 1.231: +6 -1 lines
Diff to previous 1.231 (colored)

Paranoia check. Make sure that the 2 len bytes are actually available.
Another easy M hiding in my bgp source forest.

Revision 1.231 / (download) - annotate - [select for diffs], Fri May 2 13:49:34 2008 UTC (16 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.230: +2 -3 lines
Diff to previous 1.230 (colored)

Fix logic when setting the F_RIB_ELIGIBLE flag. A path with a NULL nexthop
is localy originated and so is eligible by definition.
Noticed and fix tested by Christian, bsd (at) cleondra (dot) ch

Revision 1.230 / (download) - annotate - [select for diffs], Tue Feb 26 19:58:51 2008 UTC (16 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE
Branch point for: OPENBSD_4_3
Changes since 1.229: +3 -3 lines
Diff to previous 1.229 (colored)

Ignore and drop path attributes with a type code of 0 instead of sending an
error back. This increases robustness without causing any issues. The RFC
does not forbid the use of 0 in the type code but it is not explicitly
allowed and the type code list at IANA does not mention 0 at all.
OK henning@

Revision 1.229 / (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.228: +17 -17 lines
Diff to previous 1.228 (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.228 / (download) - annotate - [select for diffs], Sun Sep 16 15:20:50 2007 UTC (16 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.227: +5 -2 lines
Diff to previous 1.227 (colored)

log_fmt_peer() does not use a static buffer so it is necessary to free the
string that it returned later. rde_update_log() did not do that.
Memory leak found and diff provided by Mike Belopuhov.

Revision 1.227 / (download) - annotate - [select for diffs], Tue Jun 19 09:44:55 2007 UTC (16 years, 11 months ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.226: +2 -1 lines
Diff to previous 1.226 (colored)

Ignore SIGHUP in bgpd's children to allow the use of pkill -1 bgpd for
reloading.

``yeah that is good'' henning@

Revision 1.226 / (download) - annotate - [select for diffs], Fri May 11 11:27:59 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored)

Various spelling fixes from Stuart Henderson.

Revision 1.219.2.1 / (download) - annotate - [select for diffs], Mon Apr 30 20:43:07 2007 UTC (17 years, 1 month ago) by ckuethe
Branch: OPENBSD_4_1
Changes since 1.219: +13 -3 lines
Diff to previous 1.219 (colored) next main 1.220 (colored)

From claudio@
> When running show commands that are restarted make sure that we either
> have pending imsgs to send or that we reduce the poll timout to 0. This
> fixes hanging and extrem slow performing bgpctl show rib commands.
> Found by Jon Morby additional testing by Stuart Henderson. OK henning@

Revision 1.225 / (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.224: +125 -17 lines
Diff to previous 1.224 (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.224 / (download) - annotate - [select for diffs], Fri Apr 6 18:03:50 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.223: +15 -2 lines
Diff to previous 1.223 (colored)

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

Revision 1.223 / (download) - annotate - [select for diffs], Wed Mar 28 12:33:32 2007 UTC (17 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.222: +33 -1 lines
Diff to previous 1.222 (colored)

add IMSG_CTL_SHOW_RIB_COMMUNITY, rib by given community
mostly from rivo nurges <rix@estpak.ee>, ok claudio

Revision 1.222 / (download) - annotate - [select for diffs], Fri Mar 16 14:06:57 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.221: +2 -2 lines
Diff to previous 1.221 (colored)

A few more s/2858/4760/ and use RFC <number> everywhere.

Revision 1.221 / (download) - annotate - [select for diffs], Fri Mar 16 13:52:30 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.220: +7 -12 lines
Diff to previous 1.220 (colored)

Update multiprotocol extension code to RFC 4760. This actually removes
a few things we actually never realy cared about.
OK henning@

Revision 1.220 / (download) - annotate - [select for diffs], Mon Mar 12 15:49:54 2007 UTC (17 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.219: +13 -3 lines
Diff to previous 1.219 (colored)

When running show commands that are restarted make sure that we either
have pending imsgs to send or that we reduce the poll timout to 0. This
fixes hanging and extrem slow performing bgpctl show rib commands.
Found by Jon Morby additional testing by Stuart Henderson. OK henning@

Revision 1.219 / (download) - annotate - [select for diffs], Thu Feb 22 08:34:18 2007 UTC (17 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE
Branch point for: OPENBSD_4_1
Changes since 1.218: +4 -4 lines
Diff to previous 1.218 (colored)

KNF

Revision 1.218 / (download) - annotate - [select for diffs], Fri Jan 26 17:40:49 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.217: +125 -36 lines
Diff to previous 1.217 (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.217 / (download) - annotate - [select for diffs], Wed Jan 24 13:24:51 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.216: +56 -52 lines
Diff to previous 1.216 (colored)

Lock the nexthop while parsing an update by increasing the reference count.
This is needed because the nexthop is not yet linked to the aspath attributes
and so a withdraw in the same update imsg could remove this nexthop which in
turn causes a use after free error when the prefix is added later on.
The order of parsing (attributes, withdraws, prefixes instead of withdraws,
attributes, prefixes) was reversed for multiprotocol support.
This should fix all strange nexthop crashes seen by various people.
Tested and OK henning@

Revision 1.216 / (download) - annotate - [select for diffs], Thu Jan 4 12:43:36 2007 UTC (17 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.215: +6 -3 lines
Diff to previous 1.215 (colored)

Do not run rde_shutdown() unless bgpd is started with -d.
On some of my systems rde_shutdown() takes more than 3min doing nothing more
than calling free(3) over and over again.

Revision 1.215 / (download) - annotate - [select for diffs], Tue Dec 12 10:19:44 2006 UTC (17 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.214: +4 -11 lines
Diff to previous 1.214 (colored)

Kill peer_remove(). This function is only used once so inline it there.
OK henning@

Revision 1.214 / (download) - annotate - [select for diffs], Fri Dec 8 22:31:16 2006 UTC (17 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.213: +2 -2 lines
Diff to previous 1.213 (colored)

no need for KAME_SCOPEID; just check __KAME__.

Revision 1.213 / (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.212: +2 -2 lines
Diff to previous 1.212 (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.212 / (download) - annotate - [select for diffs], Tue Sep 19 13:02:24 2006 UTC (17 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.211: +3 -5 lines
Diff to previous 1.211 (colored)

when the neighbor announced the restart capability, send the end-of-rib
marker after a bulk transfer, claudio ok

Revision 1.211 / (download) - annotate - [select for diffs], Wed Aug 23 08:13:04 2006 UTC (17 years, 9 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.210: +82 -33 lines
Diff to previous 1.210 (colored)

Extend show rib interface code so that it is possible to show the adj-rib-in
and adj-rib-out. Additionally it is now possible to limit the output to a
specified peer. OK henning@

Revision 1.210 / (download) - annotate - [select for diffs], Tue Aug 22 15:02:07 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.209: +4 -1 lines
Diff to previous 1.209 (colored)

do not send the empty UPDATE message as End-of-RIB marker yet, Juniper
doesn't handle it correctly. found out the hard way by me :(
Note: This is a clear protocol violation by juniper. Nontheless we need
to be interoperate correctly...

Revision 1.209 / (download) - annotate - [select for diffs], Mon Aug 14 17:11:18 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.208: +36 -1 lines
Diff to previous 1.208 (colored)

after a bulk transfer (initial or caused by route refresh request),
send an "empty" UPDATE message, used as End-of-RIB marker for implementions
understanding this, ignored by anything else.
see draft-ietf-idr-restart-13.txt, ok claudio

Revision 1.208 / (download) - annotate - [select for diffs], Thu Jun 15 10:04:40 2006 UTC (17 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.207: +45 -53 lines
Diff to previous 1.207 (colored)

Instead of passing three different kinds of arguments in show rib control
request use one struct ctl_show_rib_request where all the info is encoded.
OK henning@

Revision 1.207 / (download) - annotate - [select for diffs], Wed Jun 14 17:08:56 2006 UTC (17 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.206: +11 -7 lines
Diff to previous 1.206 (colored)

Send bot nexthops (exit and true) in the bgpctl show rib cases. bgpctl
can than select which nexthop should be printed. OK henning@

Revision 1.206 / (download) - annotate - [select for diffs], Sun May 28 22:07:54 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.205: +26 -1 lines
Diff to previous 1.205 (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.205 / (download) - annotate - [select for diffs], Fri Apr 21 08:55:21 2006 UTC (18 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.204: +2 -2 lines
Diff to previous 1.204 (colored)

attr_init() should use attrhashsize and not pathhashsize. Found via a lint
cleanup diff from deraadt@.

Revision 1.204 / (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.203: +14 -9 lines
Diff to previous 1.203 (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.203 / (download) - annotate - [select for diffs], Wed Apr 5 13:24:28 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.202: +13 -8 lines
Diff to previous 1.202 (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.202 / (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.201: +43 -12 lines
Diff to previous 1.201 (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.201 / (download) - annotate - [select for diffs], Mon Mar 13 16:49:35 2006 UTC (18 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.200: +17 -2 lines
Diff to previous 1.200 (colored)

Fix for PR 5052. Be more careful about the announced networks we accept.
Make sure that at least the address family and the prefix length are sane.
Reported and fix tested by Pete Vickers.

Revision 1.200 / (download) - annotate - [select for diffs], Fri Feb 10 14:34:40 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.199: +10 -6 lines
Diff to previous 1.199 (colored)

Make it possible to turn suftreconfig in/out on or off. Default is on for
both directions. Manpage update follows. OK henning@

Revision 1.199 / (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.198: +2 -2 lines
Diff to previous 1.198 (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.198 / (download) - annotate - [select for diffs], Tue Jan 24 14:48:47 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.197: +69 -4 lines
Diff to previous 1.197 (colored)

Last bits for softreconfig in support. Now bgpd will automaticaly rei-filter
the RIB after a reload so you no longer need to clear sessions because you
modified filters. Looks good henning@.

Revision 1.197 / (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.196: +23 -3 lines
Diff to previous 1.196 (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.196 / (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.195: +21 -13 lines
Diff to previous 1.195 (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.195 / (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.194: +2 -1 lines
Diff to previous 1.194 (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.194 / (download) - annotate - [select for diffs], Fri Jan 20 14:56:12 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.193: +3 -1 lines
Diff to previous 1.193 (colored)

Don't leak a aspath in network_add(). path_update() copies the aspath so
the passed aspath needs to be freed in network_add(). OK henning@

Revision 1.193 / (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.192: +23 -8 lines
Diff to previous 1.192 (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.192 / (download) - annotate - [select for diffs], Fri Jan 13 13:04:33 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.191: +7 -13 lines
Diff to previous 1.191 (colored)

Simplify evaluation process. Instead of checking the reachability of a prefix
at many different places do it once. This simplifies the logic and makes it
easier to extend it for upcomming Adj-RIB-In addition. OK Henning.

Revision 1.191 / (download) - annotate - [select for diffs], Thu Jan 12 14:05:13 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.190: +31 -22 lines
Diff to previous 1.190 (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.190 / (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.189: +4 -1 lines
Diff to previous 1.189 (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.189 / (download) - annotate - [select for diffs], Wed Jan 4 12:53:31 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.188: +16 -20 lines
Diff to previous 1.188 (colored)

Simplify shutdown function and sprinkle some rde_quit checks into functions
that don't need to run if the RDE is quitting e.g. the decision process.

Revision 1.188 / (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.187: +6 -1 lines
Diff to previous 1.187 (colored)

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

Revision 1.187 / (download) - annotate - [select for diffs], Tue Jan 3 15:48:39 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.186: +27 -18 lines
Diff to previous 1.186 (colored)

Kill WFLAG macro. Should have been included in the rde_attr_parse() merge.
Makes the code more obvious.

Revision 1.186 / (download) - annotate - [select for diffs], Tue Jan 3 13:09:18 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.185: +4 -2 lines
Diff to previous 1.185 (colored)

No need to check the poll fds in case of EINTR. OK dlg@

Revision 1.185 / (download) - annotate - [select for diffs], Fri Dec 30 11:22:23 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.184: +87 -216 lines
Diff to previous 1.184 (colored)

Merge rde_attr_error() into rde_attr_parse() it is no longer necessary to
have a separate error function. It is no porblem to call rde_update_err()
directly.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Dec 24 13:52:56 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.183: +2 -2 lines
Diff to previous 1.183 (colored)

Don't use bzero(&pfd, sizeof(pfd)); pfd is an array so bzero(pfd, sizeof(pfd));
is better. Discussed on icb.

Revision 1.183 / (download) - annotate - [select for diffs], Fri Dec 9 16:17:28 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.182: +3 -1 lines
Diff to previous 1.182 (colored)

Unkown attributes need to be optional, if not issue a "unknown wellknown
attribute" error. While this check is already present in the error handling
function it is not done while parsing. Found via regress, OK henning@

Revision 1.182 / (download) - annotate - [select for diffs], Thu Dec 8 16:02:56 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.181: +2 -1 lines
Diff to previous 1.181 (colored)

Missing ntohs() in error path. Found via regress test.

Revision 1.181 / (download) - annotate - [select for diffs], Wed Nov 30 13:45:19 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.180: +1 -11 lines
Diff to previous 1.180 (colored)

No need to filter incoming withdraws just try to remove everything form the
RIB -- if it got filtered before so be it.

Revision 1.180 / (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.179: +6 -6 lines
Diff to previous 1.179 (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.179 / (download) - annotate - [select for diffs], Tue Nov 29 20:45:21 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.178: +4 -4 lines
Diff to previous 1.178 (colored)

even more spaces and tabs.

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

Use the new rde_filter_equal() with dir = DIR_OUT to check if a soft-
reconfigure out run is needed or not. If the output filters did not change
no table walk is needed.

Revision 1.177 / (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.176: +66 -12 lines
Diff to previous 1.176 (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.176 / (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.175: +14 -3 lines
Diff to previous 1.175 (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.175 / (download) - annotate - [select for diffs], Tue Nov 1 10:58:29 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.174: +4 -14 lines
Diff to previous 1.174 (colored)

Switch from the per peer filter set list to a filter-only solution.
The default filter_sets are converted into match filter rules that get
evaluated first. Simplifies code massively -- mainly the config reload
part -- and makes softreconfig out a piece of cake.  "get it in" henning@

Revision 1.174 / (download) - annotate - [select for diffs], Thu Oct 13 09:08:21 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.173: +8 -20 lines
Diff to previous 1.173 (colored)

Simplify poll loop, there is no need for nfds tracking. While there kill
some comments that are totaly wrong. OK henning@

Revision 1.173 / (download) - annotate - [select for diffs], Wed Sep 21 13:35:03 2005 UTC (18 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.172: +8 -2 lines
Diff to previous 1.172 (colored)

Make sure that "updates" with only MP withdraws (MP_UNREACH_NRLI) stop
processing after the MP withdraw block. OK henning@

Revision 1.172 / (download) - annotate - [select for diffs], Tue Sep 20 14:40:32 2005 UTC (18 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.171: +4 -3 lines
Diff to previous 1.171 (colored)

allow "show rib" to be limited to an address family too

Revision 1.171 / (download) - annotate - [select for diffs], Tue Sep 20 13:31:53 2005 UTC (18 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.170: +22 -4 lines
Diff to previous 1.170 (colored)

let "bgpctl network show" print v6 addresses correctly

Revision 1.170 / (download) - annotate - [select for diffs], Mon Sep 19 15:58:43 2005 UTC (18 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.169: +13 -13 lines
Diff to previous 1.169 (colored)

KNF

Revision 1.169 / (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.168: +6 -6 lines
Diff to previous 1.168 (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.168 / (download) - annotate - [select for diffs], Fri Jul 29 22:26:30 2005 UTC (18 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.167: +17 -24 lines
Diff to previous 1.167 (colored)

Debugging session at WTH. Fix many bugs in the IPv6 support -- some copy paste
and some more obscure ones. With this is it possible to run IPv6 sessions
between two bgpd.
OK if it does not break IPv4 hummpa barman Henning

Revision 1.167 / (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.166: +156 -23 lines
Diff to previous 1.166 (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.166 / (download) - annotate - [select for diffs], Fri Jul 1 13:38:14 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.165: +9 -9 lines
Diff to previous 1.165 (colored)

Switch filter_sets form SIMPLEQ to TAILQ, needed for upcomming stuff.

Revision 1.165 / (download) - annotate - [select for diffs], Fri Jul 1 12:10:20 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (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.164 / (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.163: +4 -4 lines
Diff to previous 1.163 (colored)

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

Revision 1.163 / (download) - annotate - [select for diffs], Wed Jun 29 09:43:25 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.162: +4 -3 lines
Diff to previous 1.162 (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.162 / (download) - annotate - [select for diffs], Mon Jun 13 21:16:18 2005 UTC (18 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.161: +15 -12 lines
Diff to previous 1.161 (colored)

route label support, kroute part and ID allocator as well as the internal
interface changes. support in the filter language and rde to come. claudio ok

Revision 1.161 / (download) - annotate - [select for diffs], Fri Jun 10 08:28:50 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.160: +5 -32 lines
Diff to previous 1.160 (colored)

Simplify show rib upcalls. Kill one mostly unused function.

Revision 1.160 / (download) - annotate - [select for diffs], Mon May 23 22:45:02 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.159: +1 -3 lines
Diff to previous 1.159 (colored)

no need for endpwent()
(you lost, theo)

Revision 1.159 / (download) - annotate - [select for diffs], Tue May 3 07:01:23 2005 UTC (19 years, 1 month ago) by djm
Branch: MAIN
Changes since 1.158: +3 -4 lines
Diff to previous 1.158 (colored)

setres[ug]id; ok claudio@

Revision 1.158 / (download) - annotate - [select for diffs], Thu Apr 28 13:54:45 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.157: +11 -1 lines
Diff to previous 1.157 (colored)

Support for "network connected" and "network static" -- announce all
directly connected respectively all static routes. The list is auto-
matically adjusted as soon as a route changes.
OK henning@

Revision 1.157 / (download) - annotate - [select for diffs], Sat Apr 16 19:10:59 2005 UTC (19 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.156: +2 -2 lines
Diff to previous 1.156 (colored)

Format string cleanup. OK millert, henning, claudio

Revision 1.156 / (download) - annotate - [select for diffs], Mon Mar 28 15:16:46 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.155: +2 -2 lines
Diff to previous 1.155 (colored)

ewps, this was not supposed to creep in

Revision 1.155 / (download) - annotate - [select for diffs], Mon Mar 28 15:03:33 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.154: +2 -2 lines
Diff to previous 1.154 (colored)

free rules_l if the initial config file parse fails

Revision 1.154 / (download) - annotate - [select for diffs], Thu Mar 24 10:28:39 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.153: +4 -4 lines
Diff to previous 1.153 (colored)

soem fatal()s that should be fatalx()s, Alexander von Gernler

Revision 1.153 / (download) - annotate - [select for diffs], Tue Nov 23 13:07:01 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.152: +76 -6 lines
Diff to previous 1.152 (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.152 / (download) - annotate - [select for diffs], Fri Nov 19 14:43:57 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.151: +4 -4 lines
Diff to previous 1.151 (colored)

For consistency reasons rename struct as_filter to struct filter_as.
OK henning@

Revision 1.151 / (download) - annotate - [select for diffs], Thu Nov 11 16:59:47 2004 UTC (19 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.150: +10 -1 lines
Diff to previous 1.150 (colored)

Unbreak peer_localaddr() because Link Local Addresses reported by
getifaddrs() have the scope id added to the address and so fuck up in the
compare later. This part has bin stolen from ifconfig/ifconfig.c and shows
the beauty of IPv6. Thank you KAME.
disgusting but OK henning@

Revision 1.150 / (download) - annotate - [select for diffs], Thu Nov 11 16:50:33 2004 UTC (19 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.149: +2 -2 lines
Diff to previous 1.149 (colored)

Pass the copied as-path attributes to the filter function and not the
original. Affected code is currently still unreachable.

Revision 1.149 / (download) - annotate - [select for diffs], Thu Nov 11 13:29:37 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.148: +2 -2 lines
Diff to previous 1.148 (colored)

spaces at EOL in comments, spotted by theo

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

NOTREACHED not not reached! Stupid me.

Revision 1.147 / (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.146: +99 -2 lines
Diff to previous 1.146 (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.146 / (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.145: +7 -1 lines
Diff to previous 1.145 (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.145 / (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.144: +11 -8 lines
Diff to previous 1.144 (colored)

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

Revision 1.144 / (download) - annotate - [select for diffs], Thu Sep 16 17:36:29 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.143: +24 -19 lines
Diff to previous 1.143 (colored)

imsg API cleanup:
-kill imsg_compose_pid, imsg_compose_fdpass and imsg_create_pid
-extend the original imsg_compose/_create API to take pid & fd too
-make imsg_compose do imsg_create + imsg_add + imsg_close instead of
 duplicating the code
-adjust all callers to the new API
ok claudio

Revision 1.143 / (download) - annotate - [select for diffs], Thu Sep 16 00:25:12 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.142: +41 -36 lines
Diff to previous 1.142 (colored)

malloc the imsg buffers instead of having them staticly, suggested by
micskye some time ago

Revision 1.142 / (download) - annotate - [select for diffs], Thu Aug 12 10:24:16 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.141: +17 -31 lines
Diff to previous 1.141 (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.141 / (download) - annotate - [select for diffs], Tue Aug 10 14:06:53 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.140: +1 -6 lines
Diff to previous 1.140 (colored)

Gahhh, why is this still around? It was never necessary to inform the parent
after fd passing. I thought I removed that some time ago... anyway now it
is gone.

Revision 1.140 / (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.139: +6 -3 lines
Diff to previous 1.139 (colored)

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

Revision 1.139 / (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.138: +578 -129 lines
Diff to previous 1.138 (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.138 / (download) - annotate - [select for diffs], Fri Aug 6 11:51:19 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.137: +20 -1 lines
Diff to previous 1.137 (colored)

Forward IMSG_CTL_SHOW_NEIGHBOR messages to the rde so that we can report
the current and max prefix count back to bgpctl. OK henning@

Revision 1.137 / (download) - annotate - [select for diffs], Thu Aug 5 21:01:38 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.136: +11 -5 lines
Diff to previous 1.136 (colored)

The peer_l is not needed in the rde but still allocated, free them and
save 1k per peer. OK henning@

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

As usual cleanup on exit. OK henning@

Revision 1.135 / (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.134: +3 -5 lines
Diff to previous 1.134 (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.134 / (download) - annotate - [select for diffs], Thu Aug 5 16:26:56 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.133: +7 -7 lines
Diff to previous 1.133 (colored)

struct prefix has a pointer to the peer so use it everywhere directly instead
of the detour via aspath.

Revision 1.133 / (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.132: +2 -2 lines
Diff to previous 1.132 (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.132 / (download) - annotate - [select for diffs], Thu Aug 5 15:19:50 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.131: +2 -1 lines
Diff to previous 1.131 (colored)

we wanna ignore SIGPIPE here just like in the session engine, claudio ok

Revision 1.131 / (download) - annotate - [select for diffs], Wed Aug 4 12:41:48 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

session_main() and rde_main() return... right, a pid. and a pid is a pid_t
and not an int.

Revision 1.130 / (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.129: +6 -1 lines
Diff to previous 1.129 (colored)

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

Revision 1.129 / (download) - annotate - [select for diffs], Thu Jul 29 17:05:13 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.128: +2 -1 lines
Diff to previous 1.128 (colored)

Initalize local varible in rde_update_get_prefix or we may end up with funny
prefixes.

Revision 1.128 / (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.127: +2 -2 lines
Diff to previous 1.127 (colored)

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

Revision 1.127 / (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.126: +5 -5 lines
Diff to previous 1.126 (colored)

fix some typos

ok henning otto

Revision 1.126 / (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.125: +7 -2 lines
Diff to previous 1.125 (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.125 / (download) - annotate - [select for diffs], Mon Jul 5 02:13:44 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.124: +2 -2 lines
Diff to previous 1.124 (colored)

fix a few KNF fallouts

Revision 1.124 / (download) - annotate - [select for diffs], Sun Jul 4 03:51:31 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.123: +4 -2 lines
Diff to previous 1.123 (colored)

2 more file descriptors for each RDE and SE inherited from the parent
we should close

Revision 1.123 / (download) - annotate - [select for diffs], Sun Jul 4 03:37:03 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.122: +2 -1 lines
Diff to previous 1.122 (colored)

when getting rid of the listen_addr TAILQ after forking actually close
the file descriptors in RDE and parent process, not needed or used there

Revision 1.122 / (download) - annotate - [select for diffs], Sat Jul 3 17:19:59 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.121: +65 -20 lines
Diff to previous 1.121 (colored)

Switch mrt dumping to fd passing. This gives some speed up when extensive
dumping is done. Acctually mrt dumps were broken because of the fd passing.
The nice side effect is a much cleaner code, especially in the parent process.
OK henning@

Revision 1.121 / (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.120: +188 -9 lines
Diff to previous 1.120 (colored)

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

Revision 1.120 / (download) - annotate - [select for diffs], Wed Jun 23 07:10:05 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.119: +1 -2 lines
Diff to previous 1.119 (colored)

kill that stupid AS path loop whining, that is normal

Revision 1.119 / (download) - annotate - [select for diffs], Tue Jun 22 23:17:01 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.118: +9 -20 lines
Diff to previous 1.118 (colored)

Cleanup. jajaja henning@

Revision 1.118 / (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.117: +24 -19 lines
Diff to previous 1.117 (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.117 / (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.116: +5 -5 lines
Diff to previous 1.116 (colored)

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

Revision 1.116 / (download) - annotate - [select for diffs], Sun Jun 6 17:38:10 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.115: +13 -7 lines
Diff to previous 1.115 (colored)

rework bgpd's handling of listening sockets. instead of one for each
supported address familiy, keep a tailq of an arbitary number of them.
the new struct listen_addr contains the sockaddr and the fd.
this fixes quite some nasty behaviour which was a consequence of the previous
model.
looks right deraadt@, and discussed with claudio

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

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

Revision 1.114 / (download) - annotate - [select for diffs], Fri May 21 12:10:22 2004 UTC (20 years ago) by claudio
Branch: MAIN
Changes since 1.113: +8 -1 lines
Diff to previous 1.113 (colored)

Grrr. Forgot to cleanup dynamic announcements on shutdown.

Revision 1.113 / (download) - annotate - [select for diffs], Fri May 21 11:48:56 2004 UTC (20 years ago) by claudio
Branch: MAIN
Changes since 1.112: +94 -7 lines
Diff to previous 1.112 (colored)

Add support for dynamic announcements. Usefule to annouce temporary
blackhole routes or to make network announcements dependent on a external
state (e.g. for carp setups) OK henning@

Revision 1.112 / (download) - annotate - [select for diffs], Sat May 8 19:17:20 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

KNF

Revision 1.111 / (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.110: +34 -1 lines
Diff to previous 1.110 (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.110 / (download) - annotate - [select for diffs], Fri Apr 30 05:47:50 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.109: +4 -4 lines
Diff to previous 1.109 (colored)

spelling

Revision 1.109 / (download) - annotate - [select for diffs], Thu Apr 29 19:56:04 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored)

sock -> fd; ok henning

Revision 1.108 / (download) - annotate - [select for diffs], Wed Apr 28 04:36:16 2004 UTC (20 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.107: +9 -5 lines
Diff to previous 1.107 (colored)

Unbreak the stuff that I commited first that was totaly broken. OK henning@

Revision 1.107 / (download) - annotate - [select for diffs], Wed Apr 28 03:34:38 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.106: +6 -2 lines
Diff to previous 1.106 (colored)

make this at least compile

Revision 1.106 / (download) - annotate - [select for diffs], Wed Apr 28 02:57:27 2004 UTC (20 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.105: +25 -2 lines
Diff to previous 1.105 (colored)

Enable route refresh in the RDE. Now peer can request route refreshes.
OK henning@

Revision 1.105 / (download) - annotate - [select for diffs], Tue Apr 27 04:38:12 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.104: +4 -4 lines
Diff to previous 1.104 (colored)

crud stripping; henning ok

Revision 1.104 / (download) - annotate - [select for diffs], Sun Apr 25 17:34:39 2004 UTC (20 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.103: +7 -33 lines
Diff to previous 1.103 (colored)

Remove the no longer needed configure stuff in RDE. The peer list needs no
longer to be synced between parent, SE and RDE. OK henning@

Revision 1.103 / (download) - annotate - [select for diffs], Sun Apr 25 07:16:24 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.102: +10 -28 lines
Diff to previous 1.102 (colored)

add "neighbor cloning", allowing you to specify a prefix and prefixlength
instead of the neighbor's IP address. WHen a connection comes in matching
that mask we clone the neighbor spec.
IPv6 match code by itojun, rde feeding by claudio, ok claudio

Revision 1.102 / (download) - annotate - [select for diffs], Sun Apr 25 02:57:55 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

&d and %d have different meanings in format strings, yeah

Revision 1.101 / (download) - annotate - [select for diffs], Sat Mar 20 23:17:35 2004 UTC (20 years, 2 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

comment spelling fixes; ok henning@

Revision 1.100 / (download) - annotate - [select for diffs], Mon Mar 15 11:48:04 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.99: +4 -3 lines
Diff to previous 1.99 (colored)

properly check chdir success after chroot() and tweak err msgs a little,
claudio ok

Revision 1.99 / (download) - annotate - [select for diffs], Fri Mar 12 20:48:09 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.98: +4 -10 lines
Diff to previous 1.98 (colored)

tweak err reporting

Revision 1.98 / (download) - annotate - [select for diffs], Fri Mar 12 19:33:30 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

not debugging any more

Revision 1.97 / (download) - annotate - [select for diffs], Thu Mar 11 17:34:01 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

KNF

Revision 1.96 / (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.95: +85 -3 lines
Diff to previous 1.95 (colored)

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

Revision 1.95 / (download) - annotate - [select for diffs], Wed Mar 10 14:29:37 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.94: +6 -1 lines
Diff to previous 1.94 (colored)

when we exit try to write out what is left in the msg buffers for the imsg
pipes and clear buffers afterwards

Revision 1.94 / (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.93: +13 -9 lines
Diff to previous 1.93 (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.93 / (download) - annotate - [select for diffs], Tue Mar 2 19:29:01 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.92: +61 -9 lines
Diff to previous 1.92 (colored)

Framework for rib lookups by prefix. OK henning@

Revision 1.92 / (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.91: +32 -7 lines
Diff to previous 1.91 (colored)

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

Revision 1.91 / (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.90: +6 -9 lines
Diff to previous 1.90 (colored)

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

Revision 1.90 / (download) - annotate - [select for diffs], Fri Feb 27 14:46:09 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

Cleanup no functional changes. OK henning@

Revision 1.89 / (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.88: +129 -1 lines
Diff to previous 1.88 (colored)

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

Revision 1.88 / (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.87: +3 -3 lines
Diff to previous 1.87 (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.87 / (download) - annotate - [select for diffs], Thu Feb 26 09:53:58 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.86: +4 -1 lines
Diff to previous 1.86 (colored)

Add per netwok definition filter sets. So you can now use
network 10.0.0.0/8 set localpref 100
OK henning@

Revision 1.86 / (download) - annotate - [select for diffs], Wed Feb 25 19:48:18 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.85: +2 -18 lines
Diff to previous 1.85 (colored)

Rewrite some parts of the mrt dump handling. It is no longer possible to
dump the filtered updates but therefore it is now possible to dump per
neighbor and also to dump the outgoing messages. OK henning@

Revision 1.85 / (download) - annotate - [select for diffs], Tue Feb 24 15:43:03 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.84: +6 -3 lines
Diff to previous 1.84 (colored)

Enhance filters. prefixlen knows now 8-24 and 8><24. It is possible to use
prefix 10.0.0.0/8 prefixlen >= 8 and set localpref 100 can be set on a per
neighbor basis. OK henning@

Revision 1.84 / (download) - annotate - [select for diffs], Mon Feb 23 17:19:26 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.83: +10 -9 lines
Diff to previous 1.83 (colored)

I was hunting this bug for quite some time. Don't use a value you need later
as counter. This fixes the bad nlri prefix errors I got. OK henning@

Revision 1.83 / (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.82: +29 -12 lines
Diff to previous 1.82 (colored)

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

Revision 1.82 / (download) - annotate - [select for diffs], Thu Feb 19 13:54:58 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.81: +6 -7 lines
Diff to previous 1.81 (colored)

Make the code more portable. Add some missing header files and make the use
of the queue(3) makros more portable. OK henning@ some time ago.

Revision 1.81 / (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.80: +29 -2 lines
Diff to previous 1.80 (colored)

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

Revision 1.80 / (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.79: +11 -2 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Tue Feb 17 19:12:58 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.78: +4 -4 lines
Diff to previous 1.78 (colored)

Somehow size needs some time to settle. The direct inline call of attr_error
caused troubles on my test machines which manifested in garbage size values.
OK henning@

Revision 1.78 / (download) - annotate - [select for diffs], Mon Feb 16 14:26:29 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.77: +11 -10 lines
Diff to previous 1.77 (colored)

Extend imsg API so that messages can be composed on the fly. In the RDE it
happens often, that imsg consists of multiple objects. OK henning@

Revision 1.77 / (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.76: +38 -119 lines
Diff to previous 1.76 (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.76 / (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.75: +8 -8 lines
Diff to previous 1.75 (colored)

replace a bunch of u_long by u_int32_t

Revision 1.75 / (download) - annotate - [select for diffs], Mon Feb 9 01:46:34 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

make max_prefix an u_int32_t instead of an u_long and change its
meaning as in 0 means no limit insytead of setting it to ULONG_MAX for
no limit

Revision 1.74 / (download) - annotate - [select for diffs], Sat Feb 7 11:42:30 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.73: +25 -3 lines
Diff to previous 1.73 (colored)

send filter rules to the RDE on reloads, help & ok claudio

Revision 1.73 / (download) - annotate - [select for diffs], Mon Feb 2 19:14:11 2004 UTC (20 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

spaces

Revision 1.72 / (download) - annotate - [select for diffs], Mon Feb 2 18:56:25 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.71: +18 -9 lines
Diff to previous 1.71 (colored)

Fix bug in the decision process. The decision process is unable to directly
detect changes of the active prefix. This bug is only triggered when a
nexthop changes state. While doing that clarify prefix_move a bit.
OK henning@

Revision 1.71 / (download) - annotate - [select for diffs], Mon Feb 2 16:44:05 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.70: +3 -2 lines
Diff to previous 1.70 (colored)

Seal a memory leak and fix a format string, conf->as is unsigned.
OK henning@

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jan 28 19:24:06 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.69: +3 -1 lines
Diff to previous 1.69 (colored)

catch SIGINT here as well so we can properly shut down if ^C'ed in debug mode

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jan 27 21:56:21 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

move strict kroute from in_addr_t for nexthop and prefix to struct in_addr
ok claudio

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jan 27 16:49:53 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.67: +2 -8 lines
Diff to previous 1.67 (colored)

use a struct bgpd_addr instead of sockaddr_in for peer_config->local_addr and
->remote_addr for easier multiprotocol support

ok claudio@

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jan 22 21:09:00 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.66: +2 -3 lines
Diff to previous 1.66 (colored)

provide a log_debug and use it in rde.c.
with this, logit() can be a private function.
we don't need to include syslog.h in bgpd.h any more; log.c and parse.y
who need it include it directly now.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Jan 22 21:01:26 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.65: +2 -3 lines
Diff to previous 1.65 (colored)

use log_peer_warnx() now that we can, claudio agrees

Revision 1.65 / (download) - annotate - [select for diffs], Thu Jan 22 20:34:56 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.64: +9 -12 lines
Diff to previous 1.64 (colored)

use log_warnx and log_info. reclassify a few messages in the process and fix
a few messages.

ok claudio@

Revision 1.64 / (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.63: +71 -10 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Tue Jan 13 13:45:49 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.62: +7 -1 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Tue Jan 13 13:34:56 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.61: +12 -9 lines
Diff to previous 1.61 (colored)

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

Revision 1.61 / (download) - annotate - [select for diffs], Tue Jan 13 13:18:03 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.60: +20 -1 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Sun Jan 11 22:08:04 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

KNF

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jan 11 22:06:57 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.58: +1 -2 lines
Diff to previous 1.58 (colored)

This comment is not true. We decided to use a separate struct kroute6
for IPv6.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jan 11 21:57:58 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

remove obsolete comment

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jan 11 21:56:07 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.56: +3 -2 lines
Diff to previous 1.56 (colored)

Bad sizeof slipped in while resolving a conflict. OK henning@

Revision 1.56 / (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.55: +22 -21 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Sun Jan 11 21:32:56 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.54: +12 -8 lines
Diff to previous 1.54 (colored)

in the nexthop imsgs use struct bgpd_addr for the data part instead of
in_addr_t

ok claudio@

Revision 1.54 / (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.53: +11 -8 lines
Diff to previous 1.53 (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.53 / (download) - annotate - [select for diffs], Sun Jan 11 02:39:05 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

KNF

Revision 1.52 / (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.51: +18 -5 lines
Diff to previous 1.51 (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.51 / (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.50: +62 -16 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Wed Jan 7 12:38:36 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.49: +4 -6 lines
Diff to previous 1.49 (colored)

Modified version of hennings last patch. OK henning@

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jan 7 01:58:56 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)

don't ever send kroute change (that includes add) requests to the parent
where the nexthop is not in state NEXTHOP_REACH.
previously routes in state NEXTHOP_LOOKUP, i. e. not yet verified, were
send to the parent process causing unnecessary and of course failing route
add attempts, cluttering logs, etc. nexthops in state NEXTHOP_UNREACH were
handled correctly.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jan 7 00:01:16 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.47: +5 -2 lines
Diff to previous 1.47 (colored)

Make sure that kroute updates for the FIB are only sent if there is a
change. Until now rde_send_kroute tried to send a IMSG_KROUTE_DELETE if old
and new prefix where ineligible. OK henning@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jan 6 03:43:50 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

2004

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jan 5 22:57:58 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.45: +28 -9 lines
Diff to previous 1.45 (colored)

Big overhaul of the mrt code.
Dumping of incomming bgp messages is now possible and dumping the (not yet)
filtered updates works too. Per neighbor dumps are still missing.
OK henning@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jan 4 20:47:34 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.44: +58 -58 lines
Diff to previous 1.44 (colored)

split the dispatch_imsg function into twom one per pipe.
with the amount of different msgs the RDE is handling the checks wether
a msg was received on the "wrong" pipe make things less clear.
also remove some outdated comments

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jan 4 17:19:41 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

in the SE, keep the remote router-id in network byte order, just like
every other IP address
in the RDE, transform in into host byte order upon receival

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jan 3 20:37:34 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.42: +7 -6 lines
Diff to previous 1.42 (colored)

move some session specific stuff to session.h and make the few files
that need it include that

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 3 20:22:07 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.41: +8 -8 lines
Diff to previous 1.41 (colored)

decouple the peer list from bgpd_config.
so many parts of bgpd are not at all interested in the session specific peer
structs... allows for some further cleaning

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jan 3 14:06:35 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.40: +5 -2 lines
Diff to previous 1.40 (colored)

change imsg_read semantics so that the number of bytes read is returned.
that means that the callers can (and must) coope with closed connections
themselves, what is exactly the desired behaviour.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 1 23:09:09 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.39: +10 -4 lines
Diff to previous 1.39 (colored)

now that imsg_get uses bigger buffers, one read call can put more than one
imsg into the buffer. since imsg_get by definition only returns one imsg we
missed the next imsg(s) until the next poll event on the socket in question,
building up a queue on that socket. didn't show up as a problem yet...
factor out imsg_read, which reads into the buffer. imsg_get now entirely
operates on the buffers and does not read(2) itself.
make all callers cope by calling imsg_read on poll events and calling
imsg_get in a loop until all imsgs are processed.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Dec 27 00:53:51 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.38: +1 -4 lines
Diff to previous 1.38 (colored)

implement "no fib-update" much cooler

Revision 1.38 / (download) - annotate - [select for diffs], Sat Dec 27 00:18:11 2003 UTC (20 years, 5 months ago) by jakob
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

do not print NULL nexthop (e.g. from a withdrawn route)

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 26 23:50:35 2003 UTC (20 years, 5 months ago) by jakob
Branch: MAIN
Changes since 1.36: +12 -3 lines
Diff to previous 1.36 (colored)

print nexthop when logging. ok henning@

Revision 1.36 / (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.35: +5 -3 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Fri Dec 26 21:33:14 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

when asking the kernel to add a route, send him the true nexthop and not
the exit nexthop as the latter will only work if the two happen to be equal

Revision 1.34 / (download) - annotate - [select for diffs], Fri Dec 26 20:52:14 2003 UTC (20 years, 5 months ago) by jakob
Branch: MAIN
Changes since 1.33: +27 -1 lines
Diff to previous 1.33 (colored)

add option 'log updates' to log updates. ok henning@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Dec 26 18:33:11 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.32: +21 -11 lines
Diff to previous 1.32 (colored)

let imsg_get and imsg_compose not fatal() but return errors upstream.
make the callers cope.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Dec 26 18:07:33 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.31: +22 -22 lines
Diff to previous 1.31 (colored)

when this project started and i added the fatal() function, I made it take
the error number as parameter instead of accessing errno, because in one
place the error number was not in errno but fetched from a socket.
now, of course it makes much more sense to just set errno to the error number
just fecthed in this one place instead of having hundreds of fatal() calls
all transfer the errno round and round and round...
fix this, and also provide a fatalx, which does not care for errno and doesn't
invoke strerror.
oh, btw, in the place where we fetch the err # from the socket, we don't
call fatal anymore anyway...

Revision 1.31 / (download) - annotate - [select for diffs], Thu Dec 25 23:41:23 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.30: +2 -8 lines
Diff to previous 1.30 (colored)

Turn the nexthop verification on. At least in the RDE.

ok henning@

Revision 1.30 / (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.29: +19 -1 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Thu Dec 25 02:24:26 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.28: +2 -5 lines
Diff to previous 1.28 (colored)

kill IMSG_KROUTE_ADD as well. just send KROUTE_CHANGE requests.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Dec 24 23:48:06 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

syscalls return -1 on err so test for == -1 instead of the < 0 found in very
few places, requested by theo

Revision 1.27 / (download) - annotate - [select for diffs], Wed Dec 24 20:09:57 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.26: +1 -5 lines
Diff to previous 1.26 (colored)

now that the main process can cleanup without RDE's help, we do not need the
somewhat fragile IMSG_SHUTDOWN_* stuff any more. speeds shutdown up
enourmously.

ok claudio@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Dec 24 19:59:24 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.25: +1 -12 lines
Diff to previous 1.25 (colored)

now that we keep track of the routes we added to the kernel we can remove
them easily on shutdown without the RDE's help

Revision 1.25 / (download) - annotate - [select for diffs], Wed Dec 24 13:49:21 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.24: +4 -1 lines
Diff to previous 1.24 (colored)

add option to not touch the kernel routing table

Revision 1.24 / (download) - annotate - [select for diffs], Wed Dec 24 13:28:02 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.23: +3 -4 lines
Diff to previous 1.23 (colored)

handle write() returning 0 correctly, adjust the msgbuf API appropriately,
and make all callers cope.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 23 19:14:49 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

spacing

Revision 1.22 / (download) - annotate - [select for diffs], Tue Dec 23 19:13:27 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.21: +1 -7 lines
Diff to previous 1.21 (colored)

kill a chunk of debug code that is not usefull any more

ok claudio@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Dec 23 18:52:46 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.20: +12 -1 lines
Diff to previous 1.20 (colored)

In case of exit the RDE need to tell the parent to remove all still active
prefixes from the kernel routing table. This is done with a simple table
walk. OK henning@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 23 18:28:05 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.19: +5 -1 lines
Diff to previous 1.19 (colored)

send shutdown requests to the child processes and wait for a ackmessage from
them when shutting down.
the rde needs the main process to clean up the routing table on exit so the
parent process needs to be in service until the RDE is done.
ok claudio@

Revision 1.19 / (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.18: +31 -1 lines
Diff to previous 1.18 (colored)

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

Revision 1.18 / (download) - annotate - [select for diffs], Sun Dec 21 23:28:39 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

rename get_imsg() to imsg_get(); that's more consistent

Revision 1.17 / (download) - annotate - [select for diffs], Sun Dec 21 23:26:38 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.16: +21 -25 lines
Diff to previous 1.16 (colored)

wrap read & write buffers for imsgs into a struct.
finally gives us read buffers per pipe instead of per process, eleminating
a possible race.
also gets us a real imsg_init() that does all the boring init work

Revision 1.16 / (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.15: +28 -26 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Sat Dec 20 21:43:45 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.14: +5 -5 lines
Diff to previous 1.14 (colored)

knf. OK henning@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Dec 20 21:19:40 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

more cast cleanup imsg_compose takes now a void * argument. OK henning@

Revision 1.13 / (download) - annotate - [select for diffs], Sat Dec 20 20:53:30 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.12: +3 -1 lines
Diff to previous 1.12 (colored)

few missing break; in default: cases in switch; one noticed by tedu@

Revision 1.12 / (download) - annotate - [select for diffs], Sat Dec 20 18:32:22 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.11: +3 -1 lines
Diff to previous 1.11 (colored)

keep track which process we are so fatal() can log in which proc the
condition happened. fatal()s from subsystems used by all 3 processes like
the imsg subsystem were hard to track down without knowing in which process
the condition happened.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Dec 20 15:09:07 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

formulate two comparisons sligthly different to prevent the left side from
becoming negative. this was logically impossible already but this way gcc
has the chance to notice that as well.
together with the last commit this makes bgod -Wsign-compare clean

Revision 1.10 / (download) - annotate - [select for diffs], Sat Dec 20 14:36:46 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.9: +2 -3 lines
Diff to previous 1.9 (colored)

poll returns plain int...

Revision 1.9 / (download) - annotate - [select for diffs], Fri Dec 19 19:24:08 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

knf

Revision 1.8 / (download) - annotate - [select for diffs], Fri Dec 19 16:46:46 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.7: +35 -28 lines
Diff to previous 1.7 (colored)

Rework of the RDE config merge. This fixes problems with peers that
where newer up. OK henning@

Revision 1.7 / (download) - annotate - [select for diffs], Fri Dec 19 11:19:02 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.6: +8 -9 lines
Diff to previous 1.6 (colored)

fix getpwnam use; noticed by claudio@

Revision 1.6 / (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.5: +7 -7 lines
Diff to previous 1.5 (colored)

knf & 64-bit cleanup; henning ok

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 19 01:13:34 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.4: +4 -3 lines
Diff to previous 1.4 (colored)

for(p = something; p != NULL; p = p->next) is not going to fly if there is
a free(p) inside that for loop...

Revision 1.4 / (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.3: +55 -21 lines
Diff to previous 1.3 (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.3 / (download) - annotate - [select for diffs], Wed Dec 17 19:26:26 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.2: +39 -6 lines
Diff to previous 1.2 (colored)

send reconf requests to the RDE as well and handle them there; syncing peer
data with RIB missing
use same message in RDE and SE for consistency

Revision 1.2 / (download) - annotate - [select for diffs], Wed Dec 17 18:11:31 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.1: +8 -10 lines
Diff to previous 1.1 (colored)

style

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.