OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.479 / (download) - annotate - [select for diffs], Wed May 29 10:38:24 2024 UTC (3 days, 9 hours ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.478: +5 -2 lines
Diff to previous 1.478 (colored)

Only fall back to the default IPv4 unicast mode if there was no MP
capability neither from our side not the remote end.

Also track unknown AFI/SAFI combos for the remote end in AID_UNSPEC
this way even unknown combos will prevent a fall back.
OK henning@ sthen@

Revision 1.478 / (download) - annotate - [select for diffs], Wed May 22 08:41:14 2024 UTC (10 days, 11 hours ago) by claudio
Branch: MAIN
Changes since 1.477: +7 -6 lines
Diff to previous 1.477 (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.477 / (download) - annotate - [select for diffs], Mon May 20 10:01:52 2024 UTC (12 days, 10 hours ago) by claudio
Branch: MAIN
Changes since 1.476: +159 -183 lines
Diff to previous 1.476 (colored)

Convert more of the session engine parsers to the new ibuf API

This converts OPEN and it capability parser and RREFRESH and with that
all packet parser are kind of converted. There is still parse_header()
and the general packet handling that needs some work now so that all
the ugly ibuf_from_buffer() can be dropped.
OK tb@

Revision 1.476 / (download) - annotate - [select for diffs], Thu May 16 09:38:21 2024 UTC (2 weeks, 2 days ago) by claudio
Branch: MAIN
Changes since 1.475: +3 -8 lines
Diff to previous 1.475 (colored)

Simplify the code to clamp the TCP send and recv buffer to 64k.

We don't really care if it works or not and we don't want to clamp it
down further then 64k. So just call setsockopt() once and ignore the error.
OK tb@ sthen@

Revision 1.475 / (download) - annotate - [select for diffs], Wed May 15 09:09:38 2024 UTC (2 weeks, 3 days ago) by job
Branch: MAIN
Changes since 1.474: +8 -1 lines
Diff to previous 1.474 (colored)

Mark RTR and IPv6 BGP packets with DSCP CS6 (network control)

Additionally, set TCP_NODELAY on the RTR socket, there is no need to
queue up messages towards the RTR server.

OK claudio@

Revision 1.474 / (download) - annotate - [select for diffs], Wed Apr 24 10:41:34 2024 UTC (5 weeks, 3 days ago) by claudio
Branch: MAIN
Changes since 1.473: +1 -10 lines
Diff to previous 1.473 (colored)

Remove 'announce capabilities' as neighbor config stanza.

There is no need to have an easy knob to get outdated or crappy
implementations to limp along. Instead the various default on
capabilities just need to be disabled (e.g. announce as-4byte no).

OK tb@

Revision 1.473 / (download) - annotate - [select for diffs], Mon Apr 22 09:43:11 2024 UTC (5 weeks, 5 days ago) by claudio
Branch: MAIN
Changes since 1.472: +4 -1 lines
Diff to previous 1.472 (colored)

In state IDLE handle EVNT_STOP and stop the IdleHold timer. This way
a down of an idle connection will properly stop the session.

OK tb@ (as part of larger diff)

Revision 1.472 / (download) - annotate - [select for diffs], Mon Apr 22 09:36:04 2024 UTC (5 weeks, 5 days ago) by claudio
Branch: MAIN
Changes since 1.471: +22 -15 lines
Diff to previous 1.471 (colored)

Move setting of the shutdown reason to session_stop()

Also make sure that something is logged when a session is stopped.
Part of a bigger diff which was OK tb@

Revision 1.471 / (download) - annotate - [select for diffs], Mon Apr 22 08:53:59 2024 UTC (5 weeks, 5 days ago) by claudio
Branch: MAIN
Changes since 1.470: +7 -22 lines
Diff to previous 1.470 (colored)

No longer fall back to no capabilities when there is an OPEN/optional
attribute error.

BGP more and more relies on capabilities, automatically clearing them
all no longer seems the right choice. Now operators need to adjust the
config explicitly to allow such connections.
From a larger diff which is OK tb@

Revision 1.470 / (download) - annotate - [select for diffs], Thu Apr 11 08:33:15 2024 UTC (7 weeks, 2 days ago) by claudio
Branch: MAIN
Changes since 1.469: +3 -3 lines
Diff to previous 1.469 (colored)

Use != NULL for pointer check. No binary change.

Revision 1.469 / (download) - annotate - [select for diffs], Wed Apr 10 09:05:32 2024 UTC (7 weeks, 3 days ago) by claudio
Branch: MAIN
Changes since 1.468: +10 -2 lines
Diff to previous 1.468 (colored)

Rework the logic to not send double notifications in session_notification().

last_sent_errcode is now cleared late (when state changes to ESTABLISHED)
and so notifications sent in the OPEN phase would be dropped after the
first incident. Using the session state to know if sending a message is
possible seems more robust and is what session_stop() uses as well.
For now log the notification which are not sent as 'dropping' to see how
often this happens.

OK tb@

Revision 1.468 / (download) - annotate - [select for diffs], Tue Apr 9 09:03:18 2024 UTC (7 weeks, 4 days ago) by claudio
Branch: MAIN
Changes since 1.467: +91 -19 lines
Diff to previous 1.467 (colored)

Allow operators to enforce the presence of certain capabilities on sessions.

For simple capabilities this just adds enforce to the yes/no option of the
announce statement. For multi-protocol capabilities and add-path there is
an extra keyword. On top of this for add-path the enforcement requires the
neighbor to send a matching capability, e.g
'announce add-path recv enforce' requires the other side to send any
'announce add-path send XYZ' capability.

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

OK denis@ tb@

Revision 1.467 / (download) - annotate - [select for diffs], Tue Mar 26 12:45:29 2024 UTC (2 months ago) by claudio
Branch: MAIN
Changes since 1.466: +17 -5 lines
Diff to previous 1.466 (colored)

Move the SendHoldTimer code into start_timer_sendholdtime() and ensure
the timer is stopped if HoldTime is 0.
OK tb@

Revision 1.466 / (download) - annotate - [select for diffs], Fri Mar 22 15:41:34 2024 UTC (2 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.465: +3 -3 lines
Diff to previous 1.465 (colored)

Rework the cease shutdown reason to work in both directions by looking
at the ibuf payload passed to log_notification().
Because of this move ibuf_get_string() and the log_notification() call
in parse_notification().
OK tb@

Revision 1.465 / (download) - annotate - [select for diffs], Fri Mar 22 07:19:28 2024 UTC (2 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.464: +21 -126 lines
Diff to previous 1.464 (colored)

Rework parse_notification() to use the ibuf API for everything.

While there fix the RFC5492 handling of ERR_OPEN_CAPA (the current code
has the logic inversed). ERR_OPEN_CAPA is there to signal that a needed
capability is missing in our OPEN message. Just add the handling of
ERR_OPEN_CAPA to log_notification().

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

OK tb@

Revision 1.464 / (download) - annotate - [select for diffs], Wed Mar 20 09:35:46 2024 UTC (2 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.463: +28 -33 lines
Diff to previous 1.463 (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.463 / (download) - annotate - [select for diffs], Mon Feb 19 10:15:35 2024 UTC (3 months, 1 week ago) by job
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.462: +16 -4 lines
Diff to previous 1.462 (colored)

IANA assigned error 8 to draft-ietf-idr-sendholdtimer

https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-parameters-3

OK claudio@

Revision 1.462 / (download) - annotate - [select for diffs], Tue Feb 13 16:12:37 2024 UTC (3 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.461: +1 -10 lines
Diff to previous 1.461 (colored)

Remove IMSG_SESSION_DOWN handler in the session engine. The RDE does
not issue such imsgs.
OK tb@

Revision 1.461 / (download) - annotate - [select for diffs], Thu Jan 18 14:56:44 2024 UTC (4 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.460: +12 -11 lines
Diff to previous 1.460 (colored)

Convert IMSG_UPDATE and session_update() to new imsg API and ibufs.
OK tb@

Revision 1.460 / (download) - annotate - [select for diffs], Tue Jan 16 13:15:31 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.459: +83 -74 lines
Diff to previous 1.459 (colored)

Switch session_notification() over to use a struct ibuf to carry the
extra data. With this IMSG_UPDATE_ERR can use the new imsg API.

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

OK tb@

Revision 1.459 / (download) - annotate - [select for diffs], Fri Jan 12 11:19:51 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.458: +57 -55 lines
Diff to previous 1.458 (colored)

Convert the simple IMSG calls in session.c to the new imsg API.
OK tb@

Revision 1.458 / (download) - annotate - [select for diffs], Thu Jan 11 14:11:03 2024 UTC (4 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.457: +8 -6 lines
Diff to previous 1.457 (colored)

Clear the last_sent_errcode, last_rcvd_errcode and last_reason when
the session comes up instead of at the start of a connect.
With this the last errors reported should stick around longer.
Reported by linx.net, OK job@

Revision 1.457 / (download) - annotate - [select for diffs], Wed Jan 10 11:08:04 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.456: +17 -6 lines
Diff to previous 1.456 (colored)

Update the control.c code to use the new imsg API.

OK tb@

Revision 1.456 / (download) - annotate - [select for diffs], Thu Dec 14 13:52:38 2023 UTC (5 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.455: +7 -7 lines
Diff to previous 1.455 (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.455 / (download) - annotate - [select for diffs], Tue Nov 7 11:18:35 2023 UTC (6 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.454: +4 -4 lines
Diff to previous 1.454 (colored)

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

Revision 1.454 / (download) - annotate - [select for diffs], Sat Nov 4 11:17:51 2023 UTC (6 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.453: +13 -4 lines
Diff to previous 1.453 (colored)

Use proper length in session_newmsg() for the RFC9072 case.

Right now OpenBGPD can not produce so many capabilities that this
case is reached but still better to fix it now.
OK tb@

Revision 1.453 / (download) - annotate - [select for diffs], Fri Oct 27 14:22:43 2023 UTC (7 months ago) by claudio
Branch: MAIN
Changes since 1.452: +13 -13 lines
Diff to previous 1.452 (colored)

Simplify the handling of optparamlen and RFC9072 support.

Use the ibuf_size() of the optional params (opb) when writing the various
headers. Only use optparamlen to write the Opt Parm Len field of the OPEN
message. Since there the size could be forced to 255 in case of a RFC9072
exended header. Also use size_t for optparamlen since the new ibuf API
no longer depends on using the right sized type.
OK tb@

Revision 1.452 / (download) - annotate - [select for diffs], Fri Oct 27 09:40:27 2023 UTC (7 months ago) by claudio
Branch: MAIN
Changes since 1.451: +3 -3 lines
Diff to previous 1.451 (colored)

The holdtime is added to the ibuf with ibuf_add_n16() so no need to
htons() the value before.
OK tb@

Revision 1.451 / (download) - annotate - [select for diffs], Thu Oct 19 07:02:45 2023 UTC (7 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.450: +46 -64 lines
Diff to previous 1.450 (colored)

Convert the session engine to use the new ibuf API.
OK tb@

Revision 1.450 / (download) - annotate - [select for diffs], Tue Oct 17 17:58:15 2023 UTC (7 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.449: +2 -3 lines
Diff to previous 1.449 (colored)

Remove bogus plen != 0xff check
OK tb@

Revision 1.449 / (download) - annotate - [select for diffs], Mon Oct 16 10:25:46 2023 UTC (7 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.448: +46 -16 lines
Diff to previous 1.448 (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.448 / (download) - annotate - [select for diffs], Mon Oct 9 07:11:20 2023 UTC (7 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.447: +3 -4 lines
Diff to previous 1.447 (colored)

Fix return value confusion of sa_cmp() by renaming the function sa_equal().

The code in get_alternate_addr() checked for sa_cmp() == 0 but actually
sa_cmp() returned 1 for equal addrs. So rename the function to sa_equal()
to make it clear that a true return value means equality.

Found by Asa Yeamans (enigma2e at rivin net)
OK tb@

Revision 1.447 / (download) - annotate - [select for diffs], Fri Aug 4 09:20:12 2023 UTC (9 months, 4 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.446: +3 -2 lines
Diff to previous 1.446 (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.446 / (download) - annotate - [select for diffs], Wed Jul 12 14:45:43 2023 UTC (10 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.445: +3 -3 lines
Diff to previous 1.445 (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.435.2.1 / (download) - annotate - [select for diffs], Wed Jul 12 12:48:18 2023 UTC (10 months, 3 weeks ago) by tb
Branch: OPENBSD_7_2
Changes since 1.435: +3 -1 lines
Diff to previous 1.435 (colored) next main 1.436 (colored)

Check the F_NEXTHOP flag on the right kroute6 object.

On multipath routes the check ended up checking the wrong route for the
nexthop update. This resulted in a use-after-free in kroute_detach_nexthop().
This only affects IPv6 in the IPv4 code path the right object was already used.

Thanks to sthen@ for providing the debug information to track this down.
OK sthen@ tb@
from claudio

In session_process_msg() recheck the validity of the rbuf before moving
the remaining data around.

There is an improbable case where a NOTIFICATION is received while also
reaching the MSG_PROCESS_LIMIT. In this case rbuf is NULL when breaking
out of the for loop and hitting this code.

sthen@ is the (un)lucky person to hit that improbable case
OK tb@ sthen@
from claudio

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

Revision 1.442.4.1 / (download) - annotate - [select for diffs], Wed Jul 12 12:47:41 2023 UTC (10 months, 3 weeks ago) by tb
Branch: OPENBSD_7_3
Changes since 1.442: +3 -1 lines
Diff to previous 1.442 (colored) next main 1.443 (colored)

Check the F_NEXTHOP flag on the right kroute6 object.

On multipath routes the check ended up checking the wrong route for the
nexthop update. This resulted in a use-after-free in kroute_detach_nexthop().
This only affects IPv6 in the IPv4 code path the right object was already used.

Thanks to sthen@ for providing the debug information to track this down.
OK sthen@ tb@
from claudio

In session_process_msg() recheck the validity of the rbuf before moving
the remaining data around.

There is an improbable case where a NOTIFICATION is received while also
reaching the MSG_PROCESS_LIMIT. In this case rbuf is NULL when breaking
out of the for loop and hitting this code.

sthen@ is the (un)lucky person to hit that improbable case
OK tb@ sthen@
from claudio

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

Revision 1.445 / (download) - annotate - [select for diffs], Thu May 25 14:20:25 2023 UTC (12 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.444: +3 -1 lines
Diff to previous 1.444 (colored)

In session_process_msg() recheck the validity of the rbuf before moving
the remaining data around.

There is an improbable case where a NOTIFICATION is received while also
reaching the MSG_PROCESS_LIMIT. In this case rbuf is NULL when breaking
out of the for loop and hitting this code.

sthen@ is the (un)lucky person to hit that improbable case
OK tb@ sthen@

Revision 1.444 / (download) - annotate - [select for diffs], Fri May 5 07:28:08 2023 UTC (12 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.443: +10 -15 lines
Diff to previous 1.443 (colored)

Limit the socket buffer size to 64k for all sessions. Long time ago
setting the size to 64k was increasing the size but now auto-scaling
could grow the buffer size much more. The origianl idea was that sessions
without protection had a small window size to make window attacks
harder. This problem was fixed long time ago and is no longer relevant.
Limiting the buffer size to a reasonable size ensures that not too many
updates end up queued in the TCP stack.
OK benno@ (some time ago)

Revision 1.443 / (download) - annotate - [select for diffs], Thu Apr 20 12:53:27 2023 UTC (13 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.442: +2 -1 lines
Diff to previous 1.442 (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.442 / (download) - annotate - [select for diffs], Thu Mar 9 13:12:19 2023 UTC (14 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE
Branch point for: OPENBSD_7_3
Changes since 1.441: +32 -22 lines
Diff to previous 1.441 (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.441 / (download) - annotate - [select for diffs], Tue Feb 14 15:37:45 2023 UTC (15 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.440: +2 -10 lines
Diff to previous 1.440 (colored)

When initalizing a new peer, wait an extra 5 seconds before connecting
eo the remote end. With this the RDE has a chance to finish config reload
before the session to a new peer is established.
OK tb@

Revision 1.440 / (download) - annotate - [select for diffs], Thu Feb 9 13:43:23 2023 UTC (15 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.439: +14 -9 lines
Diff to previous 1.439 (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.439 / (download) - annotate - [select for diffs], Wed Jan 4 14:33:30 2023 UTC (16 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.438: +58 -14 lines
Diff to previous 1.438 (colored)

Add a per eBGP session role to the config.

This somewhat replaces the RFC 9234 open policy role. This is done because
ASPA requires the same role to be present to properly validate paths.
For iBGP sessions the role is forced to ROLE_NONE. If no role is set on
an ebgp session then 'announce policy' is forced to 'no'.
Also make sure the the role capability is only added if the role is set.
OK tb@

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

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

Revision 1.437 / (download) - annotate - [select for diffs], Tue Dec 27 17:05:38 2022 UTC (17 months ago) by claudio
Branch: MAIN
Changes since 1.436: +16 -7 lines
Diff to previous 1.436 (colored)

Adjust handling of the RFC 9234 role capability for ibgp sessions:
 - Exclude the role capability on ibgp sessions when sending an OPEN
 - Warn when a role capability is received on an iBGP session
 - Make sure the capability negotiation is skipped for ibgp sessions,
   this in turn disables the role capability on the session.
OK tb@

Revision 1.436 / (download) - annotate - [select for diffs], Tue Oct 18 12:24:51 2022 UTC (19 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.435: +3 -1 lines
Diff to previous 1.435 (colored)

Initalize last_updown in init_peer() so that it is reported correctly
for peers that never managed to establish a connection.
OK tb@

Revision 1.435 / (download) - annotate - [select for diffs], Wed Aug 31 15:51:44 2022 UTC (21 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE
Branch point for: OPENBSD_7_2
Changes since 1.434: +1 -2 lines
Diff to previous 1.434 (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.434 / (download) - annotate - [select for diffs], Fri Aug 26 14:10:52 2022 UTC (21 months ago) by claudio
Branch: MAIN
Changes since 1.433: +2 -2 lines
Diff to previous 1.433 (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.433 / (download) - annotate - [select for diffs], Wed Aug 17 15:15:26 2022 UTC (21 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.432: +7 -7 lines
Diff to previous 1.432 (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.432 / (download) - annotate - [select for diffs], Thu Jul 28 13:11:51 2022 UTC (22 months ago) by deraadt
Branch: MAIN
Changes since 1.431: +12 -12 lines
Diff to previous 1.431 (colored)

whitespace found during a read-thru; ok claudio

Revision 1.431 / (download) - annotate - [select for diffs], Mon Jul 18 13:56:41 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.430: +4 -8 lines
Diff to previous 1.430 (colored)

Remove warning messages that add nothing in the situation they occure.

If the RDE dies this is logged before but the error messages from
imsg_rde() may be called a couple of times before the SE has a chance
to exit.
OK tb@

Revision 1.430 / (download) - annotate - [select for diffs], Mon Jun 27 13:26:51 2022 UTC (23 months ago) by claudio
Branch: MAIN
Changes since 1.429: +73 -9 lines
Diff to previous 1.429 (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.429 / (download) - annotate - [select for diffs], Thu Jun 23 13:09:03 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.428: +10 -10 lines
Diff to previous 1.428 (colored)

Move struct kif from bgpd.h to kroute.c

The only user of struct kif was the session engine for the 'depend on'
feature. Switch the imsg exchange to a new struct session_dependon and
rename the IMSG as well.
OK tb@

Revision 1.428 / (download) - annotate - [select for diffs], Sun Jun 19 10:30:10 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.427: +5 -17 lines
Diff to previous 1.427 (colored)

Implement a applymask() function that works on bgpd_addr structs.
Use this function in kroute so that kroute_find and kroute6_find can switch
to use struct bgpd_addr as argument.
OK tb@

Revision 1.427 / (download) - annotate - [select for diffs], Wed Feb 23 11:20:35 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.426: +2 -2 lines
Diff to previous 1.426 (colored)

Make it possible to bind and connect to non-default ports. This is mainly
for testing. Using alternate ports does not work for session using ipsec.
OK tb@ deraadt@

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

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

Revision 1.425 / (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.424: +6 -4 lines
Diff to previous 1.424 (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.424 / (download) - annotate - [select for diffs], Fri Sep 3 07:48:24 2021 UTC (2 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.423: +11 -5 lines
Diff to previous 1.423 (colored)

Add add-path support in MRT dumps (RFC8050).

This works for table-v2 formats and also for the all and update dumps.
For the latter the code needs to inspect the UPDATE message to guess if
add-path is used in that message or not.  Add-path can be enabled per
AFI and alters the NLRI encoding without any way to detect.
For table dumps we decided to dump RIB_GENERIC entires the same way as
gobgp and not use the encoding from the RFC. The RFC specifies that
RIB_GENERIC (non-IPv4/v6) entries in a way that is not only different
but also against the normal codeflow. Only gobgp seems to implement
RIB_GENERIC encoding (neither bird nor frr/quagga do) and so it makes
sense to follow their way.

OK benno@

Revision 1.423 / (download) - annotate - [select for diffs], Tue Jul 27 07:14:31 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.422: +74 -36 lines
Diff to previous 1.422 (colored)

Implement RFC9072: Extended Optional Parameters Length for BGP OPEN Message

This allows to send more then 255 bytes of optional parameters. With this
it is possible to send more capabilities. bgpd will switch automatically
to the new extended lenght format if needed but by default the old 1 byte
param length encoding is used to keep compatible with old systems.

OK benno@

Revision 1.422 / (download) - annotate - [select for diffs], Thu Jun 24 09:26:18 2021 UTC (2 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.421: +3 -3 lines
Diff to previous 1.421 (colored)

Fix add-path capability encoding, the length was not correctly calculated
because it included two extra bytes (copy-paste error from graceful restart).

Revision 1.421 / (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.420: +24 -2 lines
Diff to previous 1.420 (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.420 / (download) - annotate - [select for diffs], Thu May 27 09:15:51 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.419: +3 -3 lines
Diff to previous 1.419 (colored)

Use negotiated capabilities to decide if a ROUTE-REFRESH message can be
sent (and also for which AFI/SAFI). Use a slightly better way to write
return if neither route-refresh nor enhanced route-refresh are on.

Revision 1.419 / (download) - annotate - [select for diffs], Thu May 27 09:10:03 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.418: +2 -2 lines
Diff to previous 1.418 (colored)

Use correct RFC number in comment

Revision 1.418 / (download) - annotate - [select for diffs], Thu May 27 08:27:48 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.417: +202 -31 lines
Diff to previous 1.417 (colored)

bgpd(8) will soon support ADD-PATH (RFC7911) and enhanced route refresh
(RFC7313). This is the frist step toward this.

It adds the capability parsers for the two no capabilities, extends the
capability struct and adds the capability negotiation bits.
The route refresh message parser and generator are extended to support
the BoRR and EoRR message. Also add the new NOTIFICATION type and subtype
for the route refresh message.

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

Fix bad logic in last commit. If graceful restart is on and the forwarding
state is preserved do the graceful restart dance. If graceful restart is off
or the forwarding state was not preserved flush the table.

Revision 1.416 / (download) - annotate - [select for diffs], Thu May 27 07:52:54 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.415: +13 -34 lines
Diff to previous 1.415 (colored)

Improve graceful restart capability handling.

Announce only the graceful restart capability header but do not include any
AFI / SAFI pairs. bgpd does not preserve its forwarding state over restarts
and only implements the "Procedures for the Receiving Speaker".

When calculating the negotiated capabilities do not override the peer
capabilities (AFI / SAFI bits), just make sure the negotiated bits are
cleared. With this the peer capabilities are properly shown in bgpctl.

Revision 1.415 / (download) - annotate - [select for diffs], Sun May 16 09:09:11 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.414: +22 -13 lines
Diff to previous 1.414 (colored)

Capabilities are only supported on a session when both sides announce
that capability. Change capa_neg_calc() to check always both the
ann(ounce) and peer capa struct to figure out what was negotiated.
This change affects route refersh and graceful restart (where before
setting the capability in the config to 'no' would not fully disable
the feature).
Also ignore and warn about unexpected route refresh messages.
OK benno@

Revision 1.414 / (download) - annotate - [select for diffs], Thu May 6 09:18:54 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.413: +26 -7 lines
Diff to previous 1.413 (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.413 / (download) - annotate - [select for diffs], Mon May 3 14:08:09 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.412: +5 -4 lines
Diff to previous 1.412 (colored)

When negotiating multiprotocol capabilities only fall ack to AID_INET when
no capability was sent to the peer (this happens if the multiprotocol
capability got disabled). It is possible that local and remote systems end
up with no shared AFI/SAFI pair. In this case the connection will not send
or should not receive any UPDATE messages.
The previous behaviour of falling back to AID_INET in that case can result
in problematic behaviour when sessions are missconfigured.
OK benno@, deraadt@

Revision 1.412 / (download) - annotate - [select for diffs], Tue Apr 27 09:12:23 2021 UTC (3 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.411: +11 -1 lines
Diff to previous 1.411 (colored)

Check for possible bgpid collision on open. RFC 6286 defines that this
check needs to be done for iBGP sessions but not for eBGP sessions.
On conflict log an error and send a notification with ERR_OPEN_BGPID
suberror.
Reported by cjt (melissa_cjt at 163.com)
OK benno@

Revision 1.411 / (download) - annotate - [select for diffs], Tue Feb 16 08:29:16 2021 UTC (3 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.410: +3 -1 lines
Diff to previous 1.410 (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.410 / (download) - annotate - [select for diffs], Tue Jan 5 10:02:44 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.409: +2 -2 lines
Diff to previous 1.409 (colored)

It is safe to call addr2sa with a bgpd_addr NULL pointer

Revision 1.409 / (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.408: +2 -1 lines
Diff to previous 1.408 (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.408 / (download) - annotate - [select for diffs], Tue Dec 29 09:49:04 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.407: +10 -6 lines
Diff to previous 1.407 (colored)

getifaddrs() can return entries where ifa_addr is NULL. Check for this
before accessing anything in ifa_addr.
OK florian@

Revision 1.407 / (download) - annotate - [select for diffs], Wed Dec 23 13:20:47 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.406: +14 -1 lines
Diff to previous 1.406 (colored)

BGP uses KEEPALIVE packets and the HOLD timer to detect stalled sessions.
The problem is that this timer only looks at the receive side of the TCP
session. If for some reason the send side stalls the system fully depends
on the remote BGP peer to reset the session. As seen in an ever growing
OutQ and as a result important changes can get stalled and cause routing
troubles.

This change introduces a SEND HOLD timer. The timer is reset whenever the
session engine was able to write data to the TCP socket. If the send hold
timer expires bgpd was not able to send any data to that neighbor for at
least 90 seconds and therefor the session is forcefully closed with a hold
timer expired notification.

The send hold timer acts as a last resort to detect faulty peers. On an
idle session it can take a long time until this timer triggers but the
main goal here is to reset a stuck session at some point which did not
happen before.

With and OK job@

Revision 1.406 / (download) - annotate - [select for diffs], Fri Dec 11 12:00:01 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.405: +59 -51 lines
Diff to previous 1.405 (colored)

Make the timer code independent of struct peer this way it can be used
in other places as well.
ok procter@

Revision 1.405 / (download) - annotate - [select for diffs], Thu Nov 5 14:44:59 2020 UTC (3 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.404: +6 -5 lines
Diff to previous 1.404 (colored)

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

Revision 1.404 / (download) - annotate - [select for diffs], Thu Nov 5 11:52:59 2020 UTC (3 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.403: +2 -3 lines
Diff to previous 1.403 (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.403 / (download) - annotate - [select for diffs], Thu Nov 5 11:28:11 2020 UTC (3 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.402: +6 -11 lines
Diff to previous 1.402 (colored)

Refactor the control code to be more like a module.
Change control_dispatch_msg() to return the change of control connection
count since the return value was not used before.
Add control_fill_pfds() to replace the TAILQ_FOREACH loop in session.c.
This allows to move the ctl_conns symbol to control.c (from session.h
where it caused issues when compiled with -fno-common).
OK benno@

Revision 1.402 / (download) - annotate - [select for diffs], Sat Jun 27 07:24:42 2020 UTC (3 years, 11 months ago) by bket
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.401: +3 -7 lines
Diff to previous 1.401 (colored)

Replace TAILQ concatenation loop with TAILQ_CONCAT

OK claudio@

Revision 1.401 / (download) - annotate - [select for diffs], Sun May 10 13:38:46 2020 UTC (4 years ago) by deraadt
Branch: MAIN
Changes since 1.400: +20 -20 lines
Diff to previous 1.400 (colored)

In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')
to be more generic,  then change 'reload' to take take a '[reason]' also,
which will be logged by bgpd.
ok kn claudio

Revision 1.400 / (download) - annotate - [select for diffs], Thu Apr 23 16:13:11 2020 UTC (4 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.399: +12 -3 lines
Diff to previous 1.399 (colored)

Store local-address by address family. This allows to configure both
an IPv4 and IPv6 local-address on a group and the neighbors bind to the
right local-address. Also implement 'no local-address' to reset a previously
set local address back to zero. This should help with IBGP and multihop
session config and hopefully reduce repetition in bgpd configs.
OK sthen@ benno@

Revision 1.399 / (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.398: +73 -2 lines
Diff to previous 1.398 (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.398 / (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.397: +10 -4 lines
Diff to previous 1.397 (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.397 / (download) - annotate - [select for diffs], Tue Jan 21 11:12:06 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.396: +5 -1 lines
Diff to previous 1.396 (colored)

Add last_rcvd_errcode and last_rcvd_suberr to the peer_stats so that
not only sent errors can be reported but also received ones.
OK denis@ deraadt@

Revision 1.396 / (download) - annotate - [select for diffs], Thu Jan 9 11:51:18 2020 UTC (4 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.395: +6 -5 lines
Diff to previous 1.395 (colored)

Convert last_updown and last_read from time(3) to use getmonotime()
which returns clock_gettime(2) with CLOCK_MONOTONIC. While doing that
introduce last_write for symetry.
OK denis@

Revision 1.395 / (download) - annotate - [select for diffs], Wed Oct 2 08:57:00 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.394: +3 -3 lines
Diff to previous 1.394 (colored)

When removing a peer do the RB_REMOVE last and log the removal just before
that.
OK benno@

Revision 1.394 / (download) - annotate - [select for diffs], Tue Oct 1 11:05:30 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.393: +13 -3 lines
Diff to previous 1.393 (colored)

Add some TCP MD5SUM specific calls needed by protable. On Linux systems
there is no pfkey interface and instead the loading is done via setsockopts.
To make this work correctly there are some additional functions needed when
peers get reconfigured or when new listeners show up.
OK benno@

Revision 1.393 / (download) - annotate - [select for diffs], Tue Oct 1 09:03:43 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.392: +4 -4 lines
Diff to previous 1.392 (colored)

Use the peer list from the right struct bgpd_config. Don't use the global
conf here eventhough it is the same.
OK benno@

Revision 1.392 / (download) - annotate - [select for diffs], Tue Oct 1 08:59:43 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.391: +1 -2 lines
Diff to previous 1.391 (colored)

Remove leftover pfkey_remove() call in session.c this code was moved to
the parent and the SE no longer has the pfkey socket open.
OK benno@

Revision 1.391 / (download) - annotate - [select for diffs], Mon Sep 30 12:10:38 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.390: +2 -2 lines
Diff to previous 1.390 (colored)

Pass a struct listen_addr pointer to tcp_md5_listen and not just the fd,
the linux shim needs this.

Revision 1.390 / (download) - annotate - [select for diffs], Tue Aug 13 12:13:26 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.389: +5 -8 lines
Diff to previous 1.389 (colored)

Do not use the SE global conf struct for the bgpd_config but actually
the bgpd_config pointer passed to these functions. Luckily the affected
functions were not used outside of the SE. While there also use
getpeerbyid() to check if an peer id is in use instead of the rather
dumb linear loop.
OK benno@

Revision 1.389 / (download) - annotate - [select for diffs], Mon Aug 12 14:15:27 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.388: +5 -13 lines
Diff to previous 1.388 (colored)

Change the way IdleHoldTime is reset once the session is up and stable.
The implemented reverse exponential backoff results in very long times
until a session gets back to the initial hold values. Instead just wait
for the timer to fire once and reset the settings then. In most cases
the timer is double the IdleHold time (because of the way the backoff
is implemented) which is enough to ensure that fast flapping sessions
are punished.
OK benno@

Revision 1.388 / (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.387: +1 -2 lines
Diff to previous 1.387 (colored)

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

Revision 1.387 / (download) - annotate - [select for diffs], Fri Jun 28 09:14:36 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.386: +4 -2 lines
Diff to previous 1.386 (colored)

Reset rpending (read pending) indicator for a peer when the peer goes down
and the read buffer is cleared. Also make sure that the poll timeout is
only reduced to 0 if rpending is set and the read buffer has data to process.
This should fix a problem within the SE causing it to spin with a poll
timeout of 0.
OK phessler@

Revision 1.386 / (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.385: +2 -2 lines
Diff to previous 1.385 (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.385 / (download) - annotate - [select for diffs], Mon Jun 17 21:17:04 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.384: +9 -5 lines
Diff to previous 1.384 (colored)

A bit more KNF no binary change

Revision 1.384 / (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.383: +3 -3 lines
Diff to previous 1.383 (colored)

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

Revision 1.383 / (download) - annotate - [select for diffs], Mon Jun 17 11:02:20 2019 UTC (4 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.382: +2 -1 lines
Diff to previous 1.382 (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.382 / (download) - annotate - [select for diffs], Mon May 27 09:14:33 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.381: +37 -27 lines
Diff to previous 1.381 (colored)

Switch the peer TAILQ to a RB tree indexed by the peer id. This way
getpeerbyid() gets a lot quicker at finding the peer when many peers
are configured. In my test case the difference is around 20% runtime.
OK denis@

Revision 1.381 / (download) - annotate - [select for diffs], Fri May 24 11:37:52 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.380: +5 -3 lines
Diff to previous 1.380 (colored)

Change timer_nextisdue() and timer_nextduein() to take the current time
as an argument. This way getmonotime() can be called once at the start
of looping over all peers instead of twice during the loop.
Makes a big difference with many peers.
OK florian@ sthen@

Revision 1.380 / (download) - annotate - [select for diffs], Wed May 8 12:41:55 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.379: +21 -66 lines
Diff to previous 1.379 (colored)

Rework the TCP md5sig and IKE handling. Move the pfkey socket to the parent
process in this process. The refreshing of the keys is done whenever the
session state is changes to state IDLE or ACTIVE. This should behave better
when reloading configs with auth changes.
OK benno@

Revision 1.379 / (download) - annotate - [select for diffs], Thu Apr 25 12:12:16 2019 UTC (5 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.378: +12 -11 lines
Diff to previous 1.378 (colored)

Extend maximum message size of the shutdown communication to 255 bytes.
See also draft-snijders-idr-rfc8203bis-01.
OK job@

Revision 1.378 / (download) - annotate - [select for diffs], Sun Apr 7 10:52:30 2019 UTC (5 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.377: +11 -12 lines
Diff to previous 1.377 (colored)

Be more careful when setting timeout to 0 because there is pending work
on a peer. Just checking the peer read buffer size is not enough since
the data present could be a partial message and so the SE should sleep
until a new POLLIN event fires. Adjust the logic by adding a rpending
flag that is only set if reading the session buffer was exited early
because MSG_PROCESS_LIMIT was hit.
OK benno@

Revision 1.377 / (download) - annotate - [select for diffs], Sun Mar 31 16:57:38 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.376: +97 -123 lines
Diff to previous 1.376 (colored)

Move the struct peer into bgpd_config and switch it to a TAILQ instead of
the hand-rolled list. This changes the way peers are reloaded since now
both parent and session engine are now merging the lists.
OK denis@

Revision 1.376 / (download) - annotate - [select for diffs], Fri Mar 15 09:54:54 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.375: +1 -12 lines
Diff to previous 1.375 (colored)

Set all default values in init_config in parse.y and remove the special
ones in session.c. Adjust printconfig a bit to only show non default values
and move mrt_mergeconfig into merge_conifg where it kind of belongs.
OK benno@

Revision 1.375 / (download) - annotate - [select for diffs], Thu Mar 7 07:42:36 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.374: +9 -32 lines
Diff to previous 1.374 (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.374 / (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.373: +13 -12 lines
Diff to previous 1.373 (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.373 / (download) - annotate - [select for diffs], Mon Feb 18 09:43:57 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.372: +13 -11 lines
Diff to previous 1.372 (colored)

Do not depend on the length field of struct sockaddr instead pass the
length to the various functions needing it. Helps portability.
OK benno@

Revision 1.372 / (download) - annotate - [select for diffs], Fri Feb 15 11:38:06 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.371: +2 -24 lines
Diff to previous 1.371 (colored)

Move the depend on state calculation from session.c to kroute.c. This
helps making the code more portable.
OK sthen@

Revision 1.371 / (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.370: +32 -15 lines
Diff to previous 1.370 (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.370 / (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.369: +5 -3 lines
Diff to previous 1.369 (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.369 / (download) - annotate - [select for diffs], Sat Sep 29 07:58:06 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.368: +7 -1 lines
Diff to previous 1.368 (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.368 / (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.367: +7 -5 lines
Diff to previous 1.367 (colored)

whitespace cleanup, ok claudio@

Revision 1.367 / (download) - annotate - [select for diffs], Wed Sep 19 13:09:30 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.366: +46 -32 lines
Diff to previous 1.366 (colored)

Wrap sending imsg to the RDE in a function and make sure that the ibuf
to the RDE is valid. The SE is stopping all sessions on exit and so
session_stop() is called which will send an imsg to the RDE which is no
longer there. Instead of fixing just one call fix all. Now the SE should
no longer crash when the RDE crashes.
OK sthen@

Revision 1.366 / (download) - annotate - [select for diffs], Tue Sep 4 12:00:29 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.365: +8 -7 lines
Diff to previous 1.365 (colored)

Introduce inet4applymask() which does the same as inet6applymask() and
can be used instead of doing direct fiddling around with struct in_addr.
Use it in a few cases where it makes the code more similar between INET
and INET6 case.
OK denis@

Revision 1.365 / (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.364: +2 -1 lines
Diff to previous 1.364 (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.364 / (download) - annotate - [select for diffs], Mon May 29 14:22:51 2017 UTC (7 years ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.363: +23 -3 lines
Diff to previous 1.363 (colored)

fix "depend on" when carp interface goes from MASTER into state INIT
aka UNKNOWN.
ok claudio@ phessler@ and henning helped along too

Revision 1.363 / (download) - annotate - [select for diffs], Sun May 28 20:10:59 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.362: +17 -18 lines
Diff to previous 1.362 (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.362 / (download) - annotate - [select for diffs], Sun May 28 12:21:36 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.361: +15 -13 lines
Diff to previous 1.361 (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.361 / (download) - annotate - [select for diffs], Sat May 27 10:33:15 2017 UTC (7 years ago) by phessler
Branch: MAIN
Changes since 1.360: +5 -5 lines
Diff to previous 1.360 (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.360 / (download) - annotate - [select for diffs], Fri May 26 20:55:30 2017 UTC (7 years ago) by phessler
Branch: MAIN
Changes since 1.359: +17 -1 lines
Diff to previous 1.359 (colored)

AS 0 is special and should be considered an error.

Drop the session if it shows during OPEN or CAPA, or mark as invalid if
it is part of an Update.

required by RFC 7607

man page OK jmc@
OK florian@ benno@ claudio@

Revision 1.359 / (download) - annotate - [select for diffs], Mon Feb 13 14:48:44 2017 UTC (7 years, 3 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.358: +6 -4 lines
Diff to previous 1.358 (colored)

draft-ietf-idr-shutdown extends to support a message on either of
"Administrative Shutdown" or "Administrative Reset"

patch submitted by Job Snijders, thanks!

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: +7 -5 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], Fri Jan 13 18:59:12 2017 UTC (7 years, 4 months ago) by phessler
Branch: MAIN
Changes since 1.356: +50 -2 lines
Diff to previous 1.356 (colored)

Add support for draft-ietf-idr-shutdown

    BGP state = Idle, marked down with shutdown reason "goodbye, we are
    upgrading to openbsd 6.1", down for 00:00:17

developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!

OK benno@

Revision 1.356 / (download) - annotate - [select for diffs], Mon Dec 19 07:19:55 2016 UTC (7 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.355: +13 -11 lines
Diff to previous 1.355 (colored)

In parse_header() not all of the bgp message may be in the buffer yet so
move the MRT msg dump to session_process_msg() after the point the full
message is in the read buffer.
Bug found and fix tested by Ian Bobbitt

Revision 1.355 / (download) - annotate - [select for diffs], Sun Dec 18 17:15:07 2016 UTC (7 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.354: +2 -2 lines
Diff to previous 1.354 (colored)

Correct logic, make it the same as in the other mrt_dump_bgp_msg case.
Found while looking for something else.

Revision 1.354 / (download) - annotate - [select for diffs], Sat Sep 3 16:22:17 2016 UTC (7 years, 8 months ago) by renato
Branch: MAIN
Changes since 1.353: +18 -7 lines
Diff to previous 1.353 (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.353 / (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.352: +4 -2 lines
Diff to previous 1.352 (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.352 / (download) - annotate - [select for diffs], Mon Aug 8 21:44:00 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.351: +2 -2 lines
Diff to previous 1.351 (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.351 / (download) - annotate - [select for diffs], Mon Jul 25 14:29:28 2016 UTC (7 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.350: +4 -1 lines
Diff to previous 1.350 (colored)

Initialize the log subsytem in the SE like it is done in the RDE. Without
this all logging is going via stderr to /dev/null which is not helpful.
OK deraadt@ phessler@

Revision 1.350 / (download) - annotate - [select for diffs], Thu Jul 21 10:13:58 2016 UTC (7 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.349: +11 -1 lines
Diff to previous 1.349 (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.349 / (download) - annotate - [select for diffs], Tue Jun 28 16:59:14 2016 UTC (7 years, 11 months ago) by jca
Branch: MAIN
Changes since 1.348: +10 -7 lines
Diff to previous 1.348 (colored)

Use IPV6_MINHOPCOUNT to finish implementing ttl-security for IPv6.

ok renato@ deraadt@

Revision 1.348 / (download) - annotate - [select for diffs], Mon Jun 6 15:59:10 2016 UTC (7 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.347: +2 -2 lines
Diff to previous 1.347 (colored)

Add format attributes to the proper functions and then fix the warning in
session.c
ok mpi@

Revision 1.347 / (download) - annotate - [select for diffs], Fri Nov 20 23:26:08 2015 UTC (8 years, 6 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.346: +1 -3 lines
Diff to previous 1.346 (colored)

bgpd has been naughty. It tries to play with AF_UNIX sockets without
pledging "unix".
Move control_listen up to the main process which already has
pledge("unix"). accept(2) was already allowed.

(Technically no longer necessary since listen(2) is now allowed, too,
but this moves it to the right place.)

OK claudio@, deraadt@

Revision 1.346 / (download) - annotate - [select for diffs], Tue Nov 17 09:15:21 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.345: +6 -4 lines
Diff to previous 1.345 (colored)

in the SE, loosing the pipe to the main process can be handled with a
normal shutdown of sessions and exit. no need for fatal().

ok henning@ phessler@ florian@ happy deraadt@

Revision 1.345 / (download) - annotate - [select for diffs], Sun Oct 25 18:49:01 2015 UTC (8 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.344: +8 -4 lines
Diff to previous 1.344 (colored)

Rename imsg_compose_parent and imsg_compose_rde to imsg_ctl_parent and
imsg_ctl_rde since these function should only be used by the control
code. Also switch ibuf_rde to ibuf_rde_ctl so that the control imsgs
don't need to queue behind all the incoming bgp UPDATES. This speeds
up 'bgpctl show' from taking minutes to a few seconds. The RDE was doing
this since a very long time but it seems the SE was not adjusted. Yikes

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

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

Revision 1.343 / (download) - annotate - [select for diffs], Wed Oct 7 20:25:22 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.342: +2 -2 lines
Diff to previous 1.342 (colored)

use fatal() instead of err(); from benno

Revision 1.342 / (download) - annotate - [select for diffs], Tue Oct 6 15:39:44 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.341: +2 -2 lines
Diff to previous 1.341 (colored)

Move from tame "cmsg" to tame "sendfd" or "recvfd", depending on which
way the process moves fd's.

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

tame "stdio inet cmsg" should work well in the session engine.
ok benno

Revision 1.340 / (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.339: +4 -4 lines
Diff to previous 1.339 (colored)

Give more precise errors, to help track when bgpd quits

OK florian@ benno@ sthen@ deraadt@

Revision 1.339 / (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.338: +76 -87 lines
Diff to previous 1.338 (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.338 / (download) - annotate - [select for diffs], Mon Feb 9 11:37:31 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.337: +6 -27 lines
Diff to previous 1.337 (colored)

Kill session_socket_blockmode() and replace it with SOCK_CLOEXEC or
SOCK_NONBLOCK and accept4(). OK henning@ tested & OK benno@

Revision 1.337 / (download) - annotate - [select for diffs], Thu Dec 4 19:55:49 2014 UTC (9 years, 5 months ago) by sthen
Branch: MAIN
Changes since 1.336: +2 -2 lines
Diff to previous 1.336 (colored)

replace an overlapping memcpy with memmove, ok deraadt tedu

Revision 1.336 / (download) - annotate - [select for diffs], Sat Oct 25 03:23:49 2014 UTC (9 years, 7 months ago) by lteo
Branch: MAIN
Changes since 1.335: +1 -2 lines
Diff to previous 1.335 (colored)

Remove unnecessary netinet/in_systm.h include.

ok millert@

Revision 1.335 / (download) - annotate - [select for diffs], Wed Oct 8 16:15:37 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.334: +7 -7 lines
Diff to previous 1.334 (colored)

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

Revision 1.334 / (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_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.333: +15 -16 lines
Diff to previous 1.333 (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.333 / (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.332: +6 -6 lines
Diff to previous 1.332 (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.332 / (download) - annotate - [select for diffs], Wed Jul 10 15:56:06 2013 UTC (10 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.331: +6 -19 lines
Diff to previous 1.331 (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.331 / (download) - annotate - [select for diffs], Thu May 30 20:29:27 2013 UTC (11 years ago) by florian
Branch: MAIN
Changes since 1.330: +3 -6 lines
Diff to previous 1.330 (colored)

When removing "dump (all|updates)" from bgpd.conf and reloading, tell
the session engine to actually stop logging.
Found the hard way by benno@.

with & ok benno@
input & ok claudio@

Revision 1.330 / (download) - annotate - [select for diffs], Thu May 30 10:13:58 2013 UTC (11 years ago) by sthen
Branch: MAIN
Changes since 1.329: +17 -2 lines
Diff to previous 1.329 (colored)

Add partial support to bgpd for the ttl hack with ipv6. This sends the correct
ttl on outgoing packets so peer sessions can come up correctly if both sides
use ttl-security, but the kernel side is not yet implemented so incoming
packets aren't verified (note added to manual for this). ok henning@

Revision 1.326.2.1 / (download) - annotate - [select for diffs], Wed May 1 09:39:02 2013 UTC (11 years, 1 month ago) by sthen
Branch: OPENBSD_5_3
Changes since 1.326: +5 -6 lines
Diff to previous 1.326 (colored) next main 1.327 (colored)

MFC: handle ECONNABORTED errors from accept().  In many code blocks they
can be ignored silently and without aborting, much like EINTR and EWOULDBLOCK
are.

This is http://ftp.openbsd.org/pub/OpenBSD/patches/5.3/common/001_bgpd.patch:
"A rare condition during session startup may cause bgpd to replace an
active session leading to unknown consequences. Bug found by inspection
(we do not know how to reproduce it, consider that a challenge)."

Revision 1.323.2.1 / (download) - annotate - [select for diffs], Sat Mar 23 15:43:47 2013 UTC (11 years, 2 months ago) by deraadt
Branch: OPENBSD_5_2
Changes since 1.323: +5 -6 lines
Diff to previous 1.323 (colored) next main 1.324 (colored)

from HEAD:
handle ECONNABORTED errors from accept().  In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are.
ok's from various maintainers of these directories...  as well, bgpd had
a more serious error -- it proceeded on certain accept() errors..

Revision 1.329 / (download) - annotate - [select for diffs], Wed Mar 20 04:01:42 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.328: +2 -2 lines
Diff to previous 1.328 (colored)

less includes

Revision 1.328 / (download) - annotate - [select for diffs], Mon Mar 11 17:40:11 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.327: +5 -6 lines
Diff to previous 1.327 (colored)

handle ECONNABORTED errors from accept().  In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are.
ok's from various maintainers of these directories...

Revision 1.327 / (download) - annotate - [select for diffs], Thu Mar 7 21:26:28 2013 UTC (11 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.326: +74 -20 lines
Diff to previous 1.326 (colored)

Implements a few missing bits for better templates support:
- on config reload also adjust the cloned neighbors so that they get the
  config changes as well.
- clean up sessions that are 1h idle but in state active (instead of down)
- add bits to allow bgpctl to destroy cloned neighbors
Tested by sthen@ some time ago, OK phessler@

Revision 1.326 / (download) - annotate - [select for diffs], Sat Dec 1 10:35:17 2012 UTC (11 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE
Branch point for: OPENBSD_5_3
Changes since 1.325: +26 -20 lines
Diff to previous 1.325 (colored)

The capability parser should only return an error in extreme cases. If a
particular capability is bad, log the fact and ignore it. This may give us
a chance to bring up session that have e.g. unexpected AFI,SAFI pairs in them.
Also make the error messages more user friendly.
OK henning@, sthen@

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

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

Revision 1.324 / (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.323: +288 -20 lines
Diff to previous 1.323 (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.323 / (download) - annotate - [select for diffs], Wed Jul 11 09:43:10 2012 UTC (11 years, 10 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE
Branch point for: OPENBSD_5_2
Changes since 1.322: +7 -5 lines
Diff to previous 1.322 (colored)

Limit "while(setsockopt(..SO_RCVBUF/SO_SNDBUF..))" loops to prevent them
running away if the setsockopt call fails, as may happen if a peer bounces
at the wrong time.

OK claudio@ after tweaks to an earlier version which was OK phessler@.

Revision 1.322 / (download) - annotate - [select for diffs], Mon Jul 9 11:11:07 2012 UTC (11 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.321: +82 -64 lines
Diff to previous 1.321 (colored)

Fix the handling of the message read buf with regard to MSG_PROCESS_LIMIT.
The read buffer was only processed when new data came in. So on quiet
sessions it could take minutes until the read buffer was processed at the
end of a load. Nobody realized this in the last 7.5 years.
Tested by sthen@ OK henning@

Revision 1.321 / (download) - annotate - [select for diffs], Thu Apr 12 17:26:09 2012 UTC (12 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.320: +32 -10 lines
Diff to previous 1.320 (colored)

accept() pacing for bgpd based on similar work done on other daemons.
OK henning@ sthen@

Revision 1.320 / (download) - annotate - [select for diffs], Fri Jan 6 17:33:11 2012 UTC (12 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.319: +2 -2 lines
Diff to previous 1.319 (colored)

typo in log_peer_warnx message

Revision 1.319 / (download) - annotate - [select for diffs], Sat Jul 9 02:51:18 2011 UTC (12 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.318: +1 -10 lines
Diff to previous 1.318 (colored)

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

Revision 1.318 / (download) - annotate - [select for diffs], Mon Jul 4 04:34:14 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.317: +2 -4 lines
Diff to previous 1.317 (colored)

LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does
the right job.
OK deraadt@ henning@

This needs a -current kernel or link state may be not reported correctly.

Revision 1.317 / (download) - annotate - [select for diffs], Thu May 5 06:21:44 2011 UTC (13 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.316: +7 -8 lines
Diff to previous 1.316 (colored)

ibuf_add returns 0 or -1. adding up the return values in errs and then
checking errs > 0 is not going to work... also make errs signed in 2 cases
triggered by Milosz Jakubowski <milosz.jakubowski at gmail.com> pointing out
a few cases, diff written from scratch to cover all of them. unsigned errs
noticed by sthen. ok claudio sthen

Revision 1.316 / (download) - annotate - [select for diffs], Thu Dec 23 17:41:40 2010 UTC (13 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.315: +10 -1 lines
Diff to previous 1.315 (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.315 / (download) - annotate - [select for diffs], Thu Dec 9 13:50:41 2010 UTC (13 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.314: +15 -5 lines
Diff to previous 1.314 (colored)

The PF_KEY socket is like the routing socket. It must be polled all the
time to consume broadcasted messages or the socket gets full and own
messages that are needed are lost. This fixes an infinit loop in
pfkey_reply that happens when bgpd tcp md5sum is used on a system that
also runs a larger IPsec setup.
OK henning, lot of patience, debuging and testing by Thomas Boernert

Revision 1.314 / (download) - annotate - [select for diffs], Thu Nov 18 12:51:24 2010 UTC (13 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.313: +4 -2 lines
Diff to previous 1.313 (colored)

Log sent notification messages as well having them in the log may
help to figure out the cause of flapping session faster.
OK henning@ sthen@

Revision 1.310.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.310: +2 -2 lines
Diff to previous 1.310 (colored) next main 1.311 (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.313 / (download) - annotate - [select for diffs], Wed Nov 10 15:14:36 2010 UTC (13 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.312: +2 -2 lines
Diff to previous 1.312 (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.312 / (download) - annotate - [select for diffs], Fri Oct 15 07:45:32 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.311: +7 -4 lines
Diff to previous 1.311 (colored)

Add the FSM suberrors specified in draft-ietf-idr-fsm-subcode. This
should help identifying FSM errors since the state is know known.
OK henning@ sthen@

Revision 1.311 / (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.310: +3 -3 lines
Diff to previous 1.310 (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.310 / (download) - annotate - [select for diffs], Sun Jun 27 19:53:34 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE
Branch point for: OPENBSD_4_8
Changes since 1.309: +25 -11 lines
Diff to previous 1.309 (colored)

Instead of specifying the control sockets on the command line have them
in bgpd.conf. This allows to add/modify restricted control sockets on runtime.
Feature request by a few people how often forgot to add -r path when restarting
bgpd (including myself).
NOTE: this removes the -s and -r arguments from bgpd so pay attention when
updateing.
jajaja sthen@, OK henning@

Revision 1.309 / (download) - annotate - [select for diffs], Wed May 26 13:56:07 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.308: +46 -46 lines
Diff to previous 1.308 (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.308 / (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.307: +5 -4 lines
Diff to previous 1.307 (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.307 / (download) - annotate - [select for diffs], Fri Apr 16 12:24:25 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.306: +1 -2 lines
Diff to previous 1.306 (colored)

Memory allocated with calloc() is initialized to zero, no need to do that
explicitly.

Revision 1.306 / (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.305: +1 -3 lines
Diff to previous 1.305 (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.305 / (download) - annotate - [select for diffs], Thu Feb 11 22:05:59 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.304: +2 -2 lines
Diff to previous 1.304 (colored)

Not knowing a AFI/SAFI pair in the MP capability is no reason to fail
a session. Just print a warning and move on since both side need to
announce a pair to use it. Found and OK sthen@

Revision 1.304 / (download) - annotate - [select for diffs], Tue Jan 5 08:49:57 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.303: +8 -2 lines
Diff to previous 1.303 (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.303 / (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.302: +23 -47 lines
Diff to previous 1.302 (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.302 / (download) - annotate - [select for diffs], Tue Dec 8 14:03:40 2009 UTC (14 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.301: +104 -62 lines
Diff to previous 1.301 (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.301 / (download) - annotate - [select for diffs], Thu Dec 3 19:27:20 2009 UTC (14 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.300: +2 -1 lines
Diff to previous 1.300 (colored)

Stop the IdleHold timer when going to idle state. This makes it a bit
more clear that going to idle state will stop everything and it is
necessary to start the IdleHold timer to restart sessions. OK henning@

Revision 1.300 / (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.299: +71 -147 lines
Diff to previous 1.299 (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.299 / (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.298: +11 -3 lines
Diff to previous 1.298 (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.298 / (download) - annotate - [select for diffs], Tue Sep 22 14:07:53 2009 UTC (14 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.297: +25 -23 lines
Diff to previous 1.297 (colored)

Update capability code to follow RFC 5492. Unlike before multiple
capabilities are now encoded in a single capability option.
RFC conforming BGP implementations must be able to parse both the old
and the new way of the encoding (most still seem to use the old one).
bgpd still accepts both ways on reception. OK henning, sthen

Revision 1.297 / (download) - annotate - [select for diffs], Thu Sep 3 09:06:20 2009 UTC (14 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.296: +2 -2 lines
Diff to previous 1.296 (colored)

Use correct destination in memcpy(). Fixes PR6218, OK henning

Revision 1.296 / (download) - annotate - [select for diffs], Wed Sep 2 08:06:42 2009 UTC (14 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.295: +23 -13 lines
Diff to previous 1.295 (colored)

Implement all of RFC 4486 BGP Cease Notification Message Subcodes.
The other side should now see why a session was dropped. e.g:
bgpd: ... received notification: Cease, administratively down
OK henning

Revision 1.295 / (download) - annotate - [select for diffs], Fri Aug 21 15:43:27 2009 UTC (14 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.294: +10 -7 lines
Diff to previous 1.294 (colored)

Fix for PR6213, peers with 4-byte AS numbers were unable to connect to a
template neighbor because the AS was set before the 4-byte one was parsed.
While there force enforce neighbor-as to no for iBGP peers.
Found and fix tested by Matthias Cramer (cramer (at) swissix.ch)
OK henning@, sthen@

Revision 1.294 / (download) - annotate - [select for diffs], Fri Jul 24 13:09:29 2009 UTC (14 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.293: +2 -2 lines
Diff to previous 1.293 (colored)

RECONF_REINIT is a bad initial reconf_action state for templates.
getpeerbyip() initializes the full peer and so there is no need to
do the work a second time -- especially since there it was already
in the wrong state resulting in strange behaviour. OK henning@

Revision 1.293 / (download) - annotate - [select for diffs], Sun Jun 7 05:56:24 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.292: +3 -3 lines
Diff to previous 1.292 (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.292 / (download) - annotate - [select for diffs], Sat Jun 6 06:33:15 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
Changes since 1.291: +2 -8 lines
Diff to previous 1.291 (colored)

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

ok claudio@ pyr@

Revision 1.291 / (download) - annotate - [select for diffs], Thu Jun 4 04:46:42 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.290: +9 -3 lines
Diff to previous 1.290 (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.290 / (download) - annotate - [select for diffs], Wed May 27 04:18:21 2009 UTC (15 years ago) by reyk
Branch: MAIN
Changes since 1.289: +8 -6 lines
Diff to previous 1.289 (colored)

add an option to change the "connect-retry" timer which defaults to 120s.
this can be used to decrease the failover time in specific carp'ed
IBGP setups.

ok henning@

Revision 1.289 / (download) - annotate - [select for diffs], Thu Mar 19 07:00:07 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.288: +4 -4 lines
Diff to previous 1.288 (colored)

First big chunk of mrt rewrite. Simplifies code hopefully and fixes table
dumps that were wrong because of the 4byte AS support. Dumps I took seemed
to work so far. "Put it in" henning@

Revision 1.288 / (download) - annotate - [select for diffs], Wed Mar 18 19:49:31 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.287: +13 -14 lines
Diff to previous 1.287 (colored)

Correctly check the peer group for mrt dumps. Without this all non-grouped
peers ended up in most mrt dumps. Also switch the if-statements to a hopefully
easier to read version. Another mrt fix from my flight home.
OK henning@

Revision 1.287 / (download) - annotate - [select for diffs], Wed Mar 18 19:39:27 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.286: +2 -5 lines
Diff to previous 1.286 (colored)

short_as is always initialised to the 16bit AS that is used. So no need
use conf->as as source for > 16bit AS numbers. OK henning.

Revision 1.286 / (download) - annotate - [select for diffs], Fri Mar 13 05:43:51 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.285: +8 -8 lines
Diff to previous 1.285 (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.285 / (download) - annotate - [select for diffs], Fri Mar 13 04:40:55 2009 UTC (15 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.284: +2 -4 lines
Diff to previous 1.284 (colored)

Sync buffer API with the one from ospfd. The dynamic buffers will make other
code much easier to write. OK henning@ some time ago.

Revision 1.284 / (download) - annotate - [select for diffs], Thu Sep 11 14:49:58 2008 UTC (15 years, 8 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.283: +10 -12 lines
Diff to previous 1.283 (colored)

remove hackery to un-demote after the session has been established for
a while, we can now just use a timer (since i rewrote the timer code)

Revision 1.283 / (download) - annotate - [select for diffs], Fri Sep 5 10:38:12 2008 UTC (15 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.282: +9 -11 lines
Diff to previous 1.282 (colored)

ignore unknown SAFIs in the MP capabilities. used by some to distribute
some kind of VPN stuff

Revision 1.282 / (download) - annotate - [select for diffs], Thu Jun 26 00:01:51 2008 UTC (15 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.281: +2 -2 lines
Diff to previous 1.281 (colored)

fatalx instead of fatal because errno is not set of pipe is closed. OK henning

Revision 1.281 / (download) - annotate - [select for diffs], Thu May 8 07:43:02 2008 UTC (16 years ago) by henning
Branch: MAIN
Changes since 1.280: +33 -21 lines
Diff to previous 1.280 (colored)

take advantage of the timewheel: instead of checking each an every
timer, just get the first off the queue and check wether it is due

Revision 1.280 / (download) - annotate - [select for diffs], Thu May 8 06:52:13 2008 UTC (16 years ago) by henning
Branch: MAIN
Changes since 1.279: +3 -1 lines
Diff to previous 1.279 (colored)

change timer internals so that we use a timewheel (tailq, sorted by expiry
so that the timer that will expire first is always the first element,
and so on). will make the checking a bit faster and moreelegant and more
conveniant. ok claudio

Revision 1.279 / (download) - annotate - [select for diffs], Sun Dec 23 18:56:17 2007 UTC (16 years, 5 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.278: +11 -23 lines
Diff to previous 1.278 (colored)

provide timer_nextduein, which provides the number of seconds until the
next timer expires.
use that in the session engine's mainloop, which simplifies it and
removes the last bits of timer internals knowledge from anywhere outside
timer.c.

Revision 1.278 / (download) - annotate - [select for diffs], Sun Dec 23 16:42:45 2007 UTC (16 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.277: +2 -3 lines
Diff to previous 1.277 (colored)

use timer_running (with left = NULL, which the last commit made possible)
instead of timer_get and checking manually

Revision 1.277 / (download) - annotate - [select for diffs], Thu Dec 20 17:08:48 2007 UTC (16 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.276: +54 -62 lines
Diff to previous 1.276 (colored)

rework timers.
stop changing tienmr values directly, always use new
timer_(get/set/stop/running) functions. preparation for more to come :)
ok claudio

Revision 1.276 / (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.275: +2 -1 lines
Diff to previous 1.275 (colored)

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

``yeah that is good'' henning@

Revision 1.275 / (download) - annotate - [select for diffs], Tue May 29 02:27:05 2007 UTC (17 years ago) by claudio
Branch: MAIN
Changes since 1.274: +7 -7 lines
Diff to previous 1.274 (colored)

Correctly encode the End-of-RIB marker capability. It is just 2 bytes not
4. OK henning@

Revision 1.274 / (download) - annotate - [select for diffs], Tue May 15 14:47:36 2007 UTC (17 years ago) by claudio
Branch: MAIN
Changes since 1.273: +3 -3 lines
Diff to previous 1.273 (colored)

draft-ietf-idr-restart -> RFC 4724 and bump draft-ietf-idr-as4bytes to
version 13.

Revision 1.273 / (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.272: +53 -18 lines
Diff to previous 1.272 (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.272 / (download) - annotate - [select for diffs], Wed Mar 28 11:53:48 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.271: +2 -2 lines
Diff to previous 1.271 (colored)

IPv6 ttl setting via IPV6_HOPLIMIT no longer works. Switch to
IPV6_UNICAST_HOPS which does the same thing and does not fail.
OK henning@ found by Jon Morby

Revision 1.271 / (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.270: +5 -5 lines
Diff to previous 1.270 (colored)

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

Revision 1.270 / (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, OPENBSD_4_1
Changes since 1.269: +5 -4 lines
Diff to previous 1.269 (colored)

KNF

Revision 1.269 / (download) - annotate - [select for diffs], Thu Feb 22 08:26:45 2007 UTC (17 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.268: +3 -3 lines
Diff to previous 1.268 (colored)

do not try to set IP_TTL on non-INET listening sockets, it's not going
to work on INET6...
non-fatal error, so in pratice this just avoids a misleading error msg

Revision 1.268 / (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.267: +31 -6 lines
Diff to previous 1.267 (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.267 / (download) - annotate - [select for diffs], Tue Jan 23 17:41:22 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.266: +3 -3 lines
Diff to previous 1.266 (colored)

Typo in fatal() message found by dunceor @ gmail dot com

Revision 1.266 / (download) - annotate - [select for diffs], Tue Dec 5 12:08:13 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.265: +31 -3 lines
Diff to previous 1.265 (colored)

implement the ttl security hack. since the pc slaves fear the word hack,
they call it "Generalized TTL Security Mechanism" officially, RFC 3682.
manpage with help from jmc

Revision 1.265 / (download) - annotate - [select for diffs], Tue Nov 28 19:21:15 2006 UTC (17 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.264: +2 -2 lines
Diff to previous 1.264 (colored)

add additional link states to report the half duplex / full duplex
state, if known by the driver. this is required to check the full
duplex state without depending on the ifmedia ioctl which can't be
called in the kernel without process context.

ok henning@, brad@

Revision 1.264 / (download) - annotate - [select for diffs], Mon Nov 6 14:07:35 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.263: +2 -2 lines
Diff to previous 1.263 (colored)

fix pasto; only announce restart capability when announcing the restart
capability is enabled, not when annoucing the refresh capability is
enabled...
Alex Hunsaker <badalex@gmail.com> ran into that issue

Revision 1.263 / (download) - annotate - [select for diffs], Tue Sep 19 13:04:01 2006 UTC (17 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.262: +22 -49 lines
Diff to previous 1.262 (colored)

make buffer_grow always return a valid struct buf; the contained buffer
might be NULL on realloc failure tho. all users check buffer size before
using the buffer, so this is not a problem.
makes error handling much easier. ease the capabilities code big time.
claudio ok

Revision 1.262 / (download) - annotate - [select for diffs], Sun Aug 27 16:57:19 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.261: +2 -2 lines
Diff to previous 1.261 (colored)

in the restart capability (that we do not actually send yet), set the
MSB in the first byte, not the LSB to indicate the peer must not wait
before sending us updates

Revision 1.261 / (download) - annotate - [select for diffs], Sun Aug 27 16:19:18 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.260: +2 -2 lines
Diff to previous 1.260 (colored)

fix a small logic botch in session_accept() in the fast reconnect logic,
to check wether a session was put in IDLE manually by the operator or
by bgpd itself as result of a fatal session error we were looking at the
wrong timer, claudio ok

Revision 1.260 / (download) - annotate - [select for diffs], Sun Aug 27 16:11:05 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.259: +25 -1 lines
Diff to previous 1.259 (colored)

add code to announce the restart capability according to
draft-ietf-idr-restart. Do not announce actual restart capabilities,
so that this only serves as indicator that we are capable of sending
and receiving the End-of-RIB marker.
leave disabled for now, since the code to actually send the EoR-marker
is currently ifdef'd out (to be fixed soon) and we wanna play safe for
4.0. and juniper doesn't support that capability (which is not a problem
per se) and at the same time has its capability negotiation code completely
fucked up, if a capability is rejected they don't indicate WHICH capability
they reject (which makes that a problem, tho still a small one and we cope).
claudio ok

Revision 1.259 / (download) - annotate - [select for diffs], Sun Aug 27 14:00:15 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.258: +2 -1 lines
Diff to previous 1.258 (colored)

missing htons() in session_rrefresh()
no surprise sending route refresh requests didn't work on my i386 routers,
i think I originally hacked & tested this on sparc64

Revision 1.258 / (download) - annotate - [select for diffs], Sun Aug 27 13:44:03 2006 UTC (17 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.257: +69 -38 lines
Diff to previous 1.257 (colored)

change how we advertise capabilities.
we used to put all capability attributes into one optional attribute. this
is legal.
I recentlu observed that basically all other implementations use one
optional attribute per capability attribute. this difference might explain
why we - in some cases - saw "unsupoorted capabiliy" notifications from
neighbors without the capability in question in the data part. of course
that makes capability negotiation a little hard...
so switch us to use one optional attribute per capability as well, and
ease the code a bit while there, claudio ok

Revision 1.257 / (download) - annotate - [select for diffs], Fri Aug 4 12:01:48 2006 UTC (17 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.256: +5 -1 lines
Diff to previous 1.256 (colored)

add "restart" to max-prefix, allows sessions suspended due to reaching
max-prefix to be restarted automagically after a given number of minutes
requested by "Sylwester S. Biernacki" <obeer@obeer.com>, manpage help jmc,
ok claudio

Revision 1.256 / (download) - annotate - [select for diffs], Sun Jul 30 16:27:28 2006 UTC (17 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.255: +2 -2 lines
Diff to previous 1.255 (colored)

there's a nasty little race condition when the neigbor reached max-prefix
and at the same time there is messages from him in the socket buffer,
because we process the imsgs from the RDE (which tells us max-prefix was
reached) first, and put the session to IDLE, close connection and
deallocate buffers. if we then try to read from the socket and write to the
deallocated buffer we crash, of course. so check wether we have a buffer
before reading.
crash seen and fix tested by "Sylwester S. Biernacki" <obeer@obeer.com>

Revision 1.255 / (download) - annotate - [select for diffs], Fri Jul 28 15:04:34 2006 UTC (17 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.254: +134 -190 lines
Diff to previous 1.254 (colored)

factor out the code to build bgp messages, ok claudio a long time ago

Revision 1.254 / (download) - annotate - [select for diffs], Sun Jun 18 13:54:34 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.253: +2 -2 lines
Diff to previous 1.253 (colored)

fix a comment

Revision 1.253 / (download) - annotate - [select for diffs], Sun Jun 18 13:54:01 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.252: +2 -1 lines
Diff to previous 1.252 (colored)

make cloned sessions appear with RECONF_REINIT so they are treated like
peers added at runtime

Revision 1.252 / (download) - annotate - [select for diffs], Sat Jun 17 14:06:09 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.251: +51 -3 lines
Diff to previous 1.251 (colored)

implement carp demotion control for bgpd.
sessions can be configured to modify the carp demotion counter for a
given interface group (usually, "carp", which has all carp interfaces)
when the session is not established. once the session is established for
60 seconds, the demotion is cleared.
this, used correctly, can prevent a bgpd-box which lost all sessions (and
thus has no routes) to be carp master, while the backup has sessions.
thought through and partially hacked on a drive from calgary to vancouver
with ryan, ok claudio

Revision 1.251 / (download) - annotate - [select for diffs], Mon Jun 12 12:45:14 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.250: +4 -4 lines
Diff to previous 1.250 (colored)

in session_setup_socket(), to take address family dependent action
(set v4 TTL/v6 hoplimit, v4 TOS), do not look at remote sockaddr's af,
since that is not set at the first connection attempt yet. instead, use
the configured remote address' af.
problem spotted & my fix tested by Leen Besselink <leen@consolejunkie.net>

Revision 1.250 / (download) - annotate - [select for diffs], Sat Jun 10 16:32:38 2006 UTC (17 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.249: +3 -2 lines
Diff to previous 1.249 (colored)

back in the dark age, carp interfaces were very strange - and we had to
detect them looking at their name, beginning with carp.
these days, we can just check for the iftype to be IFT_CARP.
wanted to do this for some time and kept forgetting. from the airplane over two
weeks ago, forgotten in a secondary tree again...

Revision 1.249 / (download) - annotate - [select for diffs], Sat May 27 21:24:36 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.248: +2 -1 lines
Diff to previous 1.248 (colored)

Pass a IMSG_CTL_RESULT messgae back to bgpctl on reloads to indicate if
the reload was successful or not. OK henning@

Revision 1.248 / (download) - annotate - [select for diffs], Sat May 27 15:43:13 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.247: +3 -4 lines
Diff to previous 1.247 (colored)

Cleanup with lint. Make the poll fd indexes unsigned and because of that
control_accept should also return a unsigned int. Remove old prototype.

Revision 1.247 / (download) - annotate - [select for diffs], Tue May 23 12:11:38 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.246: +68 -1 lines
Diff to previous 1.246 (colored)

allow bgpd to request a route refresh from a neighbor if that neighbor
announced route refresh capabilities

Revision 1.246 / (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.245: +2 -1 lines
Diff to previous 1.245 (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.245 / (download) - annotate - [select for diffs], Wed Mar 15 11:33:42 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.244: +2 -2 lines
Diff to previous 1.244 (colored)

Allow the control socket to be changed on the command line. Useful if you
need to run multiple bgpds on a single box to simulate a IX. This helped
me massivly debugging error reports. OK henning@

Revision 1.244 / (download) - annotate - [select for diffs], Wed Feb 8 12:36:29 2006 UTC (18 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.243: +2 -2 lines
Diff to previous 1.243 (colored)

fix logic both in the decision when to re-init the capabilities negotiation
structures

Revision 1.243 / (download) - annotate - [select for diffs], Tue Jan 24 10:08:16 2006 UTC (18 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.242: +4 -3 lines
Diff to previous 1.242 (colored)

missing space in error message, and make it slightly betterer while there

Revision 1.242 / (download) - annotate - [select for diffs], Tue Jan 24 10:03:44 2006 UTC (18 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.241: +20 -7 lines
Diff to previous 1.241 (colored)

introduce a second control socket, which is restricted to certain messages,
nameley the show ones. needed for looking glass style applications,
monitoring etc. claudio ok

Revision 1.241 / (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.240: +2 -1 lines
Diff to previous 1.240 (colored)

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

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

Plug some mem leaks.

Revision 1.239 / (download) - annotate - [select for diffs], Thu Dec 8 15:55:26 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.238: +2 -2 lines
Diff to previous 1.238 (colored)

When parsing open messages enforce that the optional parameter length is
equal to the size of the rest of the message and not only enforcing that
no overflow happens. Found via regress test. OK henning@

Revision 1.238 / (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.237: +1 -26 lines
Diff to previous 1.237 (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.237 / (download) - annotate - [select for diffs], Wed Oct 19 10:42:06 2005 UTC (18 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.236: +5 -2 lines
Diff to previous 1.236 (colored)

new keyword "down" in neighbor spec, when givenm, the session is not
started on bgpd startup but stays in IDLE. requested by claudio

Revision 1.236 / (download) - annotate - [select for diffs], Wed Oct 19 09:36:51 2005 UTC (18 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.235: +3 -2 lines
Diff to previous 1.235 (colored)

only allow connects in IDLE when the ConnectRetryTimer is running, aka
we intend to reconnect. fallout from fast reconnect. misbehaviour noticed
by claudio

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

let "bgpctl network show" print v6 addresses correctly

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

implement fast reconnects
when a peer drops to IDLE, we have to force him in IDLE for some time to
prevent fast flapping. however, the forced idle time is annoying when the
connection could be re-established immediately, i. e. bgpctl nei $peer clear
or similar.
implement an error counter per peer, increased every time we receive a
notification. when we are in state IDLE and get a connection from the peer
in question, check if the error counter is 1 or smaller. if so, change state
to active and accept the connection, otherwise keep the current behaviour
and reject the connection.
the error counter gets scaled back by the IdleHoldResetTimer that scales the
IdleHoldTime back as well

Revision 1.233 / (download) - annotate - [select for diffs], Thu Sep 8 10:46:40 2005 UTC (18 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.232: +8 -5 lines
Diff to previous 1.232 (colored)

fix reloads where capbilities change
when a new peer in initialized, the configured capailities are copied.
this copy is modified as part of the capabilities negotiation.
now if teh session drops we want to re-negotiate capabilities at the next
establishment, last not least because the configured capabilities might
have changed in between (that's how I stumbled over it, added v6 shitz)
so copy the configured capabilities over every time a session goes to
IDLE state, unless the reason is EVNT_RCVD_OPEN, because then we're in
capabilities negotiation.

Revision 1.232 / (download) - annotate - [select for diffs], Sun Jul 24 11:56:37 2005 UTC (18 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.231: +2 -2 lines
Diff to previous 1.231 (colored)

we must start the ConnectRetry timer before calling session_connect in
all cases, since session_connect can in turn cause events that cause
state changes in the FSM that reset the ConnectRetryTimer.
debugged with Leen Besselink <leen@consolejunkie.net> who was seeing
errnously running ConnectRetryTimers in a case with localhost connections

Revision 1.231 / (download) - annotate - [select for diffs], Mon Jul 18 11:51:54 2005 UTC (18 years, 10 months ago) by dlg
Branch: MAIN
Changes since 1.230: +69 -70 lines
Diff to previous 1.230 (colored)

fix a block that was indented too far.

ok claudio@, king bula sez ok

Revision 1.230 / (download) - annotate - [select for diffs], Mon Jul 18 11:41:15 2005 UTC (18 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.229: +6 -3 lines
Diff to previous 1.229 (colored)

minor nits in session.c, add an additional nconf == NULL check and switch
some fatal()s to fatalx(). All done by dlg@. OK henning@

Revision 1.229 / (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.228: +4 -4 lines
Diff to previous 1.228 (colored)

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

Revision 1.228 / (download) - annotate - [select for diffs], Thu Jun 16 18:43:07 2005 UTC (18 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored)

use prefixlen2mask() instead of doing the bitshifting by hand; fixes the
zero prefixlen case (32 bit shift on 32 bit val -> undefined result)
spotted by Moritz Grimm and otto

Revision 1.227 / (download) - annotate - [select for diffs], Thu Jun 9 12:31:38 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.226: +6 -2 lines
Diff to previous 1.226 (colored)

If there is a problem to connect to a remote peer, do the same log damping
as for other errors. Save the errno and only print a message if the errno
changed. So the log is not filled with "socket error: Connection refused"
when the peer is not yet listening on that address.  OK henning@

Revision 1.226 / (download) - annotate - [select for diffs], Sat Jun 4 23:31:21 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.225: +16 -2 lines
Diff to previous 1.225 (colored)

when the max-prefix limit was exceeded generate a STOP event; we do not
want the session to be restarted automagically in that case.

Revision 1.225 / (download) - annotate - [select for diffs], Sat Jun 4 23:14:32 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.224: +10 -1 lines
Diff to previous 1.224 (colored)

call the FSM with a CON_FATAL event after sending notifications in the cases
where it was missing so that we actually close the connection

Revision 1.224 / (download) - annotate - [select for diffs], Sat Jun 4 22:58:03 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.223: +6 -2 lines
Diff to previous 1.223 (colored)

do not send out suberrorcodes for cease errors; there are none in the
standard

Revision 1.223 / (download) - annotate - [select for diffs], Sat Jun 4 22:54:22 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.222: +3 -0 lines
Diff to previous 1.222 (colored)

use the recorded error code to prevent sending out multiple notifications

Revision 1.222 / (download) - annotate - [select for diffs], Sat Jun 4 22:50:20 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.221: +7 -1 lines
Diff to previous 1.221 (colored)

when sending out a notification record the error code and suberror code in
the peer stats struct, and clear them as soon as the session leaves IDLE

Revision 1.221 / (download) - annotate - [select for diffs], Sat Jun 4 07:07:34 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.220: +2 -1 lines
Diff to previous 1.220 (colored)

relay IMSG_CTL_KROUTE6 as well, from somewhere in BC on the drive to vancouver

Revision 1.220 / (download) - annotate - [select for diffs], Thu Jun 2 15:07:02 2005 UTC (19 years ago) by cloder
Branch: MAIN
Changes since 1.219: +2 -2 lines
Diff to previous 1.219 (colored)

Use the correct pointer when printing out the error message. OK henning

Revision 1.219 / (download) - annotate - [select for diffs], Tue May 24 17:30:37 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.218: +2 -2 lines
Diff to previous 1.218 (colored)

KNF

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

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

Revision 1.217 / (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.216: +3 -3 lines
Diff to previous 1.216 (colored)

setres[ug]id; ok claudio@

Revision 1.216 / (download) - annotate - [select for diffs], Wed Mar 30 11:23:15 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.215: +15 -16 lines
Diff to previous 1.215 (colored)

bgpd used to open listeners in advance in the parent and the SE picked
those it needed, closing all the others. this has some nasty races.
so let the parent keep the list of listeners so it knows when it has
to open a new one
claudio ok, also tested by jason ackley

Revision 1.215 / (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.214: +2 -2 lines
Diff to previous 1.214 (colored)

ewps, this was not supposed to creep in

Revision 1.214 / (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.213: +2 -2 lines
Diff to previous 1.213 (colored)

free rules_l if the initial config file parse fails

Revision 1.213 / (download) - annotate - [select for diffs], Fri Mar 11 17:46:11 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.212: +3 -12 lines
Diff to previous 1.212 (colored)

shutdown() directly before close() is useless, theo

Revision 1.212 / (download) - annotate - [select for diffs], Thu Dec 23 17:34:04 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.211: +16 -6 lines
Diff to previous 1.211 (colored)

in getpeerbydesc(), complain if we find more than one match and return NULL

Revision 1.211 / (download) - annotate - [select for diffs], Thu Dec 23 17:24:03 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.210: +13 -1 lines
Diff to previous 1.210 (colored)

introduce getpeerbydesc(), find a peer by its description

Revision 1.210 / (download) - annotate - [select for diffs], Thu Dec 23 15:15:55 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.209: +4 -2 lines
Diff to previous 1.209 (colored)

lower latency by processing no more than 25 messages at once for each peer

Revision 1.209 / (download) - annotate - [select for diffs], Tue Dec 7 17:19:09 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.208: +3 -1 lines
Diff to previous 1.208 (colored)

oups, little FSM error: when we're in CONNECT and get an CON_OPEN event
initialize and start the holdtimer, just like when we're in state ACTIVE.

Revision 1.208 / (download) - annotate - [select for diffs], Tue Nov 23 13:07:01 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.207: +31 -4 lines
Diff to previous 1.207 (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.207 / (download) - annotate - [select for diffs], Thu Nov 18 17:17:56 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.206: +13 -11 lines
Diff to previous 1.206 (colored)

embed two struct capabilities, one for the capas announced by the peer and
one for the capas we announced him, into the session_up imsg to the RDE
after brainstorming with claudio

Revision 1.206 / (download) - annotate - [select for diffs], Thu Nov 18 17:07:38 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.205: +4 -5 lines
Diff to previous 1.205 (colored)

add an instance of struct capabilities to peer_conf, and inherit
peer->capa.ann from this

Revision 1.205 / (download) - annotate - [select for diffs], Thu Nov 18 16:38:05 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.204: +21 -21 lines
Diff to previous 1.204 (colored)

inside struct peer, replace the occurance of the older struct peer_capa
by two instances of the new struct capabilities, one for announcements
and one for the received capabilities

Revision 1.204 / (download) - annotate - [select for diffs], Thu Nov 18 16:30:05 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.203: +29 -20 lines
Diff to previous 1.203 (colored)

remove the global 'announce' flag from struct peer_capa, clear
individual capability flags where needed

Revision 1.203 / (download) - annotate - [select for diffs], Thu Nov 18 15:42:59 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.202: +11 -9 lines
Diff to previous 1.202 (colored)

let peer->capa.mp_[v4|v6] contain the SAFI, don't just use it as bool

Revision 1.202 / (download) - annotate - [select for diffs], Thu Nov 18 15:24:24 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.201: +28 -40 lines
Diff to previous 1.201 (colored)

introduce session_capa_mp() which adds the multiprotocol announcements
to OPEN messages. eases session_open() quite a bit and kills duplicate code
claudio ok

Revision 1.201 / (download) - annotate - [select for diffs], Thu Nov 18 14:59:50 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.200: +35 -13 lines
Diff to previous 1.200 (colored)

add code to announce support for IPv6 Unicast.
disabled for now, claudio ok

Revision 1.200 / (download) - annotate - [select for diffs], Thu Nov 18 14:10:36 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.199: +4 -2 lines
Diff to previous 1.199 (colored)

supress logging of subsequent connect() failures as long as:
-the session alternates between Active and Connect. Other states reset logging
-the error is the same as the last connect() error seen
jajajaja claudio

Revision 1.199 / (download) - annotate - [select for diffs], Thu Nov 11 16:56:08 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.198: +2 -1 lines
Diff to previous 1.198 (colored)

Unbreak link local IPv6 sessions by setting the correct scope_id in
addr2sa. OK henning@

Revision 1.198 / (download) - annotate - [select for diffs], Wed Nov 10 14:48:25 2004 UTC (19 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.197: +2 -3 lines
Diff to previous 1.197 (colored)

"not reached" does not help LINT use NOTREACHED instead and use it only in
places where needed. OK henning@

Revision 1.197 / (download) - annotate - [select for diffs], Tue Nov 2 10:56:48 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.196: +4 -3 lines
Diff to previous 1.196 (colored)

save the previous state in struct peer, claudio ok

Revision 1.196 / (download) - annotate - [select for diffs], Tue Oct 19 12:02:50 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.195: +35 -3 lines
Diff to previous 1.195 (colored)

allow neighbor definitions to depend on interface state.
with this, if a neighbor is configured as dependent on carp0 for example,
the neighbor will remain in state IDLE as long as carp0 is not master.
once carp0 becomes master the session(s) depending on it immediately
go to CONNECT (or ACTIVE, if they're configured passive), reducing failover
time. claudio ok, with some input from ryan as well

Revision 1.195 / (download) - annotate - [select for diffs], Thu Oct 7 13:39:14 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.194: +11 -12 lines
Diff to previous 1.194 (colored)

use a static, const and prefilled u_int8_t[16] to check wether the marker
at the beginning of each BGP message is all 1s instead of looping and
comparing one by one

Revision 1.194 / (download) - annotate - [select for diffs], Tue Oct 5 11:47:41 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.193: +4 -4 lines
Diff to previous 1.193 (colored)

reject an all zero bgpid, following a similar suggestion from
pascal.gloor@spale.com

Revision 1.193 / (download) - annotate - [select for diffs], Wed Sep 22 08:46:28 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.192: +14 -22 lines
Diff to previous 1.192 (colored)

don't bother shrinking the pfd and index2peer arrays
ok claudio

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

when a cloned peer goes back to IDLE state, don't remove him immediately
but keep him around for some more time (an hour here).
fixes an issue Arvid was reporting: when a cloned neighbor rejects our OPEN
message due to capability negotiation (or missing implementation of those),
we set a marker and retry without. However, if we remove the peer immediately,
it gets freshly cloned on the next trial, with default settings, thus including
capability negotiation, and thus failes again.
this will also help with route flap dampening.
ok claudio

Revision 1.191 / (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.190: +7 -7 lines
Diff to previous 1.190 (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.190 / (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.189: +28 -23 lines
Diff to previous 1.189 (colored)

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

Revision 1.189 / (download) - annotate - [select for diffs], Thu Sep 9 21:53:57 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.188: +5 -5 lines
Diff to previous 1.188 (colored)

correctly track peer count. fixes a memory corruption.
exactly the same bug as in ntpd, but caused completely different...
strange issues seen by arvid goetting who helped a lot in debugging,
bug found after an ntpd issue showed up and I saw the relation.
hunting with & ok claudio, otto, millert, ok deraadt

Revision 1.188 / (download) - annotate - [select for diffs], Wed Aug 11 16:48:45 2004 UTC (19 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.187: +7 -7 lines
Diff to previous 1.187 (colored)

mrt dumps for cloned sessions did not work because the wrong address was used.
OK henning@

Revision 1.187 / (download) - annotate - [select for diffs], Wed Aug 11 10:09:30 2004 UTC (19 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.186: +4 -1 lines
Diff to previous 1.186 (colored)

Cleanup on exit. OK henning@

Revision 1.186 / (download) - annotate - [select for diffs], Tue Aug 10 14:06:53 2004 UTC (19 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.185: +1 -6 lines
Diff to previous 1.185 (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.185 / (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.184: +2 -1 lines
Diff to previous 1.184 (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.184 / (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.183: +2 -2 lines
Diff to previous 1.183 (colored)

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

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

fix some typos

ok henning otto

Revision 1.182 / (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.181: +4 -2 lines
Diff to previous 1.181 (colored)

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

Revision 1.181 / (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.180: +112 -47 lines
Diff to previous 1.180 (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.180 / (download) - annotate - [select for diffs], Tue Jun 22 07:58:19 2004 UTC (19 years, 11 months ago) by alexander
Branch: MAIN
Changes since 1.179: +3 -3 lines
Diff to previous 1.179 (colored)

Precedence fix; ok henning@

Revision 1.179 / (download) - annotate - [select for diffs], Tue Jun 22 07:42:41 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.178: +2 -1 lines
Diff to previous 1.178 (colored)

missing bzero in a function for this strange other address family

Revision 1.178 / (download) - annotate - [select for diffs], Tue Jun 22 03:44:26 2004 UTC (19 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.177: +4 -2 lines
Diff to previous 1.177 (colored)

Templates with unknown AS where always configured as ebgp peers even if
they were ibgp ones. OK henning@

Revision 1.177 / (download) - annotate - [select for diffs], Tue Jun 22 03:17:01 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.176: +3 -3 lines
Diff to previous 1.176 (colored)

so we call realloc() on our pollfd array and the peer_l one when they shrunk
to save memory... yet, that realloc call can fail with ENOMEM ;)
don't shrink when (needed + reserve < allocated), but
(needed + 2 * reserve < allocated)
the longer term goal is of course to not fail at all when a shrink-realloc
fails... but that's for later

Revision 1.176 / (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.175: +4 -4 lines
Diff to previous 1.175 (colored)

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

Revision 1.175 / (download) - annotate - [select for diffs], Sun Jun 20 17:49:46 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.174: +21 -43 lines
Diff to previous 1.174 (colored)

implement file descriptor passing in the imsg/msgbuf framework, and use
it to let the main process to prepare new listening sockets (socket() and
bind()) on behalf of the session engine, which of course cannot bind() to
ports < 1024 any more once it dropped privileges. with some help from theo,
claudio ok

Revision 1.174 / (download) - annotate - [select for diffs], Wed Jun 9 13:01:44 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.173: +89 -40 lines
Diff to previous 1.173 (colored)

move to a dynamically allocated struct pollfd array.
we used a ststic one with OPEN_MAX entries, which is a rather arbitary limit
as OPEN_MAX is _not_ the max # of open fds we can have, but just a default
for that setting.
in the same move we have to allocate the peer_l array, basically there
for pfd-index to peer pointers to prevent peer list scans all time,
dynamiccaly to. we overallocate a little and use that reserve until we
have to realloc again later to prevent reallocs for every single control
connection or a single flapping peer.
help & ok claudio

Revision 1.173 / (download) - annotate - [select for diffs], Sun Jun 6 17:38:10 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.172: +192 -56 lines
Diff to previous 1.172 (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.172 / (download) - annotate - [select for diffs], Fri May 28 18:39:09 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.171: +41 -6 lines
Diff to previous 1.171 (colored)

detect absence of PF_KEY interface and/or the TCP_MD5SIG setsockopts
at runtime and disable said subsystems if so. helps the guys porting bgpd
to $otherBSD, and is actually the right thing to do. claudio ok

Revision 1.171 / (download) - annotate - [select for diffs], Fri May 28 16:33:40 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.170: +1 -3 lines
Diff to previous 1.170 (colored)

don't want SO_REUSEPORT...

Revision 1.170 / (download) - annotate - [select for diffs], Fri May 21 11:48:56 2004 UTC (20 years ago) by claudio
Branch: MAIN
Changes since 1.169: +2 -1 lines
Diff to previous 1.169 (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.169 / (download) - annotate - [select for diffs], Sat May 8 11:22:43 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.168: +5 -4 lines
Diff to previous 1.168 (colored)

remove unused argument to control_dispatch_msg(), lint

Revision 1.168 / (download) - annotate - [select for diffs], Thu May 6 14:41:05 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.167: +2 -2 lines
Diff to previous 1.167 (colored)

oups, spaces

Revision 1.167 / (download) - annotate - [select for diffs], Thu May 6 14:07:43 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.166: +4 -2 lines
Diff to previous 1.166 (colored)

the Address Family Identifier field in the capability announcement is
2 octets, thus we need to transform it from/to network byte order...
fixes capability announcement and -parsing

Revision 1.166 / (download) - annotate - [select for diffs], Thu May 6 12:18:02 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.165: +3 -1 lines
Diff to previous 1.165 (colored)

do not punish the peer (by holding him in IDLE for IdleHoldTime seconds) when
receiving a "unsupported capabilities" notification. Speeds capability
negotiation up quite a bit with peers that like to whine about caoabilities
they don't understand

Revision 1.165 / (download) - annotate - [select for diffs], Thu May 6 12:09:25 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.164: +11 -3 lines
Diff to previous 1.164 (colored)

improve logging in teh capabilities parser

Revision 1.164 / (download) - annotate - [select for diffs], Thu May 6 11:57:55 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.163: +15 -1 lines
Diff to previous 1.163 (colored)

scale socket buffer sizes (and thus window size) up to up to 64k,
but only of tcp md5sig or ipsec is in use. excellent idea by ryan some time
ago, claudio and theo agree

Revision 1.163 / (download) - annotate - [select for diffs], Thu May 6 09:11:18 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.162: +4 -1 lines
Diff to previous 1.162 (colored)

there's a little race condition: a session is taken down and its associated
write buffers are cleared, but there could be imsgs from the RDE for that peer
(e. g. UPDATEs) in the read buffers for the pipe to the RDE or buffered in
the RDE or somesuch. Thus, in session_update(), explicitely check for the
session state and just drop the message if the session is not in state
ESTABLISHED.
claudio ok

Revision 1.162 / (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.161: +8 -8 lines
Diff to previous 1.161 (colored)

sock -> fd; ok henning

Revision 1.161 / (download) - annotate - [select for diffs], Wed Apr 28 17:42:27 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.160: +26 -27 lines
Diff to previous 1.160 (colored)

rename sock to fd

Revision 1.160 / (download) - annotate - [select for diffs], Wed Apr 28 06:45:37 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.159: +81 -25 lines
Diff to previous 1.159 (colored)

if a peer follows the extremely misgiuded path that the RFCs just barely allow
to send a NOTIFICATION and thus ternminating the session when it sees a
capability it doesn't support (who would guess: zebra does so), parse the
data section of the notifcication to find out what what capabilties it didn't
like and do not advertise them the next time the session gets up. In case we
get a notification about unsupported capabilities with an empty data part
(don't ask for RFCs... and guess who does that), disable capabilty announcement
alltogether.
claudio ok

Revision 1.159 / (download) - annotate - [select for diffs], Wed Apr 28 00:38:39 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored)

prefix the auth related defines by AUTH_, we had a name clash, markus ok

Revision 1.158 / (download) - annotate - [select for diffs], Tue Apr 27 22:42:13 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.157: +3 -3 lines
Diff to previous 1.157 (colored)

rename the ipsec struct to auth, move all tcpmd5 related fields in there, and
add a generic "method" field that expresses what method
(none/md5sig/ipsec manual/ipsec ike) is in use
markus ok

Revision 1.157 / (download) - annotate - [select for diffs], Tue Apr 27 17:41:34 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.156: +2 -1 lines
Diff to previous 1.156 (colored)

unbreak^2

Revision 1.156 / (download) - annotate - [select for diffs], Tue Apr 27 17:25:52 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.155: +3 -4 lines
Diff to previous 1.155 (colored)

repair

Revision 1.155 / (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.154: +15 -15 lines
Diff to previous 1.154 (colored)

crud stripping; henning ok

Revision 1.154 / (download) - annotate - [select for diffs], Tue Apr 27 04:06:58 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.153: +9 -1 lines
Diff to previous 1.153 (colored)

announce route refresh capability, and parse announced route refresh capa

Revision 1.153 / (download) - annotate - [select for diffs], Tue Apr 27 03:53:43 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.152: +41 -1 lines
Diff to previous 1.152 (colored)

initial route refresh support per RFC2918
process incoming route refresh request and notify the RDE
not advertised via capabilities yet, claudio ok

Revision 1.152 / (download) - annotate - [select for diffs], Mon Apr 26 09:35:39 2004 UTC (20 years, 1 month ago) by markus
Branch: MAIN
Changes since 1.151: +5 -5 lines
Diff to previous 1.151 (colored)

load ipsec SAs into the kernel and enable them.

Revision 1.151 / (download) - annotate - [select for diffs], Mon Apr 26 01:43:13 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.150: +16 -2 lines
Diff to previous 1.150 (colored)

announce multiprotocol capabilities - IPv4 multicast for now
this implies ourgoing capabilities annoucnement is there and just needs the
values to be filled in for other shitz we'll support soonish

Revision 1.150 / (download) - annotate - [select for diffs], Sun Apr 25 23:36:15 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.149: +26 -6 lines
Diff to previous 1.149 (colored)

better error logging in parse_capabilities()

Revision 1.149 / (download) - annotate - [select for diffs], Sun Apr 25 22:31:03 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.148: +3 -3 lines
Diff to previous 1.148 (colored)

sizeof(op_len) when dealing with op_len, not sizeof(op_type) - same size
so noop

Revision 1.148 / (download) - annotate - [select for diffs], Sun Apr 25 19:12:57 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.147: +5 -1 lines
Diff to previous 1.147 (colored)

if remote-as was not configured, inherit the AS from the neighbors open
message for cloned neighbors, claudio ok

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

reserve upper half of the (internal) ID space for cloned neighbors, claudio ok

Revision 1.146 / (download) - annotate - [select for diffs], Sun Apr 25 08:06:00 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.145: +3 -2 lines
Diff to previous 1.145 (colored)

do not kill cloned neighbors on reload, claudio ok

Revision 1.145 / (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.144: +93 -5 lines
Diff to previous 1.144 (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.144 / (download) - annotate - [select for diffs], Sat Apr 24 20:15:49 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.143: +10 -11 lines
Diff to previous 1.143 (colored)

make failure in setting up the listeners non-fatal. should make bgpd work
on inet only kernels again, claudio ok

Revision 1.143 / (download) - annotate - [select for diffs], Sat Apr 24 19:36:19 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.142: +39 -15 lines
Diff to previous 1.142 (colored)

some rather boring windows talk at cansecwest made me hack initial support
for IPv6 transport
parts based on a diff from Brent Graveland
ok itojun@ claudio@

Revision 1.142 / (download) - annotate - [select for diffs], Fri Apr 16 04:52:26 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.141: +17 -8 lines
Diff to previous 1.141 (colored)

let getpeerbyip work for both v4 and v6

Revision 1.141 / (download) - annotate - [select for diffs], Fri Apr 16 04:47:19 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.140: +2 -2 lines
Diff to previous 1.140 (colored)

make log_conn_attempt work in an address family independent matter

Revision 1.140 / (download) - annotate - [select for diffs], Tue Apr 13 22:53:29 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.139: +24 -2 lines
Diff to previous 1.139 (colored)

parse the BGP Multiprotocol Extensions (RFC 2858) capabilities and store in
the peer struct, claudio ok

Revision 1.139 / (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.138: +2 -2 lines
Diff to previous 1.138 (colored)

comment spelling fixes; ok henning@

Revision 1.138 / (download) - annotate - [select for diffs], Thu Mar 18 15:09:31 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.137: +8 -4 lines
Diff to previous 1.137 (colored)

when we are in state CONNECT, i. e. we have a half-open tcp connection
to the peer, and we get a connection from exactly that peer, we used to
refuse it (because we already had a - tho only half-open - connection).
this diff changes that so that the connection request from the neighbor is
preferred in only that specific case, and the existing half-open connection
is teared down.  this can speed up session re-establishment quite a bit,
especially with multihop.
claudio ok

Revision 1.137 / (download) - annotate - [select for diffs], Tue Mar 16 12:06:42 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.136: +5 -1 lines
Diff to previous 1.136 (colored)

delay creating the control socket until after forking, but before chroot
(lives in /var/run, i. e. outside chroot) and privdrop.
claudio ok

Revision 1.136 / (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.135: +4 -3 lines
Diff to previous 1.135 (colored)

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

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

not debugging any more

Revision 1.134 / (download) - annotate - [select for diffs], Thu Mar 11 13:35:05 2004 UTC (20 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.133: +15 -2 lines
Diff to previous 1.133 (colored)

Free unneeded mrt lists in SE and on exit. OK henning@

Revision 1.133 / (download) - annotate - [select for diffs], Wed Mar 10 15:15:48 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.132: +10 -2 lines
Diff to previous 1.132 (colored)

pass a pointer to the network list as well to session_main so we can free()
the members after fork

Revision 1.132 / (download) - annotate - [select for diffs], Wed Mar 10 14:54:11 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.131: +5 -2 lines
Diff to previous 1.131 (colored)

while walking the peer list on shutdown free the peer structs

Revision 1.131 / (download) - annotate - [select for diffs], Wed Mar 10 14:45:25 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.130: +20 -12 lines
Diff to previous 1.130 (colored)

pass a pointer to the filter rule list to session_main() so we can free()
the list entries and the head there after forking

Revision 1.130 / (download) - annotate - [select for diffs], Wed Mar 10 14:29:37 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.129: +6 -1 lines
Diff to previous 1.129 (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.129 / (download) - annotate - [select for diffs], Wed Mar 10 13:45:16 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.128: +1 -15 lines
Diff to previous 1.128 (colored)

remove unused function

Revision 1.128 / (download) - annotate - [select for diffs], Wed Mar 10 11:38:33 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.127: +34 -6 lines
Diff to previous 1.127 (colored)

implement framework to announce capabilities in the open messages we send.
this includes handling "unsupported optional parameter" notifications from the
peer and retrying without capability announcement. claudio ok

Revision 1.127 / (download) - annotate - [select for diffs], Fri Mar 5 21:48:28 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.126: +1 -3 lines
Diff to previous 1.126 (colored)

huch, remove a debug message

Revision 1.126 / (download) - annotate - [select for diffs], Fri Mar 5 20:25:30 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.125: +53 -5 lines
Diff to previous 1.125 (colored)

add a parser for the capability announcements using the OPEN message as per
RFC 3392. we don't support any capability yet but this at least avoids one
session teardown and reestablishment when talking to peers which do support
capability announcement (as in: basically any) and we'll start supporting
some soon.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Mar 5 14:09:55 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.124: +10 -1 lines
Diff to previous 1.124 (colored)

improve logging when we are unhappy with an OPEN message, claudio ok

Revision 1.124 / (download) - annotate - [select for diffs], Fri Mar 5 13:30:01 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.123: +22 -10 lines
Diff to previous 1.123 (colored)

let parse_open() call change_state() on error itself, so that after sending
a notification about disagreement on optional parameters we do not
punish the peer by keeping him in Idle state for IdleHoldTime, rather let
him proceed to Connect immediately again. the "punishment" is of course a flap
protection in the first place. claudio ok

Revision 1.123 / (download) - annotate - [select for diffs], Fri Mar 5 13:19:00 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.122: +53 -4 lines
Diff to previous 1.122 (colored)

implement a parser for the optional attributes in OPEN messages and properly
refuse any if we find them. not refusing means agreement - so we agreed
with our peers on stuff we don't support. oups. claudio ok

Revision 1.122 / (download) - annotate - [select for diffs], Fri Mar 5 13:17:14 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.121: +8 -1 lines
Diff to previous 1.121 (colored)

when a session that had a tcp connection established is pushed back to IDLE,
try to write out what is left in the rite buffers. now notifications do reach
the peer...

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

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

Revision 1.120 / (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.119: +91 -29 lines
Diff to previous 1.119 (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.119 / (download) - annotate - [select for diffs], Sat Feb 21 15:45:14 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.118: +2 -2 lines
Diff to previous 1.118 (colored)

keep O_NONBLOCK after teh tcp sessions are established, claudio ok

Revision 1.118 / (download) - annotate - [select for diffs], Wed Feb 18 00:30:09 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.117: +5 -4 lines
Diff to previous 1.117 (colored)

fix thinko in the revents & (POLLIN|POLLOUT) case

Revision 1.117 / (download) - annotate - [select for diffs], Tue Feb 17 23:55:11 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.116: +5 -7 lines
Diff to previous 1.116 (colored)

improve logging on connection open fail

Revision 1.116 / (download) - annotate - [select for diffs], Tue Feb 17 23:21:21 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

init wbuf.sock too in init_peer()

Revision 1.115 / (download) - annotate - [select for diffs], Tue Feb 17 21:59:09 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.114: +10 -22 lines
Diff to previous 1.114 (colored)

bit better err msgs after buf_close (which can't fail anyway actually)

Revision 1.114 / (download) - annotate - [select for diffs], Tue Feb 17 20:48:05 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

check for EAGAIN after read

Revision 1.113 / (download) - annotate - [select for diffs], Tue Feb 17 15:53:17 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.112: +3 -1 lines
Diff to previous 1.112 (colored)

two more returns; open msg counter might have gotten increased too much

Revision 1.112 / (download) - annotate - [select for diffs], Tue Feb 17 15:47:24 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.111: +2 -1 lines
Diff to previous 1.111 (colored)

On write error return and do not try to make a read. OK henning@

Revision 1.111 / (download) - annotate - [select for diffs], Tue Feb 17 14:40:16 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.110: +3 -1 lines
Diff to previous 1.110 (colored)

init len for getsockname and getpeername, found and ok claudio

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

superfluous tabs

Revision 1.109 / (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.108: +15 -8 lines
Diff to previous 1.108 (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.108 / (download) - annotate - [select for diffs], Mon Feb 2 23:15:00 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.107: +3 -1 lines
Diff to previous 1.107 (colored)

2 missing returns in error pathes
From: Patrick Latifi <pat@eyeo.org>

Revision 1.107 / (download) - annotate - [select for diffs], Sun Feb 1 18:20:59 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.106: +18 -6 lines
Diff to previous 1.106 (colored)

put v6 cruft into session_up() while beeing there... claudio ok

Revision 1.106 / (download) - annotate - [select for diffs], Sat Jan 31 21:09:15 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.105: +7 -8 lines
Diff to previous 1.105 (colored)

rename tcp sockopt TCP_SIGNATURE_ENABLE to TCP_MD5SIG
requested by theo
ok markus@ hshoexer@

Revision 1.105 / (download) - annotate - [select for diffs], Fri Jan 30 11:40:41 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.104: +19 -1 lines
Diff to previous 1.104 (colored)

-enable md5sig on the listening socket
-on connections we just accepted, check wether md5sig is configured for that
peer, and check wether the connection is md5sig'd too. if not, refuse
tested against cisco 7200.

Revision 1.104 / (download) - annotate - [select for diffs], Thu Jan 29 20:38:22 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.103: +10 -2 lines
Diff to previous 1.103 (colored)

enable tcp md5sig om the connecting socket when md5sig is configured for that
peer.
I just successfully established an md5sig'd session against a cisco 7200 with
that.

Revision 1.103 / (download) - annotate - [select for diffs], Wed Jan 28 23:14:21 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.102: +3 -2 lines
Diff to previous 1.102 (colored)

improve logging

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jan 28 22:12:33 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

KNF

Revision 1.101 / (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.100: +3 -1 lines
Diff to previous 1.100 (colored)

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

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

STOP events for all sessions before we exit.
allows for some cleanup to happen, especially we need this to remove
the md5sig flows

Revision 1.99 / (download) - annotate - [select for diffs], Wed Jan 28 18:24:25 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.98: +5 -4 lines
Diff to previous 1.98 (colored)

repair the bind() in session_connect; only used if local-addr was specified
got broken in the sockaddr_in -> bgpd_addr conversion

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jan 28 18:19:32 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.97: +4 -2 lines
Diff to previous 1.97 (colored)

improve logging

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jan 28 17:57:08 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.96: +4 -1 lines
Diff to previous 1.96 (colored)

we need a pfkey_init the gets us a PF_KEY socket before we drop privs
eases other code quite a bit in exchange...

Revision 1.96 / (download) - annotate - [select for diffs], Wed Jan 28 17:29:46 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.95: +6 -1 lines
Diff to previous 1.95 (colored)

call pfkey_auth_establish() on START events
call pfkey_auth_remove when a session drops back to IDLE state

ok markus@ claudio@

Revision 1.95 / (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.94: +55 -10 lines
Diff to previous 1.94 (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.94 / (download) - annotate - [select for diffs], Fri Jan 23 18:06:01 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.93: +13 -6 lines
Diff to previous 1.93 (colored)

make sure to only use the accept()ed connection of there is no other existing
tcp connection for the peer in question, and shutdown & close it otherwise.
add a comment about collision detection.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Jan 23 17:59:28 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.92: +2 -6 lines
Diff to previous 1.92 (colored)

sync comments with reality and properly log accept() errors

Revision 1.92 / (download) - annotate - [select for diffs], Thu Jan 22 20:59:17 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.91: +78 -74 lines
Diff to previous 1.91 (colored)

make log_peer_* take a struct peer_config instead of the session engine
specific struct peer, and move their prototypes to bgpd.h to make it available
to whole bgpd

ok claudio@

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

use log_warnx and log_info. reclassify a few messages in the process and fix
a few messages.

ok claudio@

Revision 1.90 / (download) - annotate - [select for diffs], Thu Jan 22 19:07:34 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.89: +31 -31 lines
Diff to previous 1.89 (colored)

log_peer_err -> log_peer_warn
log_peer_errx -> log_peer_warnx

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jan 22 03:18:04 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored)

s/log_err/log_warn/
it is like warn(3), nor err(3). so use a less confusing name.

Revision 1.88 / (download) - annotate - [select for diffs], Sat Jan 17 18:05:46 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored)

allow the interfaces as bgpd sees 'em to be queried via imsgs

Revision 1.87 / (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.86: +19 -1 lines
Diff to previous 1.86 (colored)

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

Revision 1.86 / (download) - annotate - [select for diffs], Sun Jan 11 20:13:00 2004 UTC (20 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.85: +19 -2 lines
Diff to previous 1.85 (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.85 / (download) - annotate - [select for diffs], Sun Jan 11 18:42:25 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.84: +6 -12 lines
Diff to previous 1.84 (colored)

clean up setting the poll events a bit. no functional changes.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Jan 11 02:35:14 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

new message IMSG_CTL_SHOW_NEXTHOP: request/send lost of BGP nexthops and
the result of their validity check

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jan 11 01:04:43 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.82: +18 -3 lines
Diff to previous 1.82 (colored)

once the tcp session is established use gettsockname/getpeername to get
local/remote sockaddr and store it in the peer struct

ok claudio@

Revision 1.82 / (download) - annotate - [select for diffs], Sat Jan 10 22:25:58 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.81: +1 -3 lines
Diff to previous 1.81 (colored)

re-enable sending outgoing updates

ok claudio@

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jan 10 20:28:48 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.80: +3 -2 lines
Diff to previous 1.80 (colored)

we are only interested in POLLOUT for a session socket when we either
have queued writes or the connection is not yet established - but certainly
not if we ever had a queued write, forever...

ok claudio@

Revision 1.80 / (download) - annotate - [select for diffs], Sat Jan 10 17:50:45 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.79: +4 -1 lines
Diff to previous 1.79 (colored)

disable sending UPDATEs for now; it triggers som blocking bug...

ok & debugging band-aid claudio@

Revision 1.79 / (download) - annotate - [select for diffs], Sat Jan 10 17:10:22 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

i buy a break;

Revision 1.78 / (download) - annotate - [select for diffs], Sat Jan 10 17:04:07 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.77: +73 -6 lines
Diff to previous 1.77 (colored)

send out UPDATE messages to the peer(s) that we receive from the RDE

ok claudio@

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jan 9 19:08:50 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (colored)

for IMSG_CTL_KROUTEs allow matching based on flags,
add IMGS_CTL_KROUTE_ADDR to match the route for a given address

ok claudio@

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jan 9 13:47:08 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.75: +7 -2 lines
Diff to previous 1.75 (colored)

get us a stateful imsg relaying framework, and the first receiver,
IMSG_CTL_KROUTE, to have the kroute structs forming the fib sent to a
control socket.

ok claudio@

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jan 9 13:38:39 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

we must ignore SIGPIPE.
we do notice closed pipes just fine, tho there was at least one case where
we tried a write without POLLOUT and that got us a SIGPIPE before our pipe
closed detection catched it.

ok claudio@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jan 7 01:41:49 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.73: +12 -10 lines
Diff to previous 1.73 (colored)

handle global vs peer-specific holdtime in a nicer and reload-friendlier
way

Revision 1.73 / (download) - annotate - [select for diffs], Wed Jan 7 01:15:54 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.72: +1 -28 lines
Diff to previous 1.72 (colored)

don't try to be smart after config reloads and try to detect wether
a session needs a reinit for the new conf to kick in. the logic is
condemned to fail, and implicitly taking sessions down is BAD.

after discussion with mickey@, ok claudio@

Revision 1.72 / (download) - annotate - [select for diffs], Tue Jan 6 23:14:58 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.71: +1 -2 lines
Diff to previous 1.71 (colored)

two new imsg types, IMSG_CTL_NEIGHBOR_UP and _DOWN, on their receival on the
control socket the given neighbor session is sent a START / STOP signal.

ok claudio@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jan 6 21:48:19 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.70: +12 -22 lines
Diff to previous 1.70 (colored)

initialize new peers inline instead of looping through 'em initing each
before the mainloop started, and a speerate init for those coming in
on reloads. much easier this way.

ok claudio@

Revision 1.70 / (download) - annotate - [select for diffs], Tue Jan 6 20:44:15 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.69: +9 -0 lines
Diff to previous 1.69 (colored)

in session_dispatch_msg, in the loop where we suck the messages out of the
buffers, we need to check wether the buffers are still there before trying to
get the next message. the previous one might have caused the session to drop
back to the IDLE state, which implies that those buffers have been
deallocated.

ok claudio@

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

allow holdtime and holdtime min to be configuered per peer

ok claudio@

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

properly punish oscillating neighbors.
previously we were to forgiving so the punishment didn't kick in as
intended

Revision 1.67 / (download) - annotate - [select for diffs], Tue Jan 6 18:01:26 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.66: +13 -14 lines
Diff to previous 1.66 (colored)

rename our StartTimer to IdleHoldTimer as per draft-ietf-idr-bgp4-23

Revision 1.66 / (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.65: +2 -2 lines
Diff to previous 1.65 (colored)

2004

Revision 1.65 / (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.64: +29 -2 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Sun Jan 4 23:08:09 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.63: +5 -5 lines
Diff to previous 1.63 (colored)

cope with poll error

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jan 4 20:21:07 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

err, on receival of keepalives increase the keepalive counter, not the update
counter...

Revision 1.62 / (download) - annotate - [select for diffs], Sun Jan 4 20:07:30 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.61: +9 -5 lines
Diff to previous 1.61 (colored)

keep seperate message counters for open/update/keepalive/notification

Revision 1.61 / (download) - annotate - [select for diffs], Sun Jan 4 19:39:46 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.60: +13 -1 lines
Diff to previous 1.60 (colored)

-new imsg CTL_RELOAD
-upong receival in the SE forward to parent
-make sending messages from SE to parent work for that (was not required before)
-parent reacts to that just like a SIGHUP, reread config file

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jan 4 18:51:23 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.59: +1 -3 lines
Diff to previous 1.59 (colored)

allow "show neighbor" to be limited to one specific neighbor

Revision 1.59 / (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.58: +2 -2 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Sat Jan 3 22:44:28 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.57: +4 -1 lines
Diff to previous 1.57 (colored)

keep track of last session up/down and last successfull read

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jan 3 22:18:58 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.56: +6 -1 lines
Diff to previous 1.56 (colored)

add message counters

Revision 1.56 / (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.55: +24 -21 lines
Diff to previous 1.55 (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.55 / (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.54: +5 -2 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Thu Jan 1 23:46:47 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.53: +32 -12 lines
Diff to previous 1.53 (colored)

listen on a AF_LOCAL socket for imsgs too.
only implemented type yet is IMSG_CTL_SHOW_NEIGHBOR which sends back
the struct peer for all neighbors.
will be used by bgpdctl

Revision 1.53 / (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.52: +10 -4 lines
Diff to previous 1.52 (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.52 / (download) - annotate - [select for diffs], Tue Dec 30 21:05:09 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.51: +11 -4 lines
Diff to previous 1.51 (colored)

small logic error in session_open/_keepalive/_notification (yes, the same in
all three) after buf_open failure. as this does not happen normally (except
for in out of memory cases) it wasn't noticed.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Dec 30 19:54:23 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.50: +4 -2 lines
Diff to previous 1.50 (colored)

we should not access ressources in a peer strcut 2 lines after we
detected a closed connection which caused an fsm call which causes a
deallocation of said ressources
(that was long for "missing return")

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

no empty default: cases in switch, gcc3 complaints via espie@

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

typos from david

Revision 1.48 / (download) - annotate - [select for diffs], Sun Dec 28 14:34:30 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

redo the imsg readers to use bigger buffers and less read(2)s. should increase
performance even further.
gets rif od struct imsg_readbuf; rename peer_read_buf to read_buf as that
is more appropriate now.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Dec 27 14:28:41 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (colored)

few fatal()s should really be fatalx()
From: Dries Schellekens <gwyllion@ace.ulyssis.org>

Revision 1.46 / (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.45: +15 -7 lines
Diff to previous 1.45 (colored)

let imsg_get and imsg_compose not fatal() but return errors upstream.
make the callers cope.

Revision 1.45 / (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.44: +16 -16 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Fri Dec 26 16:37:04 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.43: +31 -30 lines
Diff to previous 1.43 (colored)

log_err -> log_peer_err
log_errx -> log_peer_errx

because that is what they really are, peer specific.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Dec 25 14:28:49 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.42: +14 -5 lines
Diff to previous 1.42 (colored)

implement "passive": do not attempt to open a tcp connection to the
neighbor system

Revision 1.42 / (download) - annotate - [select for diffs], Thu Dec 25 13:39:00 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.41: +14 -6 lines
Diff to previous 1.41 (colored)

make the listening socket nonblocking as well.
there's a small probability that poll() announces us a new connection on the
listening socket that vanishes before we can call accept(), and thus accept()
would block.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Dec 25 13:17:27 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.40: +1 -1 lines
Diff to previous 1.40 (colored)

small gotcha in the FSM:
if we're in state ACTIVE and get an TIMER_CONNRETRY event, we need to
change the state to CONNECT _before_ we call session_connect() to attempt
a connect, as session_connect can generate events that caus further state
changes.
as far as i saw that it only causes a bit confusion for sessions dangling
between CONNECT and ACTIVE all the time without causing real trouble, but bugs
are bugs, right.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Dec 25 13:13:18 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.39: +23 -1 lines
Diff to previous 1.39 (colored)

we need nonblocking connect

Revision 1.39 / (download) - annotate - [select for diffs], Wed Dec 24 23:48:05 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.38: +6 -6 lines
Diff to previous 1.38 (colored)

syscalls return -1 on err so test for == -1 instead of the < 0 found in very
few places, requested by theo

Revision 1.38 / (download) - annotate - [select for diffs], Wed Dec 24 23:14:23 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.37: +56 -64 lines
Diff to previous 1.37 (colored)

following up on a discussion with theo, read(2) as much as possible at once
and process the bgp messages after each other out of that big buffer.
gives a nice speedup, easier code and earlier connection close detection.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Dec 24 21:19:48 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

EAGAIN can't happen here anymore

Revision 1.36 / (download) - annotate - [select for diffs], Wed Dec 24 21:14:22 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.35: +1 -11 lines
Diff to previous 1.35 (colored)

no O_NONBLOCK for routing and tcp sockets, theo

Revision 1.35 / (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.34: +1 -6 lines
Diff to previous 1.34 (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.34 / (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.33: +30 -13 lines
Diff to previous 1.33 (colored)

handle write() returning 0 correctly, adjust the msgbuf API appropriately,
and make all callers cope.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 24 11:39:43 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

typos in comments, from jared

Revision 1.32 / (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.31: +2 -2 lines
Diff to previous 1.31 (colored)

spacing

Revision 1.31 / (download) - annotate - [select for diffs], Tue Dec 23 18:41:32 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.30: +3 -5 lines
Diff to previous 1.30 (colored)

play nice on exit (when he listening coket is closed)

Revision 1.30 / (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.29: +16 -7 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Tue Dec 23 16:11:06 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.28: +3 -4 lines
Diff to previous 1.28 (colored)

do send session_down imsgs to RDE even if we are quitting

Revision 1.28 / (download) - annotate - [select for diffs], Tue Dec 23 01:06:21 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.27: +5 -10 lines
Diff to previous 1.27 (colored)

allow the listening address to be specified, default to INADDR_ANY
should make jose@ happy

Revision 1.27 / (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.26: +2 -2 lines
Diff to previous 1.26 (colored)

rename get_imsg() to imsg_get(); that's more consistent

Revision 1.26 / (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.25: +17 -19 lines
Diff to previous 1.25 (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.25 / (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.24: +29 -34 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Sun Dec 21 18:21:24 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

queued_reads in struct peer was not ever used exept for an initialization to 0

Revision 1.23 / (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.22: +2 -3 lines
Diff to previous 1.22 (colored)

knf. OK henning@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Dec 20 21:31:37 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.21: +11 -13 lines
Diff to previous 1.21 (colored)

session_notification can take void *data too instead of u_char *data,
quite a few casts lost their life due to that

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

more from the castathon; imsg_compose takes void * now so get rid of the casts

Revision 1.20 / (download) - annotate - [select for diffs], Sat Dec 20 21:16:04 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

typo, tedu

Revision 1.19 / (download) - annotate - [select for diffs], Sat Dec 20 21:14:55 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.18: +17 -24 lines
Diff to previous 1.18 (colored)

let buf_add take void *data instead of u_char *data and save a zillion
evil casts

Revision 1.18 / (download) - annotate - [select for diffs], Sat Dec 20 20:24:57 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.17: +11 -11 lines
Diff to previous 1.17 (colored)

revert last

Revision 1.17 / (download) - annotate - [select for diffs], Sat Dec 20 20:09:34 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.16: +11 -11 lines
Diff to previous 1.16 (colored)

don't cast imsg.data to struct peer_config, memcpy instead, fixes 64bit
prodded by theo

Revision 1.16 / (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.15: +3 -1 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Sat Dec 20 15:06:31 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

reconf is an enum reconf_action, not int

Revision 1.14 / (download) - annotate - [select for diffs], Sat Dec 20 14:33:09 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.13: +8 -8 lines
Diff to previous 1.13 (colored)

read(2)/write(2) return ssize_t, not size_t

Revision 1.13 / (download) - annotate - [select for diffs], Fri Dec 19 21:41:04 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

even smaller typo with also big effect... < is not the same as >
of course the holdtime has to be _smaller_ than the minimal allowed holdtime
from the new configuration for the session needing a reinitialisation....
it beeing bigger is the normal case and no reason to reinit.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Dec 19 21:26:47 2003 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.11: +2 -5 lines
Diff to previous 1.11 (colored)

Small typo/pasto big effect. Muddled keepalive timer with holdtimer.
Additionaly the keepalive timer is automaticaly restarted by
session_keepalive(). help & OK hungry henning :)

Revision 1.11 / (download) - annotate - [select for diffs], Fri Dec 19 21:06:46 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.10: +13 -10 lines
Diff to previous 1.10 (colored)

when sending a notification things actually work better if you copy error code
and suberr code into the message... really

Revision 1.10 / (download) - annotate - [select for diffs], Fri Dec 19 20:34:53 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

actually we need to init the configuration we receive in the reconfigure case
much earlier, on RECONF_CONF, and not on RECONF_DONE, to prevent an unneeded
session down/up cycle for already established sessions.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Dec 19 20:20:58 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.8: +11 -3 lines
Diff to previous 1.8 (colored)

conf->holdtime was not set to teh default value initially if no holdtime
was specified in teh config file. this was done correctly in the
reconfiguration process...
use a new function init_conf() to set defaults where needed; currently only
holdtime, and call it both in the startup and the reconf case.

ok claudio@

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

when adding a new peer during reconfiguration set its sock to -1.
misbehaviour found by claudio

Revision 1.7 / (download) - annotate - [select for diffs], Fri Dec 19 11:25:18 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (colored)

don't bother sending a SESSION_DOWN imsg to the RDE if we are quitting, this
is at best pointless and usually just causes a fatal() when we try to send it
as the pipe is already closed by the RDE then. this way we can at least finish
the cleanup work, including notifications to the peers about us leaving.

Revision 1.6 / (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.5: +6 -7 lines
Diff to previous 1.5 (colored)

fix getpwnam use; noticed by claudio@

Revision 1.5 / (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.4: +2 -2 lines
Diff to previous 1.4 (colored)

knf & 64-bit cleanup; henning ok

Revision 1.4 / (download) - annotate - [select for diffs], Thu Dec 18 18:56:23 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

reset nconf to NULL after free(), from claudio

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: +2 -2 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: +11 -13 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.