OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.264 / (download) - annotate - [select for diffs], Wed May 15 09:09:38 2024 UTC (2 weeks, 3 days ago) by job
Branch: MAIN
CVS Tags: HEAD
Changes since 1.263: +28 -1 lines
Diff to previous 1.263 (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.263 / (download) - annotate - [select for diffs], Tue Apr 9 12:05:07 2024 UTC (7 weeks, 4 days ago) by claudio
Branch: MAIN
Changes since 1.262: +10 -2 lines
Diff to previous 1.262 (colored)

Check that the ASPA tas array fits in an IMSG before sending the ASPA
record over to RTR or the RDE.

The long term goal is to increase the IMSG size considerably but that
requires some additional API changes to the imsg API.
OK tb@

Revision 1.262 / (download) - annotate - [select for diffs], Tue Jan 9 13:41:32 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.261: +79 -80 lines
Diff to previous 1.261 (colored)

Convert the parent process imsg handling over to the new imsg API.

This simplifies the code a fair bit and removes direct unchecked memory
access to imsg.data.
OK tb@

Revision 1.261 / (download) - annotate - [select for diffs], Thu Jan 4 10:26:14 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored)

Rename argument roa of imsg_send_sockets() to rtr since the imsgbuf is
for PROC_RTR.

Revision 1.260 / (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.259: +4 -4 lines
Diff to previous 1.259 (colored)

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

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

Remove per-AFI ASPA handling in bgpd internals

With draft-ietf-sidrops-aspa-profile-16 and
draft-ietf-sidrops-aspa-verification-15 the AFI dependence of ASPA
records was dropped. So remove this complication form the code.

This only removes the AFI handling internally in bgpd but still allows
the old syntax in aspa-set tables. The optional address family is just
ignored and records are merged together.

For RTR sessions draft-ietf-sidrops-8210bis has not yet been updated so
right now we still handle RTR sessions as specified there. The IPv4 and
IPv6 ASPA entries are handled in two trees and merged together into one
AFI independent tree. This is the best we can do for now until IETF
updates draft-ietf-sidrops-8210bis.

OK tb@ job@

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

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

Revision 1.257 / (download) - annotate - [select for diffs], Tue Feb 14 15:33:46 2023 UTC (15 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.256: +2 -2 lines
Diff to previous 1.256 (colored)

No longer wait for the RTR process to finish the config reload before
sending the IMSG_RECONF_DONE message to the RDE. The RDE does not depend
on the RTR config reload (in contrast to the SE).
The ROA / ASPA reload is async from the RDE config reload.
OK tb@

Revision 1.256 / (download) - annotate - [select for diffs], Fri Jan 20 10:30:41 2023 UTC (16 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.255: +2 -2 lines
Diff to previous 1.255 (colored)

comma space not space comma

Revision 1.255 / (download) - annotate - [select for diffs], Fri Nov 18 10:17:23 2022 UTC (18 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.254: +24 -9 lines
Diff to previous 1.254 (colored)

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

Revision 1.254 / (download) - annotate - [select for diffs], Wed Aug 17 15:15:25 2022 UTC (21 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.253: +2 -2 lines
Diff to previous 1.253 (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.253 / (download) - annotate - [select for diffs], Thu Jul 28 13:11:48 2022 UTC (22 months ago) by deraadt
Branch: MAIN
Changes since 1.252: +3 -3 lines
Diff to previous 1.252 (colored)

whitespace found during a read-thru; ok claudio

Revision 1.252 / (download) - annotate - [select for diffs], Sat Jul 23 10:24:00 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.251: +10 -14 lines
Diff to previous 1.251 (colored)

Refactor and rename bgpd_filternexthop() to bgpd_oknexthop()

Simplify the logic and adjust kroute_match() which makes the code
easier to understand.
OK tb@

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

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

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

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

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

Revision 1.249 / (download) - annotate - [select for diffs], Wed Jul 20 12:43:27 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.248: +4 -2 lines
Diff to previous 1.248 (colored)

Cleanup and fix the network code.

- introduce network_free() to properly free a network struct including
  the possible rtlabel reference.
- change expand_networks() and the reload code to not only expand the
  main network config but also the network configs inside L3VPN sections.
- adjust reload logic to properly match any kind of network struct.
  Up until now rtlabel and priority network statememnts were not correctly
  reloaded.
OK tb@

Revision 1.248 / (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.247: +4 -4 lines
Diff to previous 1.247 (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.247 / (download) - annotate - [select for diffs], Wed Jun 22 14:56:11 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.246: +5 -11 lines
Diff to previous 1.246 (colored)

Use struct kroute_full in bgpd_filternexthop() so this code becomes a lot
simpler.

OK tb@

Revision 1.246 / (download) - annotate - [select for diffs], Wed Jun 15 10:10:03 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.245: +3 -3 lines
Diff to previous 1.245 (colored)

Rename F_BGPD_INSERTED to F_BGPD and use F_BGPD_INSERTED as a flag that
indicates that the route was successfully added to the FIB.

Filter out dynamic routes, like it is already done for ARP and ND routes) and
kill F_DYNAMIC.

Also remove the protect_lo() bits. Adding dummy kroute entries does no longer
prevent bad routes to hit the FIB. Also loopback IPs are checked in a few
other places to prevent bad routes to be installed into the FIB.

OK tb@

Revision 1.245 / (download) - annotate - [select for diffs], Thu Jun 9 16:45:19 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.244: +13 -9 lines
Diff to previous 1.244 (colored)

Remove the rdomain / rtableid passed to some kroute functions.

kr_nexthop_add() and kr_nexthop_delete() only operate on the main table
so just pass in the right rdomain id.
kr_shutdown() and kr_dispatch_msg() don't really need the rdomain passed.
The was done for kif_remove(), since that function needs to remove connected
routes from the rdomain table. Connected routes can only exists in the
interfaces rdomain so just use kif->k.rdomain. If such routes exist that
table exists as well. If the table does not exists there are also no
connected routes to track.
OK tb@

Revision 1.244 / (download) - annotate - [select for diffs], Sun Jun 5 12:43:13 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.243: +11 -16 lines
Diff to previous 1.243 (colored)

Rework how fib_priority is handled.
Instead of passing it around all the time put the fib_priority into the
kroute state. It is only needed in send_rtmsg() in the end.
Additionally insert F_BGP_INSERTED routes with a special RTP_MINE priority.
This makes changing the fib_priority at runtime simpler because there
is no need to alter the kroute table anymore.
OK tb@ deraadt@

Revision 1.243 / (download) - annotate - [select for diffs], Thu Jun 2 08:46:25 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored)

Adjust some warning messages to be a bit more accurate. ktable_update()
actually loads a routing table and not really an rdomain.

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

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

Revision 1.241 / (download) - annotate - [select for diffs], Sun Jan 23 11:59:40 2022 UTC (2 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.240: +3 -2 lines
Diff to previous 1.240 (colored)

On poll() failure we want to skip pollfd related action but the signal
delivery checks at the end still need to happen. So that on EINTR bgpd
processes reconfigure or mrt files ASAP.
Fix for mrt integration tests.
Reported by and ok anton@

Revision 1.240 / (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.239: +4 -2 lines
Diff to previous 1.239 (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.239 / (download) - annotate - [select for diffs], Tue Jul 20 12:07:46 2021 UTC (2 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.238: +2 -2 lines
Diff to previous 1.238 (colored)

Add -V to usage. Reported by Pier Carlo Chiodi.

Revision 1.238 / (download) - annotate - [select for diffs], Wed Jun 16 16:24:12 2021 UTC (2 years, 11 months ago) by job
Branch: MAIN
Changes since 1.237: +6 -2 lines
Diff to previous 1.237 (colored)

Add command line option to show the version

OK claudio@

Revision 1.237 / (download) - annotate - [select for diffs], Mon May 17 10:47:07 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.236: +8 -1 lines
Diff to previous 1.236 (colored)

Limit the number of concurrent RTR connects to 32.
If the limit is hit the request will be dropped and the rtr process will
retry the connect after the retry timeout. Hopefully by then the number of
connections is down again.
OK deraadt@ benno@

Revision 1.236 / (download) - annotate - [select for diffs], Tue May 11 07:57:24 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.235: +119 -15 lines
Diff to previous 1.235 (colored)

Use non-blocking connect() to setup the RTR socket. connect() can hang for
a long time if the IP is not reachable and would block the main process
while doing so.
Problem noticed by Pier Carlo Chiodi
OK benno@

Revision 1.235 / (download) - annotate - [select for diffs], Mon May 3 13:18:06 2021 UTC (3 years ago) by claudio
Branch: MAIN
Changes since 1.234: +6 -5 lines
Diff to previous 1.234 (colored)

Like in the session engine do not inline the addr2sa call into connect and
bind. The len argument is modified by addr2sa but is also used as argument
in the call and it is undefined if the value of len in connect is set to
the value "returned" by addr2sa().
Should fix connect issues seen on Linux system.
OK denis@

Revision 1.234 / (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.233: +175 -27 lines
Diff to previous 1.233 (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.233 / (download) - annotate - [select for diffs], Mon Jan 4 17:44:14 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.232: +25 -19 lines
Diff to previous 1.232 (colored)

Rename PFD_PIPE_ROUTE to PFD_PIPE_RDE which is a more obvious name.
Also change the startup code to use enum bgpd_process to select which
process needs to be run. Makes the code in my opinion easier to understand.
OK denis@

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

RB_REMOVE from the correct tree. Dumb copy paste bug introduced by last commit.
Noticed by procter@

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

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

Revision 1.230 / (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.229: +2 -3 lines
Diff to previous 1.229 (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.229 / (download) - annotate - [select for diffs], Mon May 11 16:59:19 2020 UTC (4 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.228: +5 -5 lines
Diff to previous 1.228 (colored)

There is no reason to limit the string length of log_reason() to REASON_LEN
charactars. Also fix a long line.
OK benno@ deraadt@

Revision 1.228 / (download) - annotate - [select for diffs], Sun May 10 13:38:46 2020 UTC (4 years ago) by deraadt
Branch: MAIN
Changes since 1.227: +5 -1 lines
Diff to previous 1.227 (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.227 / (download) - annotate - [select for diffs], Wed Oct 2 08:58:34 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.226: +6 -7 lines
Diff to previous 1.226 (colored)

In IMSG_PFKEY_RELOAD do not warn about unknown peers. When a peer is
removed the session engine will issue a IMSG_PFKEY_RELOAD call after
the parent has removed the peer which is no problem and so no need
to fill the log with this.
OK benno@

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

For portable kr_init() returns an fd of -1 which now would end up in an
immediate exit of bgpd. Instead pass the fd via pointer arg.
OK benno@

Revision 1.225 / (download) - annotate - [select for diffs], Thu Aug 8 11:33:08 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.224: +38 -22 lines
Diff to previous 1.224 (colored)

Parse the config file early on startup before bgpd is daemonized.
This way config errors will be directly user visible on startup.
To do this split out send_config() out of reconfigure() which is
sending the config to the SE and RDE.
OK sthen@

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

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

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

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

Revision 1.222 / (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.221: +1 -2 lines
Diff to previous 1.221 (colored)

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

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

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

Revision 1.220 / (download) - annotate - [select for diffs], Fri Jul 19 07:40:41 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.219: +43 -13 lines
Diff to previous 1.219 (colored)

When allocating socketpair() increase their send and receive buffers to
4 times the read size. This helps to increase the efficency of poll()
since now most of the time the read and write call can operate on full
buffers.
OK benno@ phessler@

Revision 1.219 / (download) - annotate - [select for diffs], Wed May 29 08:48:00 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.218: +2 -4 lines
Diff to previous 1.218 (colored)

Rework pfkey handling a bit. The old remove then add way of inserting md5sig
hit a race frequently where a session ended up with no key/SPI in the kernel.
Since there is no way to do atomic updates of SADB_X_SATYPE_TCPSIGNATURE
the code is adding a new one then removing the old one.
Also make sure keys are correctly cleared when peers are deconfigured.
May not be perfect but a lot better than what was there before.
Tested by and OK sthen@

Revision 1.218 / (download) - annotate - [select for diffs], Mon May 27 09:14:32 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.217: +3 -3 lines
Diff to previous 1.217 (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.217 / (download) - annotate - [select for diffs], Wed May 8 18:48:34 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.216: +6 -6 lines
Diff to previous 1.216 (colored)

when passing objects to imsg use the for 'obj, sizeof(*obj)' instead of
'obj, sizeof(struct object)'
OK benno@

Revision 1.216 / (download) - annotate - [select for diffs], Wed May 8 12:41:55 2019 UTC (5 years ago) by claudio
Branch: MAIN
Changes since 1.215: +48 -13 lines
Diff to previous 1.215 (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.215 / (download) - annotate - [select for diffs], Sun Mar 31 16:57:38 2019 UTC (5 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.214: +11 -22 lines
Diff to previous 1.214 (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.214 / (download) - annotate - [select for diffs], Sun Mar 31 03:36:18 2019 UTC (5 years, 2 months ago) by yasuoka
Branch: MAIN
Changes since 1.213: +5 -2 lines
Diff to previous 1.213 (colored)

Avoid calling dup2(oldd, newd) when oldd == newd.  In that case the
descriptor keeps CLOEXEC flag then it will be closed unexpectedly by
exec().

ok tedu florian

Revision 1.213 / (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.212: +22 -2 lines
Diff to previous 1.212 (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.212 / (download) - annotate - [select for diffs], Thu Feb 14 14:34:31 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.211: +4 -4 lines
Diff to previous 1.211 (colored)

mrt_timeout() can send out imsgs so better call it before doing the set_pollfd
this ensures that the imsgs go actually out right away.

Revision 1.211 / (download) - annotate - [select for diffs], Thu Feb 14 13:13:33 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.210: +5 -4 lines
Diff to previous 1.210 (colored)

mrt_timeout should just return -1 when there is no timeout set instead
of some strange maximum.  The poll loop in bgpd.c already limits the
maximum wait time so there is no need to double it.
While there switch to using time_t for the calculation.
OK phessler@

Revision 1.210 / (download) - annotate - [select for diffs], Thu Feb 14 10:38:04 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.209: +1 -1 lines
Diff to previous 1.209 (colored)

Revert part of last commit, this stuff is unrelated.

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

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

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

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

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

With and OK dlg@, OK denis@

Revision 1.207 / (download) - annotate - [select for diffs], Sun Jan 20 06:13:40 2019 UTC (5 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.206: +13 -8 lines
Diff to previous 1.206 (colored)

explicitly check if the session engine exited by comparing the pid

ok claudio@

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

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

Revision 1.205 / (download) - annotate - [select for diffs], Thu Dec 27 20:23:24 2018 UTC (5 years, 5 months ago) by remi
Branch: MAIN
Changes since 1.204: +16 -10 lines
Diff to previous 1.204 (colored)

Check if a control socket or address is already in use befor using it.
If it is used abort startup or let a reload fail.
Sockets are now not unlinked anymore on regular shutdown.

This helps a lot when one tries to do a config check without -n.

Inputs and OK claudio@

Revision 1.204 / (download) - annotate - [select for diffs], Sat Sep 29 08:11:11 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.203: +37 -13 lines
Diff to previous 1.203 (colored)

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

Revision 1.203 / (download) - annotate - [select for diffs], Sat Sep 29 07:58:06 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.202: +25 -5 lines
Diff to previous 1.202 (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.202 / (download) - annotate - [select for diffs], Tue Sep 25 07:58:11 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.201: +5 -5 lines
Diff to previous 1.201 (colored)

When sending set_tables in the imsg use the right size. Currently the
number of elements is used as size which is always wrong.

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

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

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

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

Revision 1.199 / (download) - annotate - [select for diffs], Thu Sep 20 07:46:39 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored)

Switch prefixset to an RB_TREE instead of a SIMPLEQ. This allows to trigger
on duplicates (which are only reported) but is needed as a preparation step
for roa-sets.
OK benno@ denis@

Revision 1.198 / (download) - annotate - [select for diffs], Sun Sep 9 11:00:51 2018 UTC (5 years, 8 months ago) by benno
Branch: MAIN
Changes since 1.197: +2 -1 lines
Diff to previous 1.197 (colored)

Add network prefix-set <name> syntax to announce networks in a prefix-set.
feature discussed with deraadt@ and job@, ok claudio@

Revision 1.197 / (download) - annotate - [select for diffs], Fri Sep 7 10:59:16 2018 UTC (5 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.196: +2 -2 lines
Diff to previous 1.196 (colored)

Some space fixes mentioned by benno@

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

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

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

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

Revision 1.194 / (download) - annotate - [select for diffs], Sat Jul 14 12:32:35 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.193: +3 -3 lines
Diff to previous 1.193 (colored)

get rid of two more implicit ktable_get with rdomain 0.
should not change anything when run in rdomain 0.
ok henning@ phessler@ claudio@

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

You can run multiple copies of bgpd in seperate rdomains.

However, the processes will see each others route messages. Some
structures are not initialized correctly for that, causing at least
useless log messages.

This is an attempt to use the default_tableid where its needed.

A few hardcoded uses of rtable 0 remain.

ok claudio@

Revision 1.192 / (download) - annotate - [select for diffs], Sat Feb 10 01:24:28 2018 UTC (6 years, 3 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.191: +19 -1 lines
Diff to previous 1.191 (colored)

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

Revision 1.191 / (download) - annotate - [select for diffs], Sat Aug 12 16:31:09 2017 UTC (6 years, 9 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (colored)

Make not yet implemented pledges more visible in grep output.
input benno, deraadt, tedu
also standardize on #if 0 since it makes tedu's editor vomit.
OK benno, pirofti on a previous version

Revision 1.190 / (download) - annotate - [select for diffs], Tue Jun 27 15:58:07 2017 UTC (6 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.189: +2 -2 lines
Diff to previous 1.189 (colored)

move a global into local context; from rob pierce

Revision 1.189 / (download) - annotate - [select for diffs], Sun May 28 15:16:33 2017 UTC (7 years ago) by henning
Branch: MAIN
Changes since 1.188: +4 -3 lines
Diff to previous 1.188 (colored)

so far, bgpd was hardcoded to use rtable 0 for nexthop verification.
instead, use the rtable bgpd was started in (route -T <n> exec / rc.d
daemon_rtable) for nexthop verification and as default Adj-RIB-In and
Loc-RIB. This allows multiple bgpds in different rdomains on the same
machine - bgp router virtualization if you like buzzwords.
initial version written under contract more than a year ago, it took us
a while to wrap our brains around the bgpd <-> rdomain interactions -
1) RIBs, 2) nexthop verification and 3) tcp sockets.
ok & input phessler claudio benno

Revision 1.188 / (download) - annotate - [select for diffs], Tue Jan 24 04:22:42 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.187: +9 -8 lines
Diff to previous 1.187 (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.187 / (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.186: +25 -58 lines
Diff to previous 1.186 (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.186 / (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.185: +2 -1 lines
Diff to previous 1.185 (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.185 / (download) - annotate - [select for diffs], Mon Jun 20 20:12:52 2016 UTC (7 years, 11 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.184: +2 -2 lines
Diff to previous 1.184 (colored)

change the "nexthop 1.2.3.4 now valid: via 192.168.0.1" message to log_debug()
ok deraadt@ florian@ stsp@ phessler@

Revision 1.184 / (download) - annotate - [select for diffs], Tue Feb 2 17:51:11 2016 UTC (8 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.183: +1 -3 lines
Diff to previous 1.183 (colored)

Remove setproctitle() for the parent process. Because rc.d(8) uses process
titles (including flags) to distinguish between daemons, this makes it
possible to manage multiple copies of a daemon using the normal infrastructure
by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@

Revision 1.183 / (download) - annotate - [select for diffs], Fri Nov 27 21:41:30 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.182: +6 -6 lines
Diff to previous 1.182 (colored)

Imporve error messages for the imsg handler code. OK sthen@

Revision 1.182 / (download) - annotate - [select for diffs], Fri Nov 20 23:26:08 2015 UTC (8 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.181: +5 -1 lines
Diff to previous 1.181 (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.181 / (download) - annotate - [select for diffs], Tue Nov 17 17:54:01 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.180: +7 -1 lines
Diff to previous 1.180 (colored)

pledge() esposes a design issue in bgpd that will take a moment to
get right, so disable the pledge() call in bgpd (parent process) for now.
ok deraadt@

Revision 1.180 / (download) - annotate - [select for diffs], Thu Nov 12 20:49:46 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.179: +16 -1 lines
Diff to previous 1.179 (colored)

pledge the bgpd main process. Some of the promises can be improved upon
with a bit of rework, so comment why they are needed.
ok deraadt@

Revision 1.179 / (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.178: +3 -3 lines
Diff to previous 1.178 (colored)

Give more precise errors, to help track when bgpd quits

OK florian@ benno@ sthen@ deraadt@

Revision 1.178 / (download) - annotate - [select for diffs], Mon Jul 20 16:10:37 2015 UTC (8 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.177: +168 -54 lines
Diff to previous 1.177 (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.177 / (download) - annotate - [select for diffs], Thu Jul 16 18:26:04 2015 UTC (8 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.176: +26 -50 lines
Diff to previous 1.176 (colored)

Next round of config cleanup. Move various lists into the bgpd_config struct.
This is the next step to better split parsing and merging the config.
OK benno@

Revision 1.176 / (download) - annotate - [select for diffs], Sat Mar 14 02:43:02 2015 UTC (9 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.175: +11 -9 lines
Diff to previous 1.175 (colored)

Move the command line options (mainly -d and -v) out of struct bgpd_config
into a own flag field since these can't be modified via a config reload.
OK henning@ benno@ before lock

Revision 1.175 / (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.174: +9 -13 lines
Diff to previous 1.174 (colored)

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

Revision 1.174 / (download) - annotate - [select for diffs], Wed Nov 13 20:41:01 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.173: +4 -3 lines
Diff to previous 1.173 (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.173 / (download) - annotate - [select for diffs], Wed Nov 13 09:14:48 2013 UTC (10 years, 6 months ago) by florian
Branch: MAIN
Changes since 1.172: +19 -13 lines
Diff to previous 1.172 (colored)

Knob to set priority with which bgpd inserts routes into the kernel
routing table. Need for it in "special" setups pointed out by
Loic Blot (loic.blot _AT_ unix-experience _DOT_ fr) on tech.
OK benno, henning

Revision 1.172 / (download) - annotate - [select for diffs], Fri May 31 23:10:13 2013 UTC (11 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.171: +9 -9 lines
Diff to previous 1.171 (colored)

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

Revision 1.171 / (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.170: +7 -8 lines
Diff to previous 1.170 (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.170 / (download) - annotate - [select for diffs], Fri Nov 2 18:02:45 2012 UTC (11 years, 7 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.169: +2 -1 lines
Diff to previous 1.169 (colored)

Unstick bgpctl reload after reloading a bgpd.conf with errors.

ok claudio, benno

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

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

Revision 1.168 / (download) - annotate - [select for diffs], Sat Aug 20 19:02:28 2011 UTC (12 years, 9 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.167: +3 -1 lines
Diff to previous 1.167 (colored)

Decouple log_verbose() from log_init() so the verbose flag stays set with
"-v" (previously only "-vd" worked). Similar to recent ospfd commit.
ok claudio@

Revision 1.167 / (download) - annotate - [select for diffs], Sun May 1 10:42:28 2011 UTC (13 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.166: +3 -1 lines
Diff to previous 1.166 (colored)

Free cname and rcname on exit. Found by Milosz Jakubowski

Revision 1.166 / (download) - annotate - [select for diffs], Thu Sep 2 14:03:21 2010 UTC (13 years, 9 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.165: +2 -2 lines
Diff to previous 1.165 (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.165 / (download) - annotate - [select for diffs], Mon Jun 28 19:52:03 2010 UTC (13 years, 11 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored)

remove -r and -s from usage, these options were dropped on a previous
change to bgpd; while here, rewrite usage() in a more usual way.

ok jmc@

Revision 1.164 / (download) - annotate - [select for diffs], Sun Jun 27 19:53:34 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.163: +51 -11 lines
Diff to previous 1.163 (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.163 / (download) - annotate - [select for diffs], Wed May 19 12:44:14 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.162: +11 -8 lines
Diff to previous 1.162 (colored)

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

Revision 1.162 / (download) - annotate - [select for diffs], Mon May 17 15:49:29 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.161: +63 -80 lines
Diff to previous 1.161 (colored)

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

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

Revision 1.161 / (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.160: +26 -14 lines
Diff to previous 1.160 (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.160 / (download) - annotate - [select for diffs], Mon Apr 26 12:25:06 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.159: +3 -2 lines
Diff to previous 1.159 (colored)

Add some { } for better readability and to make the code look like the
other blocks in this function.

Revision 1.159 / (download) - annotate - [select for diffs], Mon Apr 26 08:46:31 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.158: +1 -5 lines
Diff to previous 1.158 (colored)

Fix some memory leaks on config reload failure and move one particular
cleanup loop to parse.y where it belongs.
OK henning@

Revision 1.158 / (download) - annotate - [select for diffs], Thu Apr 22 08:24:58 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.157: +2 -2 lines
Diff to previous 1.157 (colored)

Including bgpd.h in mrt.h is dumb.

Revision 1.157 / (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.156: +16 -24 lines
Diff to previous 1.156 (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.156 / (download) - annotate - [select for diffs], Mon Mar 29 09:09:25 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.155: +14 -21 lines
Diff to previous 1.155 (colored)

Since we always reload the config now there is no need to allocate the
filter list head. It is only used temporary in reconfigure().
OK henning

Revision 1.155 / (download) - annotate - [select for diffs], Wed Mar 3 09:40:56 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.154: +1 -2 lines
Diff to previous 1.154 (colored)

Remove superfluous newline

Revision 1.154 / (download) - annotate - [select for diffs], Thu Feb 11 14:40:06 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.153: +2 -2 lines
Diff to previous 1.153 (colored)

We need to load the config before kr_init() is called or fib-update is
ignored. Found and fix tested by Elisa Jasinska.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jan 11 05:47:51 2010 UTC (14 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.152: +7 -6 lines
Diff to previous 1.152 (colored)

Do not crash when starting up with a bad config file. Check that
conf.listen_addr is actually valid before deref.

Revision 1.152 / (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.151: +15 -40 lines
Diff to previous 1.151 (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.151 / (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.150: +5 -5 lines
Diff to previous 1.150 (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.150 / (download) - annotate - [select for diffs], Mon Nov 2 20:38:15 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.149: +9 -3 lines
Diff to previous 1.149 (colored)

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

Revision 1.149 / (download) - annotate - [select for diffs], Mon Jul 20 15:00:13 2009 UTC (14 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.148: +5 -1 lines
Diff to previous 1.148 (colored)

On config reload errors free the list of ribs so that following reloads
don't fail because of redefinition conflicts. This problem was reported
by some people.

Revision 1.148 / (download) - annotate - [select for diffs], Sun Jun 7 00:30:23 2009 UTC (14 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.147: +11 -1 lines
Diff to previous 1.147 (colored)

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

Revision 1.147 / (download) - annotate - [select for diffs], Fri Jun 5 20:26:38 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (colored)

Adjust print_config to all the stuff added in the last days.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Jun 4 04:46:42 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.145: +9 -3 lines
Diff to previous 1.145 (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.145 / (download) - annotate - [select for diffs], Mon May 12 19:15:02 2008 UTC (16 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.144: +6 -1 lines
Diff to previous 1.144 (colored)

Error out with usage line if additional arguments are given after the
option parsing. Found out the hard way by jdixon on ifstated.

ok sobrado@, jdixon@, millert@

Revision 1.144 / (download) - annotate - [select for diffs], Fri May 11 11:27:59 2007 UTC (17 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.143: +2 -2 lines
Diff to previous 1.143 (colored)

Various spelling fixes from Stuart Henderson.

Revision 1.143 / (download) - annotate - [select for diffs], Fri Jan 26 17:40:48 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.142: +8 -3 lines
Diff to previous 1.142 (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.142 / (download) - annotate - [select for diffs], Thu Jan 4 18:38:51 2007 UTC (17 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (colored)

ignore SIGPIPE, like the other 2 processes already do. we detect broken
pipes without the signal just fine. ok claudio

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

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

Revision 1.140 / (download) - annotate - [select for diffs], Tue Nov 28 16:39:34 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.139: +3 -2 lines
Diff to previous 1.139 (colored)

allow bgpd to work on alternate routing tables, claudio ok, jmc manpage help

Revision 1.139 / (download) - annotate - [select for diffs], Mon Jun 19 20:48:36 2006 UTC (17 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

add -c to usage() and synopsis;

Revision 1.138 / (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.137: +19 -2 lines
Diff to previous 1.137 (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.137 / (download) - annotate - [select for diffs], Sat May 27 21:24:36 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.136: +24 -4 lines
Diff to previous 1.136 (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.136 / (download) - annotate - [select for diffs], Wed Apr 26 20:00:03 2006 UTC (18 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.135: +7 -8 lines
Diff to previous 1.135 (colored)

Last argument to send_filterset() is a left-over from one of my not so clever
ideas that will never be included and always set to 0. Kill it.

Revision 1.135 / (download) - annotate - [select for diffs], Wed Mar 22 13:30:35 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.134: +27 -2 lines
Diff to previous 1.134 (colored)

Change the way bgpd selects nexthops. Up until now every route was considered
when calculating the nexthop. Now only non BGP routes and not the default
route are used unless forced with the new config options
 nexthop qualify via bgp
 nexthop qualify via default
This change is required for complex setups e.g. where an additional IGP is
running.  OK henning@

Revision 1.134 / (download) - annotate - [select for diffs], Wed Mar 15 12:54:01 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.133: +2 -2 lines
Diff to previous 1.133 (colored)

Sync usage with man page (sort arguments).

Revision 1.133 / (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.132: +8 -4 lines
Diff to previous 1.132 (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.132 / (download) - annotate - [select for diffs], Tue Jan 24 14:26:52 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.131: +29 -32 lines
Diff to previous 1.131 (colored)

Functions in the poll() loop should only be moved around if there are no
side-effects. Revert last changes and make bgpctl reload work again.

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

KNF

Revision 1.130 / (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.129: +8 -4 lines
Diff to previous 1.129 (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.129 / (download) - annotate - [select for diffs], Tue Jan 3 16:49:23 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.128: +2 -1 lines
Diff to previous 1.128 (colored)

Plug some mem leaks.

Revision 1.128 / (download) - annotate - [select for diffs], Tue Jan 3 13:13:16 2006 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.127: +29 -26 lines
Diff to previous 1.127 (colored)

Move the signal handler flags check between the poll() call and the poll
fd handling. Do not access poll fd in case of an error or timeout.
With and OK dlg@

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

bzero the pfd array before setting it up and calling poll because on error
(e.g. EINTR) poll() will not update the pfd array (copyout) and so the old
revents are used and results in a blocking parent process. OK dlg@

Revision 1.126 / (download) - annotate - [select for diffs], Wed Nov 2 15:03:02 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.125: +16 -8 lines
Diff to previous 1.125 (colored)

Reorder and comment reconfigure(). Makes more sense so.

Revision 1.125 / (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.124: +1 -4 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Thu Oct 13 09:09:20 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.123: +8 -11 lines
Diff to previous 1.123 (colored)

Simplify poll loop as well. "grrr, OK" henning@

Revision 1.123 / (download) - annotate - [select for diffs], Fri Jul 1 13:38:14 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

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

Revision 1.122 / (download) - annotate - [select for diffs], Wed Jun 29 09:43:25 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.121: +10 -15 lines
Diff to previous 1.121 (colored)

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

Revision 1.121 / (download) - annotate - [select for diffs], Thu Jun 9 15:32:03 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.120: +17 -3 lines
Diff to previous 1.120 (colored)

Change the "network connected|static" statements to "network inet|inet6
connected|static" so that it is possible to distinguish between IPv4 and IPv6
addresses. "network connected|static" is considered deprecated but will be
supported as an alias for "network inet connected|static" for some time (one
release) to simplify upgrades. This also solve a nasty crash when using
"network connected".  OK henning@

Revision 1.120 / (download) - annotate - [select for diffs], Fri May 27 17:59:50 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored)

will throw claudio in a big pot of kaesefondue for repeated whitespace fuckups

Revision 1.119 / (download) - annotate - [select for diffs], Fri May 27 17:52:10 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.118: +28 -5 lines
Diff to previous 1.118 (colored)

kroute6 support, at least partially. Get it in so that Henning can clean it
up more. OK henning@

Revision 1.118 / (download) - annotate - [select for diffs], Mon May 23 22:48:53 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.117: +1 -2 lines
Diff to previous 1.117 (colored)

one more endpwent

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

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

Revision 1.116 / (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.115: +10 -10 lines
Diff to previous 1.115 (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.115 / (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.114: +4 -2 lines
Diff to previous 1.114 (colored)

free rules_l if the initial config file parse fails

Revision 1.114 / (download) - annotate - [select for diffs], Thu Mar 24 02:39:16 2005 UTC (19 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.113: +11 -7 lines
Diff to previous 1.113 (colored)

fix memory leak in error paths.  found with coverity prevent.
ok claudio henning

Revision 1.113 / (download) - annotate - [select for diffs], Wed Feb 9 10:56:28 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.112: +4 -1 lines
Diff to previous 1.112 (colored)

need to send IMSG_NETWORK_DONE after sending networks and associated filter
sets, otherwise local netyworks get withdrawn after config reload;
misbehaviour noticed by peter.galbavy@knowtion.net, claudio ok

Revision 1.112 / (download) - annotate - [select for diffs], Wed Feb 2 18:52:32 2005 UTC (19 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.111: +11 -10 lines
Diff to previous 1.111 (colored)

usage() is __dead
pt out by Alexander v Gernler

Revision 1.111 / (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.110: +30 -2 lines
Diff to previous 1.110 (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.110 / (download) - annotate - [select for diffs], Tue Oct 19 12:02:49 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.109: +9 -1 lines
Diff to previous 1.109 (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.109 / (download) - annotate - [select for diffs], Thu Sep 23 01:55:05 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.108: +7 -3 lines
Diff to previous 1.108 (colored)

after receival of a SIGCHLD reset io_pid or rde_pid, respectively, dependent
on which child went away.

Revision 1.108 / (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.107: +11 -11 lines
Diff to previous 1.107 (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.107 / (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.106: +37 -29 lines
Diff to previous 1.106 (colored)

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

Revision 1.106 / (download) - annotate - [select for diffs], Wed Sep 15 18:30:42 2004 UTC (19 years, 8 months ago) by otto
Branch: MAIN
Changes since 1.105: +4 -4 lines
Diff to previous 1.105 (colored)

if (signalflag) { dowork(); signalflag = 0; } is a race. First clear flag,
then call work(). ok henning@

Revision 1.105 / (download) - annotate - [select for diffs], Tue Aug 24 11:43:16 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.104: +7 -10 lines
Diff to previous 1.104 (colored)

use session_socket_blockmode() instead of hand-rolling roughly the same
claudio ok

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

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

Revision 1.103 / (download) - annotate - [select for diffs], Tue Aug 3 13:43:29 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.102: +2 -1 lines
Diff to previous 1.102 (colored)

Fix mem-leak on exit. OK henning@

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jul 28 16:00:02 2004 UTC (19 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.101: +5 -17 lines
Diff to previous 1.101 (colored)

The hole dance to close a mrt file after fd passing in the parent is not
needed as the fd is closed while beeing passed. looks good henning@

Revision 1.101 / (download) - annotate - [select for diffs], Mon Jul 5 02:13:43 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored)

fix a few KNF fallouts

Revision 1.100 / (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.99: +4 -3 lines
Diff to previous 1.99 (colored)

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

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

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

Revision 1.98 / (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.97: +24 -21 lines
Diff to previous 1.97 (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.97 / (download) - annotate - [select for diffs], Sun Jun 20 18:35:11 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.96: +5 -5 lines
Diff to previous 1.96 (colored)

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

Revision 1.96 / (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.95: +12 -8 lines
Diff to previous 1.95 (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.95 / (download) - annotate - [select for diffs], Sun Jun 6 17:38:10 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.94: +18 -1 lines
Diff to previous 1.94 (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.94 / (download) - annotate - [select for diffs], Fri May 21 11:48:56 2004 UTC (20 years ago) by claudio
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (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.93 / (download) - annotate - [select for diffs], Fri May 7 10:06:15 2004 UTC (20 years, 1 month ago) by djm
Branch: MAIN
Changes since 1.92: +33 -1 lines
Diff to previous 1.92 (colored)

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

Revision 1.92 / (download) - annotate - [select for diffs], Mon May 3 04:44:41 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.91: +3 -2 lines
Diff to previous 1.91 (colored)

little KNF issue

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

sock -> fd; ok henning

Revision 1.90 / (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.89: +5 -5 lines
Diff to previous 1.89 (colored)

crud stripping; henning ok

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

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

Revision 1.88 / (download) - annotate - [select for diffs], Tue Mar 16 12:06:43 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.87: +2 -6 lines
Diff to previous 1.87 (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.87 / (download) - annotate - [select for diffs], Fri Mar 12 16:21:34 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.86: +7 -5 lines
Diff to previous 1.86 (colored)

fix the "wait for child processes to terminate" code, and move it down a bit
millert ok

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

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

Revision 1.85 / (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.84: +8 -4 lines
Diff to previous 1.84 (colored)

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

Revision 1.84 / (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.83: +3 -2 lines
Diff to previous 1.83 (colored)

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

Revision 1.83 / (download) - annotate - [select for diffs], Wed Mar 10 14:45:24 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (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.82 / (download) - annotate - [select for diffs], Wed Mar 10 13:48:45 2004 UTC (20 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.81: +7 -2 lines
Diff to previous 1.81 (colored)

free peer list on exit, claudio ok

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

Arrrg. Not my day. Sync printconfig with parser here too.

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

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

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

print networks too

Revision 1.78 / (download) - annotate - [select for diffs], Mon Feb 9 23:10:04 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.77: +2 -3 lines
Diff to previous 1.77 (colored)

drain the list fluffier

Revision 1.77 / (download) - annotate - [select for diffs], Mon Feb 9 01:38:55 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.76: +2 -3 lines
Diff to previous 1.76 (colored)

print more fluff

Revision 1.76 / (download) - annotate - [select for diffs], Mon Feb 9 00:00:41 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.75: +6 -2 lines
Diff to previous 1.75 (colored)

move printing the config to where it belongs

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

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

Revision 1.74 / (download) - annotate - [select for diffs], Fri Feb 6 20:18:18 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.73: +20 -6 lines
Diff to previous 1.73 (colored)

initial cut at the filtering language.
structs etc to describe a rule, filter rule list management
parser groks filter defs now.

claudio ok, discussion & help also jakob theo

Revision 1.73 / (download) - annotate - [select for diffs], Tue Feb 3 17:36:30 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.72: +8 -14 lines
Diff to previous 1.72 (colored)

defer free()ing the previous peer list until after parsing the config file
so in the parser we can access it. will be needed soon.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Jan 23 21:18:12 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.71: +5 -8 lines
Diff to previous 1.71 (colored)

use log_addr

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

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

ok claudio@

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

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

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

check early wether user _bgpd exists so we can bail out early and nicely
prodded by theo

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

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

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

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

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

use bgpd_addr in the nexthop tree; change nexthop_add/_remove accordingly

ok claudio@

Revision 1.65 / (download) - annotate - [select for diffs], Sun Jan 11 21:32:56 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.64: +16 -12 lines
Diff to previous 1.64 (colored)

in the nexthop imsgs use struct bgpd_addr for the data part instead of
in_addr_t

ok claudio@

Revision 1.64 / (download) - annotate - [select for diffs], Sun Jan 11 19:14:43 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.63: +10 -6 lines
Diff to previous 1.63 (colored)

use struct bgpd_addr for nexthop and gateway in struct kroute_nexthop
(and thus the nexthop messages between parent and RDE)

ok claudio@

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

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

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

The buffer changes produced some fallout in the mrt code.
Wait until all data has been written out before closing the file and fix
some obvious misstakes. OK henning@

Revision 1.61 / (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.60: +3 -2 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Fri Jan 9 13:47:07 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.59: +15 -1 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Thu Jan 8 16:17:12 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.58: +10 -10 lines
Diff to previous 1.58 (colored)

rename a few functions to further clarify things

Revision 1.58 / (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.57: +2 -2 lines
Diff to previous 1.57 (colored)

2004

Revision 1.57 / (download) - annotate - [select for diffs], Mon Jan 5 22:57:59 2004 UTC (20 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.56: +19 -58 lines
Diff to previous 1.56 (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.56 / (download) - annotate - [select for diffs], Mon Jan 5 19:10:24 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.55: +34 -2 lines
Diff to previous 1.55 (colored)

correctly handle SIGCHLD.
SIGCHLD does _not_ translate to "a child process went kaboom".
waitpid() and check status; if the child exited or terminated log & quit

ok claudio@

Revision 1.55 / (download) - annotate - [select for diffs], Mon Jan 5 18:21:51 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored)

waitpid's return is a pid_t

Revision 1.54 / (download) - annotate - [select for diffs], Mon Jan 5 16:21:14 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.53: +13 -1 lines
Diff to previous 1.53 (colored)

allow fib couple/decouple based on an imsg received on the control socket
by the SE and passed on to the main process

Revision 1.53 / (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.52: +7 -1 lines
Diff to previous 1.52 (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.52 / (download) - annotate - [select for diffs], Sat Jan 3 20:37:34 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.51: +12 -11 lines
Diff to previous 1.51 (colored)

move some session specific stuff to session.h and make the few files
that need it include that

Revision 1.51 / (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.50: +21 -10 lines
Diff to previous 1.50 (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.50 / (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.49: +7 -2 lines
Diff to previous 1.49 (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.49 / (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.48: +7 -2 lines
Diff to previous 1.48 (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.48 / (download) - annotate - [select for diffs], Thu Jan 1 23:09:08 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.47: +9 -3 lines
Diff to previous 1.47 (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.47 / (download) - annotate - [select for diffs], Tue Dec 30 22:42:31 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

correctly free after buf_add/_close errs.
From: Patrick Latifi <pat@eyeo.org>

Revision 1.46 / (download) - annotate - [select for diffs], Tue Dec 30 20:59:43 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.45: +7 -3 lines
Diff to previous 1.45 (colored)

missing free()s in error cases that (now) lead to program termination
From: Patrick Latifi <pat@eyeo.org>

Revision 1.45 / (download) - annotate - [select for diffs], Sat Dec 27 14:58:22 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.44: +1 -9 lines
Diff to previous 1.44 (colored)

move the fib couple/decouple to the config merge where it belongs

Revision 1.44 / (download) - annotate - [select for diffs], Sat Dec 27 14:24:42 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.43: +7 -7 lines
Diff to previous 1.43 (colored)

keep a copy of the fd locally instead of passing it around all time

Revision 1.43 / (download) - annotate - [select for diffs], Sat Dec 27 01:31:49 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.42: +10 -1 lines
Diff to previous 1.42 (colored)

on reconfigure, check wether the "no fib-update" statement presence/absence
changed.
if it is absent but was present before, call kroute_fib_couple
if it is present but was absent before, call kroute_fib_decouple

Revision 1.42 / (download) - annotate - [select for diffs], Sat Dec 27 00:53:51 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

implement "no fib-update" much cooler

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

erm, oups, well, put back rde_pid and io_pid assignments that got lost
somehow...

Revision 1.40 / (download) - annotate - [select for diffs], Fri Dec 26 20:59:54 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.39: +13 -4 lines
Diff to previous 1.39 (colored)

fix logging in send_nexthop_update

Revision 1.39 / (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.38: +23 -14 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Fri Dec 26 18:07:32 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Fri Dec 26 17:47:04 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.36: +5 -3 lines
Diff to previous 1.36 (colored)

by making kroute_dispatch_msg() and kroute_nexthop_add() return int instead
of void they can now report errors upstream and do not need to panic any
more. so do that and handle the errors in bgpd.c in the vein that we at least
can clean up before exit.
there are no direct fatal() call in kroute.c now any more, nor any in bgpd.c
after forking.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Dec 26 17:15:09 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.35: +45 -31 lines
Diff to previous 1.35 (colored)

overhaul error handling
try to handle as much as possbile in a graceful way so taht we don't leave
the kernel routing table full of our routes, for example.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Dec 26 16:54:10 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

handle kroute_init failures nicer

Revision 1.34 / (download) - annotate - [select for diffs], Fri Dec 26 14:55:03 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

improve log message

Revision 1.33 / (download) - annotate - [select for diffs], Fri Dec 26 14:38:58 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.32: +7 -1 lines
Diff to previous 1.32 (colored)

log nexthop status changes

Revision 1.32 / (download) - annotate - [select for diffs], Fri Dec 26 00:49:52 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.31: +2 -3 lines
Diff to previous 1.31 (colored)

handle IMSG_NEXTHOP_DELETE as well

Revision 1.31 / (download) - annotate - [select for diffs], Fri Dec 26 00:27:23 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

kroute_nexthop_check -> kroute_nexthop_add
kroute_validate_nexthop -> kroute_nexthop_insert

Revision 1.30 / (download) - annotate - [select for diffs], Fri Dec 26 00:14:04 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.29: +21 -1 lines
Diff to previous 1.29 (colored)

finally marry rde and kroute parts of the nexthop verification:
handle IMSG_NEXTHOP_ADD and send IMSG_NEXTHOP_UPDATE when appropriate

Revision 1.29 / (download) - annotate - [select for diffs], Thu Dec 25 17:07:24 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.28: +11 -3 lines
Diff to previous 1.28 (colored)

track routing table changes that are _not_ caused by bgpd itself

ok claudio@

Revision 1.28 / (download) - annotate - [select for diffs], Thu Dec 25 02:24:26 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.27: +2 -7 lines
Diff to previous 1.27 (colored)

kill IMSG_KROUTE_ADD as well. just send KROUTE_CHANGE requests.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Dec 25 02:09:19 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

it actually makes more sense to call the merged function kroute_change

Revision 1.26 / (download) - annotate - [select for diffs], Thu Dec 25 02:04:46 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

kroute_change is obsolete, long live kroute_add

Revision 1.25 / (download) - annotate - [select for diffs], Wed Dec 24 20:09:56 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.24: +3 -22 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Wed Dec 24 19:59:24 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

now that we keep track of the routes we added to the kernel we can remove
them easily on shutdown without the RDE's help

Revision 1.23 / (download) - annotate - [select for diffs], Wed Dec 24 19:22:00 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (colored)

slightly more helpfull error msgs

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

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

Revision 1.21 / (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.20: +2 -2 lines
Diff to previous 1.20 (colored)

spacing

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

send shutdown requests to the child processes and wait for a ackmessage from
them when shutting down.
the rde needs the main process to clean up the routing table on exit so the
parent process needs to be in service until the RDE is done.
ok claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Dec 22 21:48:23 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.18: +8 -8 lines
Diff to previous 1.18 (colored)

delay setting up the signal handlers in the main process until after fork(),
pointed out by theo

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

o add low-level functions for adding/chaining/removing kernel routes
o define new imsg types for this
o process these imsgs in the parent process

now "only" debugging and the rde sending these messages is missing.

ok claudio@

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

uid check later; configtest is useful as non-root

Revision 1.16 / (download) - annotate - [select for diffs], Mon Dec 22 15:07:05 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.15: +11 -3 lines
Diff to previous 1.15 (colored)

add a configtest mode

Revision 1.15 / (download) - annotate - [select for diffs], Mon Dec 22 11:11:25 2003 UTC (20 years, 5 months ago) by miod
Branch: MAIN
Changes since 1.14: +1 -3 lines
Diff to previous 1.14 (colored)

No need to setup a signal handler for SIGKILL as you can't catch it anyway.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Dec 22 11:04:12 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

in the same vein we can plain errx() if the geteuid check fails.

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

when starting up and the configuration has errors, do not call fatal().
plain exit() is enough. we have not yet forked and an error message is already
printed by the parser.
inspired by a theo request

Revision 1.12 / (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.11: +2 -2 lines
Diff to previous 1.11 (colored)

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

Revision 1.11 / (download) - annotate - [select for diffs], Sun Dec 21 23:26:37 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.10: +26 -31 lines
Diff to previous 1.10 (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.10 / (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.9: +45 -56 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Sun Dec 21 18:18:21 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.8: +7 -7 lines
Diff to previous 1.8 (colored)

use pipe(2)s instead of socketpair(2)s.
suggested by tedu@ for a performance gain, ok claudio@

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

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

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

few missing break; in default: cases in switch; one noticed by tedu@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 20 19:17:51 2003 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

spacing

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 20 18:50:40 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.4: +6 -1 lines
Diff to previous 1.4 (colored)

parent: waitpid() for the child processes on exit

Revision 1.4 / (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.3: +2 -1 lines
Diff to previous 1.3 (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.3 / (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.2: +2 -2 lines
Diff to previous 1.2 (colored)

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

Revision 1.2 / (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.1: +17 -11 lines
Diff to previous 1.1 (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.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.