OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.309 / (download) - annotate - [select for diffs], Tue Jan 9 13:41:32 2024 UTC (5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.308: +26 -25 lines
Diff to previous 1.308 (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.308 / (download) - annotate - [select for diffs], Mon Jan 8 15:08:34 2024 UTC (5 months ago) by claudio
Branch: MAIN
Changes since 1.307: +8 -11 lines
Diff to previous 1.307 (colored)

Define and use struct ctl_kroute_req to encode the arguments of
IMSG_CTL_KROUTE instead of doing it by hand.
OK tb@

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

Neither sin_len nor sin6_len can be 0 so these checks are not needed.

Also reorder the RTF_HOST vs netmask check. RTF_HOST wins if both are set.
Makes the code a bit neater.
OK tb@

Revision 1.306 / (download) - annotate - [select for diffs], Mon Oct 16 10:25:45 2023 UTC (7 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.305: +26 -11 lines
Diff to previous 1.305 (colored)

Improve IPv6 link-local address handling

When a session is established determine the possible interface scope of that
session. The scope is only set when the remote address is directly connected.
This interface scope is passed to the RDE that uses this information when
link-local nexthops are received. Again checking that a link-local nexthop
is actually acceptable.

OK tb@

Revision 1.300.2.1 / (download) - annotate - [select for diffs], Wed Jul 12 12:48:18 2023 UTC (10 months, 4 weeks ago) by tb
Branch: OPENBSD_7_2
Changes since 1.300: +2 -2 lines
Diff to previous 1.300 (colored) next main 1.301 (colored)

Check the F_NEXTHOP flag on the right kroute6 object.

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

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

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

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

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

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

Revision 1.304.4.1 / (download) - annotate - [select for diffs], Wed Jul 12 12:47:41 2023 UTC (10 months, 4 weeks ago) by tb
Branch: OPENBSD_7_3
Changes since 1.304: +2 -2 lines
Diff to previous 1.304 (colored) next main 1.305 (colored)

Check the F_NEXTHOP flag on the right kroute6 object.

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

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

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

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

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

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

Revision 1.305 / (download) - annotate - [select for diffs], Thu Jun 1 09:47:34 2023 UTC (12 months, 1 week ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.304: +2 -2 lines
Diff to previous 1.304 (colored)

Check the F_NEXTHOP flag on the right kroute6 object.

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

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

Revision 1.304 / (download) - annotate - [select for diffs], Tue Mar 7 10:30:38 2023 UTC (15 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE
Branch point for: OPENBSD_7_3
Changes since 1.303: +2 -2 lines
Diff to previous 1.303 (colored)

Remove pre-c99 gcc workaround which is no longer needed.

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

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

Revision 1.302 / (download) - annotate - [select for diffs], Wed Nov 9 14:26:14 2022 UTC (19 months ago) by claudio
Branch: MAIN
Changes since 1.301: +11 -1 lines
Diff to previous 1.301 (colored)

Properly handle L3VPN routes in kroute. This got broken while reworking
large part of the code.
Issue reported and fix tested by Bars Bars tutbaranov (at) gmail.com
OK tb@

Revision 1.301 / (download) - annotate - [select for diffs], Tue Oct 18 09:30:29 2022 UTC (19 months, 3 weeks ago) by job
Branch: MAIN
Changes since 1.300: +3 -3 lines
Diff to previous 1.300 (colored)

Fix some spelling errors

Thanks Marco D'Itri for spotting them

OK claudio@

Revision 1.300 / (download) - annotate - [select for diffs], Wed Sep 21 21:12:03 2022 UTC (20 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE
Branch point for: OPENBSD_7_2
Changes since 1.299: +15 -1 lines
Diff to previous 1.299 (colored)

The values for fib_priority are OS dependent. To help portability move
the RTP_BGP and similar defines all into kroute.c and export them via
kr_default_prio() and kr_check_prio().
OK tb@

Revision 1.299 / (download) - annotate - [select for diffs], Thu Sep 15 08:20:14 2022 UTC (20 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.298: +24 -18 lines
Diff to previous 1.298 (colored)

Make kroute_matchgw() also work with connected routes.

Connected routes have no gateway set but only have ifindex set.
When an interface is deconfigured this makes sure the right route is
removed.
OK tb@

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

Add missing #include <sys/queue.h>

Revision 1.297 / (download) - annotate - [select for diffs], Tue Aug 30 12:49:13 2022 UTC (21 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.296: +7 -6 lines
Diff to previous 1.296 (colored)

Reshuffle and cleanup the includes a little bit.

Revision 1.296 / (download) - annotate - [select for diffs], Thu Aug 25 08:10:25 2022 UTC (21 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.295: +7 -8 lines
Diff to previous 1.295 (colored)

Connected routes use the BGP exit nexthop while other routes need to use
the nexthop from the covering route. Move this logic from RDE to the
kroute code so it is all in one place.
OK tb@

Revision 1.295 / (download) - annotate - [select for diffs], Fri Aug 19 09:11:18 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.294: +5 -1 lines
Diff to previous 1.294 (colored)

Fix nexthop lookup for connected routes.

In knexthop_true_nexthop() connected routes need to be handled specially.
If a nexthop is directly reachable the gateway needs to remain the same.
There is no nexthop set for F_CONNECTED kroutes. A very similar trick
is used in rde_rib.c::nexthop_update() but was forgotten here.

Regression noticed by Daniel Jakots (danj at chown.me).
OK tb@

Revision 1.294 / (download) - annotate - [select for diffs], Thu Aug 18 17:02:42 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.293: +6 -3 lines
Diff to previous 1.293 (colored)

In kroute_insert() fix the check for multipath routes. Use a helper variable
since krm is only set for IPv4 routes but not for IPv6 ones.
OK tb@

Revision 1.293 / (download) - annotate - [select for diffs], Thu Aug 18 12:14:00 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.292: +16 -20 lines
Diff to previous 1.292 (colored)

There is no need to pass the fd to send_rtmsg(), the fd is always the
one from kr_state and removing this argument helps portability.
OK tb@

Revision 1.292 / (download) - annotate - [select for diffs], Wed Aug 17 15:15:26 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.291: +22 -22 lines
Diff to previous 1.291 (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.291 / (download) - annotate - [select for diffs], Wed Aug 17 10:54:52 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.290: +58 -62 lines
Diff to previous 1.290 (colored)

Just use struct kif and kill struct kif_node. No need for this extra
struct.
OK tb@

Revision 1.290 / (download) - annotate - [select for diffs], Wed Aug 17 09:16:44 2022 UTC (21 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.289: +2 -2 lines
Diff to previous 1.289 (colored)

Just 2 newline changes.

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

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

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

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

OK tb@

Revision 1.288 / (download) - annotate - [select for diffs], Wed Aug 10 14:21:24 2022 UTC (22 months ago) by tb
Branch: MAIN
Changes since 1.287: +2 -2 lines
Diff to previous 1.287 (colored)

Reverse NULL check in krVPN6_change()

This matches the VPN4 code and avoids a NULL deref in the else branch.

ok claudio

Revision 1.287 / (download) - annotate - [select for diffs], Wed Aug 3 08:16:05 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.286: +27 -17 lines
Diff to previous 1.286 (colored)

Fix a modify after free error in kroute_remove()

knexthop_validate() will modify the kroute the nexthop points to.
Because of this knexthop_validate() needs to be called before the
to be removed kroute is freed. Move the code into kroute_remove[46]
so the order is correct.
Problem found and fix tested by sthen@.
OK sthen@ tb@

Revision 1.286 / (download) - annotate - [select for diffs], Wed Aug 3 08:11:18 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.285: +8 -9 lines
Diff to previous 1.285 (colored)

Fix possible NULL dereference in knexthop_validate().

kroute_match() may return NULL so setting kn->ifindex should only
be done if the kroute is valid. Also set the ifindex to 0 in
kroute_detach_nexthop().
Based on a bigger diff which is OK tb@ and sthen@

Revision 1.285 / (download) - annotate - [select for diffs], Thu Jul 28 14:05:13 2022 UTC (22 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.284: +152 -253 lines
Diff to previous 1.284 (colored)

Rework kroute_remove(), it uses a struct kroute_full and does most of
the work internally. Removes a bunch of duplicated code and simplifies
code further.
Input and OK tb@

Revision 1.284 / (download) - annotate - [select for diffs], Thu Jul 28 13:11:48 2022 UTC (22 months, 2 weeks ago) by deraadt
Branch: MAIN
Changes since 1.283: +4 -4 lines
Diff to previous 1.283 (colored)

whitespace found during a read-thru; ok claudio

Revision 1.283 / (download) - annotate - [select for diffs], Wed Jul 27 17:23:17 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.282: +65 -39 lines
Diff to previous 1.282 (colored)

There is no need to track both F_BGPD and F_KERNEL anymore.
Remove F_KERNEL and replace the checks using the F_BGPD flag.
Also do not convert the priority in kr_tofull() instead provide
kr_priority() which does this and is used by the bgpctl imsg
commands. Also in dispatch_rtmsg_addr() convert to RTP_MINE if
the priority is equal to the configured priority.
OK tb@

Revision 1.282 / (download) - annotate - [select for diffs], Tue Jul 26 17:12:40 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.281: +4 -7 lines
Diff to previous 1.281 (colored)

No need to check RB_REMOVE() return value if kif is not NULL.
Therefor check that in the IFAN_DEPARTURE case the interface was found
before calling kif_remove.
Idea and OK tb@

Revision 1.281 / (download) - annotate - [select for diffs], Tue Jul 26 16:36:33 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.280: +2 -2 lines
Diff to previous 1.280 (colored)

Missing indirection. This version compiles.

Revision 1.280 / (download) - annotate - [select for diffs], Tue Jul 26 16:32:29 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.279: +30 -228 lines
Diff to previous 1.279 (colored)

Refactor nexthop tracking and remove all the kif_kr code. There is no
need to track directly connected routes per kif. The only use case was
for nexthop validation but that can be done by storing the ifindex in
struct knexthop.
OK tb@

Revision 1.279 / (download) - annotate - [select for diffs], Sat Jul 23 10:24:01 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.278: +5 -7 lines
Diff to previous 1.278 (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.278 / (download) - annotate - [select for diffs], Fri Jul 22 17:26:58 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.277: +21 -27 lines
Diff to previous 1.277 (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.277 / (download) - annotate - [select for diffs], Fri Jul 22 11:17:48 2022 UTC (22 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.276: +27 -21 lines
Diff to previous 1.276 (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.276 / (download) - annotate - [select for diffs], Thu Jul 21 10:22:43 2022 UTC (22 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.275: +198 -346 lines
Diff to previous 1.275 (colored)

Make kr_redistribute() and kroute_insert() AID independent and use
struct kroute_full. This removes some of the duplicated code.
OK tb@

Revision 1.275 / (download) - annotate - [select for diffs], Wed Jul 20 12:43:27 2022 UTC (22 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.274: +7 -13 lines
Diff to previous 1.274 (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.274 / (download) - annotate - [select for diffs], Tue Jul 19 10:26:19 2022 UTC (22 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.273: +121 -121 lines
Diff to previous 1.273 (colored)

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

Revision 1.273 / (download) - annotate - [select for diffs], Mon Jul 18 23:09:44 2022 UTC (22 months, 3 weeks ago) by deraadt
Branch: MAIN
Changes since 1.272: +2 -2 lines
Diff to previous 1.272 (colored)

use syntax which more acceptable to older compilers
discussed with tb

Revision 1.272 / (download) - annotate - [select for diffs], Thu Jul 14 12:56:37 2022 UTC (22 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.271: +18 -3 lines
Diff to previous 1.271 (colored)

More IPv6 scope_id fixes, now hopefully scope_id should be handled
correctly in kroute.c
OK tb@

Revision 1.271 / (download) - annotate - [select for diffs], Thu Jun 30 20:33:14 2022 UTC (23 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.270: +168 -294 lines
Diff to previous 1.270 (colored)

Only have one version of send_rtmsg() which uses struct kroute_full().

Code uses struct sockaddr_storage to have enough space for ROUNDUP() in
all cases. Makes the code mostly nicer.
OK tb@

Revision 1.270 / (download) - annotate - [select for diffs], Sat Jun 25 19:21:27 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.269: +36 -15 lines
Diff to previous 1.269 (colored)

Since 128bit addressing is not enough add some addition 32bit of
scope_id to struct kroute6 to make link local addresses work.
OK tb@

Revision 1.269 / (download) - annotate - [select for diffs], Fri Jun 24 10:36:53 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.268: +3 -3 lines
Diff to previous 1.268 (colored)

Use IN6_IS_ADDR_MC_NODELOCAL() instead of IN6_IS_ADDR_MC_INTFACELOCAL().
It seems that IN6_IS_ADDR_MC_NODELOCAL() is the official name of this
nightmare and therefor more portable.
OK tb@

Revision 1.268 / (download) - annotate - [select for diffs], Thu Jun 23 13:09:03 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.267: +25 -4 lines
Diff to previous 1.267 (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.267 / (download) - annotate - [select for diffs], Thu Jun 23 10:22:23 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.266: +3 -3 lines
Diff to previous 1.266 (colored)

Fix comments

Revision 1.266 / (download) - annotate - [select for diffs], Thu Jun 23 09:54:31 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.265: +10 -1 lines
Diff to previous 1.265 (colored)

Thanks IPv6 for being extra complex. Recover scope_id for link local addrs.
OK tb@

Revision 1.265 / (download) - annotate - [select for diffs], Thu Jun 23 07:43:37 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.264: +451 -475 lines
Diff to previous 1.264 (colored)

Replace struct kroute_node and kroute6_node with direct versions of
struct kroute and kroute6.

Rename knexthop_node to knexthop as well. Mostly mechanical but fix
at least one log format string to have the correct order of arguments.

OK tb@

Revision 1.264 / (download) - annotate - [select for diffs], Wed Jun 22 15:24:58 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.263: +23 -1 lines
Diff to previous 1.263 (colored)

Move struct kroute and kroute6 to kroute.c and out of bgpd.h
OK tb@

Revision 1.263 / (download) - annotate - [select for diffs], Wed Jun 22 14:56:12 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.262: +6 -4 lines
Diff to previous 1.262 (colored)

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

OK tb@

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

Use struct kroute_full instead of a union of struct kroute & kroute6.

struct kroute_full is address family independent and so more portable.
Also struct kroute and struct kroute6 will be kroute.c internal soon.
OK tb@

Revision 1.261 / (download) - annotate - [select for diffs], Wed Jun 22 12:28:33 2022 UTC (23 months, 2 weeks ago) by claudio
Branch: MAIN
Changes since 1.260: +1 -3 lines
Diff to previous 1.260 (colored)

Remove comment which is no longer true.

Revision 1.260 / (download) - annotate - [select for diffs], Sun Jun 19 10:30:09 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.259: +30 -40 lines
Diff to previous 1.259 (colored)

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

Revision 1.259 / (download) - annotate - [select for diffs], Thu Jun 16 15:36:36 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.258: +3 -3 lines
Diff to previous 1.258 (colored)

Neither inet4allone nor inet6allone need global scope. Make them static.
Noticed by tb@

Revision 1.258 / (download) - annotate - [select for diffs], Thu Jun 16 15:33:05 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.257: +32 -41 lines
Diff to previous 1.257 (colored)

Remove prefixlen2mask() uasge outside of util.c. Instead use inet4applymask().

Using inet4applymask() makes the code similar to the IPv6 version.
Also switch kroute{,6}_match() to use a struct bgpd_addr * as argument.
OK tb@

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

Need to continue to the next message for route messages with errors
or which are not marked RTF_DONE. Possible fix for bgpd exiting for
no obvious reason. Found with help from florian@
OK florian@

Revision 1.256 / (download) - annotate - [select for diffs], Wed Jun 15 10:10:03 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.255: +39 -83 lines
Diff to previous 1.255 (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.255 / (download) - annotate - [select for diffs], Tue Jun 14 14:06:48 2022 UTC (23 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.254: +2 -1 lines
Diff to previous 1.254 (colored)

Add my copyright, I think I added enough code to justify it.

Revision 1.254 / (download) - annotate - [select for diffs], Mon Jun 13 09:57:44 2022 UTC (23 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.253: +229 -348 lines
Diff to previous 1.253 (colored)

Split dispatch_rtmsg_addr() into a function parsing a route message
into a struct kroute_full and then two functions to add/change or delete
that route from the kroute tree.
Cleanup some additional things and use the same parse funtion in fetchtable.
OK tb@

Revision 1.253 / (download) - annotate - [select for diffs], Thu Jun 9 16:53:14 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.252: +2 -2 lines
Diff to previous 1.252 (colored)

Change argument of ktable_get from ifd->ifi_rdomain to kif->k.rdomain.
It is the same value but using the kif seems better.

Revision 1.252 / (download) - annotate - [select for diffs], Thu Jun 9 16:45:19 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.251: +23 -32 lines
Diff to previous 1.251 (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.251 / (download) - annotate - [select for diffs], Tue Jun 7 16:42:07 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.250: +13 -18 lines
Diff to previous 1.250 (colored)

Try to be more precise with rtlabelid tracking.

By moving the rtlabel_unref into kroute_remove the unref is more reliable.
There are still places where handling is not quite right but it is a step
in the right direction.
OK tb@

Revision 1.250 / (download) - annotate - [select for diffs], Tue Jun 7 16:12:00 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.249: +2 -2 lines
Diff to previous 1.249 (colored)

uint8_t not u_int8_t. Damn finger memory.

Revision 1.249 / (download) - annotate - [select for diffs], Tue Jun 7 15:57:47 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.248: +3 -12 lines
Diff to previous 1.248 (colored)

Retire F_RTLABEL it was not used for anything.
Also cleanup some redundant if statements.
OK tb@

Revision 1.248 / (download) - annotate - [select for diffs], Sun Jun 5 12:43:13 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.247: +98 -125 lines
Diff to previous 1.247 (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.247 / (download) - annotate - [select for diffs], Thu Jun 2 09:29:34 2022 UTC (2 years ago) by claudio
Branch: MAIN
Changes since 1.246: +2 -2 lines
Diff to previous 1.246 (colored)

Cleanup ktable_exists() usage and its warning message.

Check the return value in all cases and use a common idiom for this check.
OK tb@

Revision 1.246 / (download) - annotate - [select for diffs], Mon May 23 13:40:12 2022 UTC (2 years ago) by deraadt
Branch: MAIN
Changes since 1.245: +3 -3 lines
Diff to previous 1.245 (colored)

whitespaces found when I went checking for something else

Revision 1.245 / (download) - annotate - [select for diffs], Fri May 6 15:51:09 2022 UTC (2 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.244: +3 -4 lines
Diff to previous 1.244 (colored)

Relax the limitation of what is an acceptable unicast IP.

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

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

OK deraadt@ tb@

Revision 1.244 / (download) - annotate - [select for diffs], Tue Mar 8 12:58:57 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.243: +2 -2 lines
Diff to previous 1.243 (colored)

No need to print fetchtable twice in this error message.

Revision 1.243 / (download) - annotate - [select for diffs], Thu Mar 3 11:19:41 2022 UTC (2 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.242: +1 -3 lines
Diff to previous 1.242 (colored)

Remove the labelid from struct kroute_full. It was never really used.
The label is passed as a string in kroute_full.
Ok tb@

Revision 1.242 / (download) - annotate - [select for diffs], Sun Feb 6 09:51:19 2022 UTC (2 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.241: +76 -76 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], Mon Jan 18 12:15:36 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.240: +15 -16 lines
Diff to previous 1.240 (colored)

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

Revision 1.240 / (download) - annotate - [select for diffs], Tue Dec 29 09:20:25 2020 UTC (3 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.239: +19 -12 lines
Diff to previous 1.239 (colored)

Only skip routes with a loopback gateway for network static and connected.
For network rtlabel and priority skip this check since there the operator
may actually want to distribute this network explicitly (even though it is
probably a reject or blackhole route).
Requested by dlg@ OK benno@

Revision 1.239 / (download) - annotate - [select for diffs], Tue Oct 1 08:57:48 2019 UTC (4 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.238: +4 -3 lines
Diff to previous 1.238 (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.238 / (download) - annotate - [select for diffs], Thu Aug 8 20:06:29 2019 UTC (4 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.237: +2 -2 lines
Diff to previous 1.237 (colored)

Use O_CLOEXEC or SOCK_CLOEXEC on every open or socket call. Even though
some sockets are open for a short time it does not hurt and it ensures
that there is no file descriptor leak.
OK deraadt@ bluhm@

Revision 1.237 / (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.236: +54 -10 lines
Diff to previous 1.236 (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.235.2.1 / (download) - annotate - [select for diffs], Fri Jun 7 15:04:05 2019 UTC (5 years ago) by sthen
Branch: OPENBSD_6_5
Changes since 1.235: +11 -12 lines
Diff to previous 1.235 (colored) next main 1.236 (colored)

MFC bgpd fix - rev 1.236 (commitid: cMekh4Uss55PgVUe)

Fix reloading of network statements that have no fixed prefix specification.
The return value of kr_net_redist_add() was not as intended and so
kr_redistribute() removed those networks on config reloads.

Revision 1.236 / (download) - annotate - [select for diffs], Mon May 6 09:49:26 2019 UTC (5 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.235: +11 -12 lines
Diff to previous 1.235 (colored)

Fix reloading of network statements that have no fixed prefix specification.
The return value of kr_net_redist_add() was not as intended and so
kr_redistribute() removed those networks on config reloads.
Bug reported by openbsd (at) kene.nu
OK benno@

Revision 1.235 / (download) - annotate - [select for diffs], Thu Mar 7 07:42:36 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE
Branch point for: OPENBSD_6_5
Changes since 1.234: +17 -1 lines
Diff to previous 1.234 (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.234 / (download) - annotate - [select for diffs], Fri Mar 1 09:24:56 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.233: +12 -9 lines
Diff to previous 1.233 (colored)

Need to be more careful in kr_net_redist_add() when adding an already
present network to the list of announcements. Until now this leaked non-dynamic
objects on config reload.
Noticed and reported by florian@
Looks good benno@

Revision 1.233 / (download) - annotate - [select for diffs], Thu Feb 21 11:17:22 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.232: +82 -4 lines
Diff to previous 1.232 (colored)

Media and link states are highly OS dependent, to make porting easier
export the interface info in a way that does not need OS specific functions
to print it. Link state and media are now strings that are set by bgpd.
bgpctl can just print them. Move get_linkstate and get_media_descr to
kroute.c where all other system specific stuff is.
OK sthen@

Revision 1.232 / (download) - annotate - [select for diffs], Mon Feb 18 09:58:19 2019 UTC (5 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.231: +40 -1 lines
Diff to previous 1.231 (colored)

Move get_mpe_config() to kroute.c so that config.c does not depend on
system specific code.

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

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

Revision 1.230 / (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.229: +227 -206 lines
Diff to previous 1.229 (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.229 / (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.228: +20 -22 lines
Diff to previous 1.228 (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.228 / (download) - annotate - [select for diffs], Sun Dec 30 13:53:07 2018 UTC (5 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.227: +139 -2 lines
Diff to previous 1.227 (colored)

add support for IPv6 VPN routes

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

OK claudio@

Revision 1.227 / (download) - annotate - [select for diffs], Fri Dec 28 22:05:15 2018 UTC (5 years, 5 months ago) by denis
Branch: MAIN
Changes since 1.226: +13 -13 lines
Diff to previous 1.226 (colored)

move kroute_find() call later

No need to scan the list if we return early.

OK claudio@

Revision 1.226 / (download) - annotate - [select for diffs], Thu Dec 6 13:04:40 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.225: +14 -10 lines
Diff to previous 1.225 (colored)

Be more strict when converting a netmask to prefixlen in mask2prefixlen6.
Make sure we never return a value bigger than 128.
OK remi@

Revision 1.225 / (download) - annotate - [select for diffs], Mon Nov 5 07:01:15 2018 UTC (5 years, 7 months ago) by denis
Branch: MAIN
Changes since 1.224: +2 -2 lines
Diff to previous 1.224 (colored)

F_RIB_HASNOFIB is defined, let's use it

OK claudio@

Revision 1.224 / (download) - annotate - [select for diffs], Sat Sep 29 19:25:32 2018 UTC (5 years, 8 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.223: +77 -2 lines
Diff to previous 1.223 (colored)

Fix problems with redistribution of routes by route label.
Bug report from Jon Williams, jon AT jonwillia DOT ms, thanks.
ok claudio@

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

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

Revision 1.222 / (download) - annotate - [select for diffs], Sun Jul 22 16:55:01 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.221: +7 -3 lines
Diff to previous 1.221 (colored)

Add more information to if_change() debug log using the new interface helper
functions in util.c. The idea is to make even debug messages as informative
as possible.
Before:
if_change: ifindex 1, ifi_rdomain 0
After:
if_change: em0: rdomain 0 UP, Ethernet, active, 1000 Mbps
OK benno@

Revision 1.221 / (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.220: +26 -22 lines
Diff to previous 1.220 (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.220 / (download) - annotate - [select for diffs], Thu Jul 12 21:45:37 2018 UTC (5 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.219: +3 -1 lines
Diff to previous 1.219 (colored)

store and print the rdomain of the interfaces we see.
ok phessler@ henning@

Revision 1.219 / (download) - annotate - [select for diffs], Wed Jul 11 14:08:46 2018 UTC (5 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.218: +9 -1 lines
Diff to previous 1.218 (colored)

add option "network ... priority number" to announce prefixes from the
kernel routing table selected by priority.
For example to import all ospfd/ospf6d routes into bgp.
tested by remi@
ok remi@ henning@ and maybe a little claudio@

Revision 1.218 / (download) - annotate - [select for diffs], Tue Jul 10 13:06:28 2018 UTC (5 years, 11 months ago) by benno
Branch: MAIN
Changes since 1.217: +74 -73 lines
Diff to previous 1.217 (colored)

__func__ log statements and some whitespace knf
ok^H^HHmpf, whatever claudio@

Revision 1.217 / (download) - annotate - [select for diffs], Wed Nov 29 19:40:47 2017 UTC (6 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.216: +3 -1 lines
Diff to previous 1.216 (colored)

Insert MPLS VPN routes with the RTF_GATEWAY flag cleared. mpe(4) is now
expecting this and will use the route gateway and the mpls label to forward
packets. This plus the other diffs to if_mpe.c and route.c should fix
L3 MPLS VPNs. Problem reported by henning@

Revision 1.216 / (download) - annotate - [select for diffs], Mon Jul 24 11:00:01 2017 UTC (6 years, 10 months ago) by friehm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.215: +3 -3 lines
Diff to previous 1.215 (colored)

Unify ROUNDUP macros for parsing route messages.
Use the macro from route(8) / ospf6d(8) since it works also with argument 0.

OK claudio@

Revision 1.215 / (download) - annotate - [select for diffs], Wed May 31 10:47:21 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.214: +3 -24 lines
Diff to previous 1.214 (colored)

Oups, that should have not been committed. Revert.

Revision 1.214 / (download) - annotate - [select for diffs], Wed May 31 10:44:00 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.213: +24 -3 lines
Diff to previous 1.213 (colored)

Rework the way we do extended communities (mainly in the parser) and update
the IANA table to a somewhat more complete list. This includes BGP Prefix
Origin Validation State support via the ext-community ovs keyword.
OK henning@ benno@ based on a diff by Job Snijders

Revision 1.213 / (download) - annotate - [select for diffs], Sun May 28 15:16:33 2017 UTC (7 years ago) by henning
Branch: MAIN
Changes since 1.212: +9 -2 lines
Diff to previous 1.212 (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.212 / (download) - annotate - [select for diffs], Tue Mar 28 05:04:09 2017 UTC (7 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.211: +5 -4 lines
Diff to previous 1.211 (colored)

For IPv6 pass prefix not nexthop as network for connected nexthops back to
the RDE so that the code actually works.
Problem found and reported by Pier Carlo Chiodi (pierky at pierky com)
OK deraadt@

Revision 1.211 / (download) - annotate - [select for diffs], Tue Jan 24 04:22:42 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.210: +2 -1 lines
Diff to previous 1.210 (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.210 / (download) - annotate - [select for diffs], Wed Oct 5 07:38:06 2016 UTC (7 years, 8 months ago) by phessler
Branch: MAIN
Changes since 1.209: +30 -1 lines
Diff to previous 1.209 (colored)

Let bgpd announce routes based on a route-label.

OK henning@ benno@

Revision 1.204.4.2 / (download) - annotate - [select for diffs], Tue Apr 12 09:01:05 2016 UTC (8 years, 2 months ago) by phessler
Branch: OPENBSD_5_8
Changes since 1.204.4.1: +3 -3 lines
Diff to previous 1.204.4.1 (colored) to branchpoint 1.204 (colored) next main 1.205 (colored)

MFC

revision 1.209 by phessler@

When bgp receives an RTM_CHANGE message for an RTF_MPATH route[1], and
it finds it actually on an interface, bgpd can get confused.  In this
case, just log it and treat it as an RTM_ADD so bgpd doesn't suicide.

[1] includes all ospfd installed routes, btw.

OK benno@ sthen@

Revision 1.207.2.2 / (download) - annotate - [select for diffs], Tue Apr 12 08:58:56 2016 UTC (8 years, 2 months ago) by phessler
Branch: OPENBSD_5_9
Changes since 1.207.2.1: +3 -3 lines
Diff to previous 1.207.2.1 (colored) to branchpoint 1.207 (colored) next main 1.208 (colored)

MFC

revision 1.209 by phessler@

When bgp receives an RTM_CHANGE message for an RTF_MPATH route[1], and
it finds it actually on an interface, bgpd can get confused.  In this
case, just log it and treat it as an RTM_ADD so bgpd doesn't suicide.

[1] includes all ospfd installed routes, btw.

OK benno@ sthen@

Revision 1.209 / (download) - annotate - [select for diffs], Fri Apr 8 12:27:05 2016 UTC (8 years, 2 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.208: +3 -3 lines
Diff to previous 1.208 (colored)

When bgp receives an RTM_CHANGE message for an RTF_MPATH route[1], and
it finds it actually on an interface, bgpd can get confused.  In this
case, just log it and treat it as an RTM_ADD so bgpd doesn't suicide.

[1] includes all ospfd installed routes, btw.

OK benno@ sthen@

Revision 1.204.4.1 / (download) - annotate - [select for diffs], Wed Mar 23 13:43:08 2016 UTC (8 years, 2 months ago) by phessler
Branch: OPENBSD_5_8
Changes since 1.204: +10 -1 lines
Diff to previous 1.204 (colored)

MFC

revision 1.208 by claudio@
Connected routes are no longer identified by a AF_LINK gateway so adjust
dispatch_rtmsg_addr() similar to the way fetchtable() was fixed long ago.
This should fix various issues with bad gateways being picked up by bgpd.
Problem identified and initial fix provided by phessler@ but commiting
my version which is more conservative. OK phessler@

Revision 1.207.2.1 / (download) - annotate - [select for diffs], Wed Mar 23 13:41:37 2016 UTC (8 years, 2 months ago) by phessler
Branch: OPENBSD_5_9
Changes since 1.207: +10 -1 lines
Diff to previous 1.207 (colored)

MFC

revision 1.208
Connected routes are no longer identified by a AF_LINK gateway so adjust
dispatch_rtmsg_addr() similar to the way fetchtable() was fixed long ago.
This should fix various issues with bad gateways being picked up by bgpd.
Problem identified and initial fix provided by phessler@ but commiting
my version which is more conservative. OK phessler@

Revision 1.208 / (download) - annotate - [select for diffs], Tue Mar 22 15:53:00 2016 UTC (8 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.207: +10 -1 lines
Diff to previous 1.207 (colored)

Connected routes are no longer identified by a AF_LINK gateway so adjust
dispatch_rtmsg_addr() similar to the way fetchtable() was fixed long ago.
This should fix various issues with bad gateways being picked up by bgpd.
Problem identified and initial fix provided by phessler@ but commiting
my version which is more conservative. OK phessler@

Revision 1.207 / (download) - annotate - [select for diffs], Sat Dec 5 18:28:04 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE
Branch point for: OPENBSD_5_9
Changes since 1.206: +27 -27 lines
Diff to previous 1.206 (colored)

cleanup some log messages with wrong function names etc.
ok henning,claudio

Revision 1.206 / (download) - annotate - [select for diffs], Thu Oct 22 11:13:16 2015 UTC (8 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.205: +5 -3 lines
Diff to previous 1.205 (colored)

If we receive an empty route message, log it and ignore it.  Happens
occasionally on FreeBSD.

from Melissa Jenkins

OK claudio@, florian@, benno@

Revision 1.205 / (download) - annotate - [select for diffs], Wed Sep 16 20:25:41 2015 UTC (8 years, 8 months ago) by stsp
Branch: MAIN
Changes since 1.204: +3 -3 lines
Diff to previous 1.204 (colored)

Another ifmedia64 fix, this time for bgpd's ift2ifm().
And rename struct kif's media_type to if_type to avoid confusion with
ifmedia's media type. Same rename in other daemons will follow.
ok claudio henning benno

Revision 1.204 / (download) - annotate - [select for diffs], Fri Jul 17 20:03:54 2015 UTC (8 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE
Branch point for: OPENBSD_5_8
Changes since 1.203: +3 -3 lines
Diff to previous 1.203 (colored)

Only filter RTF_LLINFO or RTF_BROADCAST routes out but not RTF_LOCAL ones
since we need those for loopback and point-to-point interfaces.
OK mpi@

Revision 1.203 / (download) - annotate - [select for diffs], Wed Jul 8 08:03:46 2015 UTC (8 years, 11 months ago) by mpi
Branch: MAIN
Changes since 1.202: +19 -2 lines
Diff to previous 1.202 (colored)

Check for RTF_CONNECTED to track interface (connected) routes.

Make bgpd(8) properly handle interface routes since they no
longer have a "gateway" sockaddr of type AF_LINK.  Regression
reported by <mxb AT alumni DOT chalmers DOT se> and benno@

While here document traditional BSD connected route assumption.

ok claudio@, benno@

Revision 1.202 / (download) - annotate - [select for diffs], Wed Feb 11 05:48:53 2015 UTC (9 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.201: +2 -2 lines
Diff to previous 1.201 (colored)

Use sizeof(u_short) in the first check since there are RT messages that
are less then sizeof(*rtm) bytes long (e.g. interface announcements).
Found the hard way by phessler@

Revision 1.201 / (download) - annotate - [select for diffs], Tue Feb 10 05:18:39 2015 UTC (9 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.200: +8 -3 lines
Diff to previous 1.200 (colored)

Make also the special sockets SOCK_NONBLOCK. For the routing socket add
a trigger for the case that not a full message has been read. Should not
be possible but lets see if this triggers somewhen.
With and OK henning@

Revision 1.200 / (download) - annotate - [select for diffs], Mon Feb 9 11:37:31 2015 UTC (9 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.199: +3 -2 lines
Diff to previous 1.199 (colored)

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

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

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

Revision 1.198 / (download) - annotate - [select for diffs], Mon Jun 23 03:46:17 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.197: +4 -4 lines
Diff to previous 1.197 (colored)

The second level of the CTL_NET sysctl is a PF_*, not an AF_*

inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)

Revision 1.197 / (download) - annotate - [select for diffs], Thu Jan 23 23:26:56 2014 UTC (10 years, 4 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.196: +9 -11 lines
Diff to previous 1.196 (colored)

allow the somewhat special case
  match ... set nexthop ( 127.0.0.1 | ::1 )
  match ... set nexthop blackhole
to make a route valid before setting the blackhole flag on it.
ok florian, claudio

Revision 1.196 / (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.195: +129 -72 lines
Diff to previous 1.195 (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.195 / (download) - annotate - [select for diffs], Wed May 22 21:00:36 2013 UTC (11 years ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.194: +2 -1 lines
Diff to previous 1.194 (colored)

Set the correct route priority in send_rt6msg, as done for send_rtmsg.
Fixes v6 routes being added to the kernel as RTP_DEFAULT.  ok florian@ benno@

Revision 1.194 / (download) - annotate - [select for diffs], Wed May 22 20:39:12 2013 UTC (11 years ago) by sthen
Branch: MAIN
Changes since 1.193: +3 -3 lines
Diff to previous 1.193 (colored)

whitespace nits

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

less includes

Revision 1.192 / (download) - annotate - [select for diffs], Thu Mar 14 14:53:52 2013 UTC (11 years, 2 months ago) by florian
Branch: MAIN
Changes since 1.191: +10 -4 lines
Diff to previous 1.191 (colored)

use after free; 33% found by llvm
OK sthen@

Revision 1.191 / (download) - annotate - [select for diffs], Tue Nov 13 22:07:28 2012 UTC (11 years, 6 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (colored)

pasto in log message
ok henning

Revision 1.190 / (download) - annotate - [select for diffs], Fri Jul 13 16:57:35 2012 UTC (11 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.189: +112 -176 lines
Diff to previous 1.189 (colored)

Cleanup the knexthop mess and make sure we only send an update to the RDE
when there was a change in the nexthop info. Fixes massive memory consumption
crashes when used with ospfd (which sometimes updates route that have not
changed). Tested together with benno@ and a lot of input from Florian Obser.
OK henning@

Revision 1.189 / (download) - annotate - [select for diffs], Sun May 27 18:52:07 2012 UTC (12 years ago) by claudio
Branch: MAIN
Changes since 1.188: +7 -1 lines
Diff to previous 1.188 (colored)

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

Revision 1.188 / (download) - annotate - [select for diffs], Sun May 1 12:56:04 2011 UTC (13 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.187: +3 -1 lines
Diff to previous 1.187 (colored)

On reload the filtersets attached to a network need to be moved to the
existing network element. First free the old filterset and then move
the new on top of it. This solves the reload issue with changing network
statements. OK henning@

Revision 1.187 / (download) - annotate - [select for diffs], Mon Mar 7 07:43:02 2011 UTC (13 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.186: +2 -2 lines
Diff to previous 1.186 (colored)

continguous -> contiguous
From: "Anthony J. Bentley" <anthonyjbentley at gmail dot com>

Revision 1.186 / (download) - annotate - [select for diffs], Mon Oct 11 11:45:57 2010 UTC (13 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.185: +8 -1 lines
Diff to previous 1.185 (colored)

bgpd needs to see all routing messages so set the ROUTE_TABLEFILTER to
RTABLE_ANY.
OK henning@

Revision 1.185 / (download) - annotate - [select for diffs], Thu Sep 30 08:57:37 2010 UTC (13 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.184: +2 -2 lines
Diff to previous 1.184 (colored)

Only 6 elements of mib are used so do allocate 6 not 7.

Revision 1.184 / (download) - annotate - [select for diffs], Thu Sep 2 14:03:21 2010 UTC (13 years, 9 months ago) by sobrado
Branch: MAIN
Changes since 1.183: +3 -3 lines
Diff to previous 1.183 (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.183 / (download) - annotate - [select for diffs], Mon Jul 12 14:35:13 2010 UTC (13 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.182: +9 -29 lines
Diff to previous 1.182 (colored)

Merge duplicate log messages into one log_warn().
ok claudio@

Revision 1.182 / (download) - annotate - [select for diffs], Thu Jun 3 21:19:06 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.181: +6 -6 lines
Diff to previous 1.181 (colored)

Instead of doing a poor mans offsetof() implementation change the code
to use an end pointer to compare against. Looks less scary and makes
gcc4 happy. OK henning@

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

When installing MPLS VPN routes set the RTF_MPLS bit since those routes
have MPLS information connected to them and the kernel requires the flag now.
OK michele@

Revision 1.180 / (download) - annotate - [select for diffs], Tue May 18 12:21:33 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.179: +11 -8 lines
Diff to previous 1.179 (colored)

Be more careful in ktable_update() and ktable_new() and the fib sync flag.
Only existing tables should keep their fib sync state, new ones should set
the current fib sync flag to the configured one at the end of the config
load.  Found the hard way by sthen@, OK sthen@

Revision 1.179 / (download) - annotate - [select for diffs], Mon May 17 15:49:29 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.178: +340 -87 lines
Diff to previous 1.178 (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.178 / (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.177: +545 -251 lines
Diff to previous 1.177 (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.177 / (download) - annotate - [select for diffs], Tue Apr 13 09:09:48 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.176: +167 -103 lines
Diff to previous 1.176 (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.176 / (download) - annotate - [select for diffs], Tue Apr 6 13:25:08 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.175: +29 -11 lines
Diff to previous 1.175 (colored)

Switch to a more address family independent nexthop imsg. Instead of passing
struct kroute or kroute6 pack the needed info into a struct bgpd_addr.
No flames comming out of my and sthen@'s bgpd routers.

Revision 1.175 / (download) - annotate - [select for diffs], Fri Feb 26 15:50:20 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.174: +4 -4 lines
Diff to previous 1.174 (colored)

Fix some minor issues. 0 instead of NULL in one comparison. Set the
right flags when protecting the IPv6 loopback addr (instead of reassigning
the IPv4 ones) and install the IPv4 loopback blocker as 127/8 and not as
127.0.0.1/8. First two found by Hiroki Sato hrs (at) allbsd org and I found
the 127/8 issue all by myself.

Revision 1.174 / (download) - annotate - [select for diffs], Tue Feb 23 16:06:04 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.173: +2 -2 lines
Diff to previous 1.173 (colored)

Remove some extra ().

Revision 1.173 / (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.172: +44 -43 lines
Diff to previous 1.172 (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.172 / (download) - annotate - [select for diffs], Thu Jul 23 14:53:20 2009 UTC (14 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.171: +7 -16 lines
Diff to previous 1.171 (colored)

Send the used kroute along with the nexthop information. This allows us
to show all necessary information in bgpctl show next. OK henning@

Revision 1.171 / (download) - annotate - [select for diffs], Thu Jul 23 10:20:44 2009 UTC (14 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.170: +15 -12 lines
Diff to previous 1.170 (colored)

knexthop_compare() failed to compare correctly and because of this it was
possible to corrupt the nexthop RB tree. Use the same compare logic used
in the kroute compare functions. Nice side effect is a nicely sorted list
in bgpctl show next. OK sthen@ henning@

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

Include more info in the bgpctl show nexthop ctl message. Mainly add the
gateway used for non-connected routes. This info was missing all the time
and often resulted in massive confusion when the nexthop selection choosed
a bad nexthop.

Revision 1.169 / (download) - annotate - [select for diffs], Thu Jun 25 15:54:22 2009 UTC (14 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.168: +5 -1 lines
Diff to previous 1.168 (colored)

Add missing RTM_VERSION checks. Bad me, no cockies.
Tested and OK sthen@, OK henning@

Revision 1.168 / (download) - annotate - [select for diffs], Fri Jun 12 16:42:53 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.167: +1 -27 lines
Diff to previous 1.167 (colored)

Move prefixlen2mask and inet6applymask to util.c so that we can kill the
copies in bgpctl.

Revision 1.167 / (download) - annotate - [select for diffs], Fri Jun 5 22:40:24 2009 UTC (15 years ago) by chris
Branch: MAIN
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored)

rtm->rtm_hdrlen conversion

ok claudio@, henning@

Revision 1.166 / (download) - annotate - [select for diffs], Mon May 25 11:49:47 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored)

In dispatch_rtmsg_addr() don't fatal on missing multipath deletes. Not 100%
sure why it happens but it is not a fatal condition. A warning should still
be logged because it is not good to miss updates.

Revision 1.165 / (download) - annotate - [select for diffs], Wed Feb 11 20:07:04 2009 UTC (15 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.164: +24 -22 lines
Diff to previous 1.164 (colored)

Because IPv6 fucked up and created a badly sized struct sockaddr_in6 we need
to add some pading on 64bit archs. Use a helper struct plus some ROUNDUP()
magic to get the size correct.
Tested on i386 and amd64 by Graeme Lee "graeme (at) omni (dot) net (dot) au"
Some sort of OK by henning@ (he ignores the non-v4 code)

Revision 1.164 / (download) - annotate - [select for diffs], Mon Feb 9 08:20:11 2009 UTC (15 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored)

Correct function name in warning to avoid confusion. After a discussion on
misc@

Revision 1.163 / (download) - annotate - [select for diffs], Thu Jan 1 15:32:35 2009 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.162: +1 -4 lines
Diff to previous 1.162 (colored)

Remove unneeded debug messages that made it into the tree.

Revision 1.162 / (download) - annotate - [select for diffs], Fri Dec 12 23:15:12 2008 UTC (15 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.161: +294 -79 lines
Diff to previous 1.161 (colored)

Make bgpd route priority aware and while there sync in the basics to correctly
track multipath routes. Code is mostly stolen from similar fixes to ospfd but
a bit different as this kroute.c implementation is more complex because of
additional task (nexthop verification for example).
This change and the similar ospfd change were desperatly needed on larger
complex network setups which tended to end up in situation where the kernel
had a different oppinion about routing than the daemon. Now the situation
should be a lot better.
Tested and OK sthen@ gollo@

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

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

Revision 1.160 / (download) - annotate - [select for diffs], Fri May 9 12:45:25 2008 UTC (16 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.159: +2 -1 lines
Diff to previous 1.159 (colored)

insert/delete routes with priority RTP_BGP
this is mostly cosmetical for the moment, there are bigger changes required
to make full use of the route priorities, but this is the first step to do.
discussed with claudio

Revision 1.159 / (download) - annotate - [select for diffs], Thu May 8 13:07:22 2008 UTC (16 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored)

backout shit committed on accident

Revision 1.158 / (download) - annotate - [select for diffs], Thu May 8 07:40:03 2008 UTC (16 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.157: +5 -5 lines
Diff to previous 1.157 (colored)

in timer_set, when figuring out the right position for the timer,
wemust stop walking the list once werun into a stopped timer, or
eventually all stopped timers will queue up at the very front (instead of
at the tail)

Revision 1.157 / (download) - annotate - [select for diffs], Sat Nov 24 17:01:04 2007 UTC (16 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.156: +3 -1 lines
Diff to previous 1.156 (colored)

Another missing RTM_VERSION check. This will remove the RB_INSERT warnings
seen on startup.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Nov 24 12:59:28 2007 UTC (16 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.155: +2 -2 lines
Diff to previous 1.155 (colored)

some spelling fixes from Martynas Venckus

Revision 1.155 / (download) - annotate - [select for diffs], Thu Oct 4 11:43:19 2007 UTC (16 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.154: +10 -1 lines
Diff to previous 1.154 (colored)

when inserting blackhole or reject routes, set the gateway address to
127.0.0.1 / ::1 unconditioally, since RTF_BLACKHOLE/REJECT are not
actually checked in the forwarding path and the gw doesn't matter otherwise.
makes them work.. found teh hard way by me. claudio ok

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

Various spelling fixes from Stuart Henderson.

Revision 1.153 / (download) - annotate - [select for diffs], Thu Apr 19 13:05:48 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.152: +155 -81 lines
Diff to previous 1.152 (colored)

Use vectorized writes to send routing messages into the kernel instead of
using a static message structure. This is more flexible and needed if
multipath comes into play.  looks good henning@

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

KNF

Revision 1.151 / (download) - annotate - [select for diffs], Wed Feb 7 13:22:55 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.150: +1 -3 lines
Diff to previous 1.150 (colored)

remove a log_debug() that is no longer needed.

Revision 1.150 / (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.149: +39 -16 lines
Diff to previous 1.149 (colored)

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

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

mib we pass to sysctl when fetching the routing table has 7 entries now,
not 6 any more (rtableid added). need to tell sysctl so.

Revision 1.148 / (download) - annotate - [select for diffs], Thu Nov 16 15:54:49 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.147: +6 -2 lines
Diff to previous 1.147 (colored)

for now, make bgpd work with routing table 0 (main one) and ignore routing
messages for any other tables.
real multi-table support is more adventurous (will come tho)

Revision 1.147 / (download) - annotate - [select for diffs], Thu Aug 3 22:40:25 2006 UTC (17 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.146: +14 -5 lines
Diff to previous 1.146 (colored)

On startup in fetchtable() clean the routing table of all PROTO1 routes.
These may be leftovers from a crash or so and result in an strange
behaving bgpd parent process additionally it causes huge CPU loads because
of a linear list walk done on every insert. Code stolen from ospfd which
does the same thing since a long time ago. This is a temporary fix until
we have real routing priorities and all this PROTO1 flagging can be removed.
PROTO1 is not exclusive to bgpd but for correct operation we currently need
to enforce it.
OK because it is only temporary henning@
Found and fix tested by Sylwester S. Biernacki

Revision 1.144.2.1 / (download) - annotate - [select for diffs], Fri May 5 03:04:07 2006 UTC (18 years, 1 month ago) by brad
Branch: OPENBSD_3_9
Changes since 1.144: +11 -9 lines
Diff to previous 1.144 (colored) next main 1.145 (colored)

MFC:
Fix by henning@

messages on the routing socket have different headers - rt_msghdr,
if_msghdr, etc. they only share the first 3 fields, and then differ.
this leads to a bug in RTM_IFINFO handling. We did abort on
rtm->rtm_errno != 0,
but if_msghdr has no errno, so we look at something in the data part
instead. Surprising that this didn't bite us before!
So we must only do these checks for RTM_ADD/CHANGE/DELETE that actually
use rt_msghdr.

Revision 1.146 / (download) - annotate - [select for diffs], Wed Apr 12 14:23:46 2006 UTC (18 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.145: +11 -9 lines
Diff to previous 1.145 (colored)

messages on the routing socket have different headers - rt_msghdr,
if_msghdr, etc. they only share the first 3 fields, and then differ.
this leads to a bug in RTM_IFINFO handling. We did abort on
rtm->rtm_errno != 0,
but if_msghdr has no errno, so we look at something in the data part
instead. Surprising that this didn't bite us before!
So we must only do these checks for RTM_ADD/CHANGE/DELETE that actually
use rt_msghdr.
found whiel checking strange behaviour tony sarendal <dualcyclone@gmail.com>
saw, and then totally strange behaviour on my amd64 hackbox. claudio ok

Revision 1.145 / (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.144: +21 -12 lines
Diff to previous 1.144 (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.144 / (download) - annotate - [select for diffs], Thu Feb 23 15:25:18 2006 UTC (18 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE
Branch point for: OPENBSD_3_9
Changes since 1.143: +3 -1 lines
Diff to previous 1.143 (colored)

Use the new rtm_fmask feature to reset blackhole and reject routes on
RTM_CHANGE. Until now it was not possible to get rid of these flags.
Until now a fib decouple, fib couple combo was needed to get rid from
blackholed routes. OK henning@

Revision 1.143 / (download) - annotate - [select for diffs], Tue Jan 31 15:22:15 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.142: +5 -1 lines
Diff to previous 1.142 (colored)

Dynamic routes (PMTU, etc) are not redistributable even for IPv6.
Sure henning@

Revision 1.142 / (download) - annotate - [select for diffs], Wed Dec 14 00:44:39 2005 UTC (18 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.141: +6 -5 lines
Diff to previous 1.141 (colored)

Replace strlcpy() with memcpy() in the sockaddr_dl handling. sdl_data is
not a C string and strlcpy() only works on C strings -- returns length of
the source.  Found by tedu@ OK deraadt@ tedu@

Revision 1.141 / (download) - annotate - [select for diffs], Wed Sep 21 12:50:20 2005 UTC (18 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.140: +7 -1 lines
Diff to previous 1.140 (colored)

when the route to a nexthop is a reject or blackhole route, the nexthop
is invalid. add check for these flags. shows up with v6, many reject routes
there. claudio ok

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

tab after space

Revision 1.139 / (download) - annotate - [select for diffs], Fri Jun 24 14:01:53 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.138: +11 -1 lines
Diff to previous 1.138 (colored)

Do not automaticaly announce routes that have RTF_DYNAMIC set. These routes
are e.g. created by the PMTU code and are removed after some time.
OK henning@

Revision 1.138 / (download) - annotate - [select for diffs], Tue Jun 14 15:01:51 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.137: +3 -3 lines
Diff to previous 1.137 (colored)

Don't unref something that is used later. send_rtmsg() will call
rtlabel_id2name() so call rtlable_unref() after that.
OK henning@

Revision 1.137 / (download) - annotate - [select for diffs], Mon Jun 13 21:16:18 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.136: +60 -34 lines
Diff to previous 1.136 (colored)

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

Revision 1.136 / (download) - annotate - [select for diffs], Tue Jun 7 18:56:51 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.135: +16 -5 lines
Diff to previous 1.135 (colored)

Set the reject and blackhole flags for kernel routes too. This makes the
bgpctl show fib output more logical, especially for INET6 because many
prfixes have the reject flag set.  OK henning@

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jun 7 18:43:31 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.134: +23 -32 lines
Diff to previous 1.134 (colored)

Fix the mask2prefixlen6() function once and for all. Netmasks are stored in
an own AF independent radix tree. So the passed sockaddrs are often smaller
than the actual AF specific struct, especially sockaddr_in6. So the crap
Henning saw in the mask was acctually the next struct sockaddr that was passed
in the routing message. So pass the struct sockaddr_in6 and compare only the
specified number of bytes (minus the offset of sin6_addr in the struct
sockaddr_in6). Amazing!..
OK henning@

Revision 1.134 / (download) - annotate - [select for diffs], Mon Jun 6 17:15:07 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.133: +17 -10 lines
Diff to previous 1.133 (colored)

allow show fib to be limited to inet or inet6 families, claudio ok

Revision 1.133 / (download) - annotate - [select for diffs], Sun Jun 5 23:59:28 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.132: +1 -7 lines
Diff to previous 1.132 (colored)

on CTL_KROUTE requests, send back both v4 and v6 routes

Revision 1.132 / (download) - annotate - [select for diffs], Sun Jun 5 23:57:33 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.131: +48 -8 lines
Diff to previous 1.131 (colored)

work around another disgusting ugliness in v6: the netmasks we get on
the routing socket have crap in the lower bytes, so instead of
using a straightforward and rather simple algorithm to convert them to prefix
lengths we have to do quite some ugly manual fiddling... disgusting.

Revision 1.131 / (download) - annotate - [select for diffs], Thu Jun 2 15:06:08 2005 UTC (19 years ago) by cloder
Branch: MAIN
Changes since 1.130: +4 -4 lines
Diff to previous 1.130 (colored)

Cleanup recent kroute6 additions. OK henning

Revision 1.130 / (download) - annotate - [select for diffs], Fri May 27 20:01:21 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.129: +1 -9 lines
Diff to previous 1.129 (colored)

bah, more kaesefondue (debugging cruft left in)

Revision 1.129 / (download) - annotate - [select for diffs], Fri May 27 20:00:35 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.128: +49 -112 lines
Diff to previous 1.128 (colored)

don't need to fetch the kernel routing twice, once for v4 and once for v6,
do it once and handle both families. claudio ok

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

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

Revision 1.127 / (download) - annotate - [select for diffs], Fri May 27 17:52:11 2005 UTC (19 years ago) by claudio
Branch: MAIN
Changes since 1.126: +905 -138 lines
Diff to previous 1.126 (colored)

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

Revision 1.126 / (download) - annotate - [select for diffs], Fri May 13 08:34:33 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored)

The NET_RT_IFLIST sysctl returns RTM_IFINFO and RTM_NEWADDR messages in
the buffer. While RTM_IFINFO starts with a struct if_msghdr RTM_NEWADDR
does not. In other words (struct sockaddr *)(next + sizeof(ifm)) is only
correct for RTM_IFINFO and not for RTM_NEWADDR. So move the ifm_type check
up else get_rtaddrs() would access memory outside of buf.
OK henning@

Revision 1.125 / (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.124: +107 -6 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Thu Apr 28 13:49:12 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.123: +5 -2 lines
Diff to previous 1.123 (colored)

Be more careful when copying ifname from the struct sockaddr_dl.
OK henning@

Revision 1.123 / (download) - annotate - [select for diffs], Mon Apr 18 11:07:55 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.122: +5 -4 lines
Diff to previous 1.122 (colored)

Set flag F_STATIC based on RTF_STATIC and not just because the route came
from the kernel. That's what F_KERNEL is for. OK henning@

Revision 1.122 / (download) - annotate - [select for diffs], Fri Apr 8 00:07:18 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.121: +6 -5 lines
Diff to previous 1.121 (colored)

don't whine when we can't find interface with index 0
(that is a rare corner case in that context, but still)

Revision 1.121 / (download) - annotate - [select for diffs], Wed Mar 30 11:13:05 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.120: +29 -18 lines
Diff to previous 1.120 (colored)

interface validation cleanup / fixes
there's some nastiness in the interface validation.
clean up by centralizing the checks in kif_validate().
claudio ok

Revision 1.120 / (download) - annotate - [select for diffs], Tue Mar 29 11:20:01 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.119: +7 -3 lines
Diff to previous 1.119 (colored)

explicitely check interface flags for IFF_UP in kroute_validate

Revision 1.119 / (download) - annotate - [select for diffs], Mon Mar 28 14:40:04 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.118: +5 -3 lines
Diff to previous 1.118 (colored)

KNF

Revision 1.118 / (download) - annotate - [select for diffs], Sat Mar 26 23:04:34 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.117: +6 -6 lines
Diff to previous 1.117 (colored)

inet_addr("127.0.0.1") -> htonl(INADDR_LOOPBACK)
Use IN_CLASSA_NET instead of hard coded 0xff000000
OK henning@

Revision 1.117 / (download) - annotate - [select for diffs], Tue Mar 15 10:18:39 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.116: +16 -2 lines
Diff to previous 1.116 (colored)

grow the receive buffer on the routing socket, pointed out by markus,
ok markus claudio

Revision 1.116 / (download) - annotate - [select for diffs], Mon Mar 14 12:25:50 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.115: +5 -2 lines
Diff to previous 1.115 (colored)

send a kif structure describing the interface a route relies on along
with the "show nexthop" messages, claudio ok

Revision 1.115 / (download) - annotate - [select for diffs], Mon Mar 14 08:44:33 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.114: +29 -11 lines
Diff to previous 1.114 (colored)

"we notice when you plug the cable" - yeah, but we didn't notice when it
was unplugged from the beginning on...
correctly take interfaces' link state into account for nexthop verification
in all cases.
add a new function kroute_validate() that looks up the interface for a given
kroute via the ifindex and check its link state. use it in all cases instead
of hand-rolling the test. claudio ok

Revision 1.114 / (download) - annotate - [select for diffs], Sun Mar 13 15:52:34 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

when fetching the initial table, inherit the ifindex regardless of af, not
just for AF_LINK

Revision 1.113 / (download) - annotate - [select for diffs], Sun Mar 13 15:34:37 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

explicitely initialize opt

Revision 1.112 / (download) - annotate - [select for diffs], Wed Nov 24 22:57:18 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.111: +5 -5 lines
Diff to previous 1.111 (colored)

if I would remember at what I looked when learning how to use our wonderful
RB_* macros I could fix the RB_HEAD calls there too... useless extra define,
nothingthat hurts much. stumbled over while hacking on, eh, something new,
claudio ok

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

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

Revision 1.110 / (download) - annotate - [select for diffs], Tue Oct 19 12:02:50 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.109: +16 -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], Sat Oct 16 12:24:23 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.108: +0 -15 lines
Diff to previous 1.108 (colored)

oups, unrelated changes crept in

Revision 1.108 / (download) - annotate - [select for diffs], Sat Oct 16 09:33:03 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.107: +19 -1 lines
Diff to previous 1.107 (colored)

prefixlen 0 is a special case for prefixlen2mask() as well, claudio ok

Revision 1.107 / (download) - annotate - [select for diffs], Thu Aug 19 10:38:34 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.106: +8 -10 lines
Diff to previous 1.106 (colored)

logic error: when there's changes affecting nexthop reachability,
always notify the RDE and not only if the nexthop was previously unreachable,
i.e. its validity changed.
found the hard way by Arvid Grtting <arvidg@netfonds.no>, claudio ok

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

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

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

Make the code more portable by #ifdef-ing RTF_MPATH. OK henning@

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

fix some typos

ok henning otto

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

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

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

fix a few KNF fallouts

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jun 29 20:13:07 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.100: +11 -1 lines
Diff to previous 1.100 (colored)

little extra paranoia, ignore attempts to enter routes with a nexthop
within 127/8. inspired by a very bad example for bogon filters at the
cymru site, claudio ok

Revision 1.100 / (download) - annotate - [select for diffs], Fri Jun 25 20:08:46 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.99: +33 -1 lines
Diff to previous 1.99 (colored)

provide mask2prefixlen6() and prefixlen2mask6()

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jun 25 18:48:18 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.98: +30 -1 lines
Diff to previous 1.98 (colored)

after writing and deleting the kroute6 tree related functions for at least 5
times I am getting this in now sow I don't do it a 7th time...

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

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

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

introduce kroute6, which will be used to build a seperate v6 table
(smashing them into the v4 table would raise the memory requirements far too
much), and make kroute_nexthop (where we are not under such memory pressure,
you don't have a hundred thousand nexthops) v4/v6. change existing callers
to use the v4 part, claudio ok

Revision 1.96 / (download) - annotate - [select for diffs], Sun Jun 20 19:16:53 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.95: +4 -1 lines
Diff to previous 1.95 (colored)

skip over multipath routes
maybe one day we come up with a good reason for bgpd to use multipath
routes, but for now it doesn't make any sense - bgpd inserts the "best"
path fr a prefix, there's no point in inserting more than one. one is
always the "best" one by bgp metrics.
with claudio

Revision 1.95 / (download) - annotate - [select for diffs], Sat May 8 06:04:57 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.94: +12 -5 lines
Diff to previous 1.94 (colored)

implement and use prefixlen2mask() instead of doing it by hand 3 times

Revision 1.94 / (download) - annotate - [select for diffs], Wed Apr 28 01:13:18 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

remove XXX that is wrong

Revision 1.93 / (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.92: +2 -3 lines
Diff to previous 1.92 (colored)

crud stripping; henning ok

Revision 1.92 / (download) - annotate - [select for diffs], Wed Mar 10 13:00:42 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.91: +34 -1 lines
Diff to previous 1.91 (colored)

on shutdown, explicitely clear the knexthop, kroute and kif tables, claudio ok

Revision 1.91 / (download) - annotate - [select for diffs], Wed Mar 10 12:59:13 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.90: +7 -5 lines
Diff to previous 1.90 (colored)

in kif_kr_insert and _remove, don't whine when we do not find an interface
whom's index is 0. this means no interface and our faked route that protects
the loopback network uses ifindex 0. claudio ok

Revision 1.90 / (download) - annotate - [select for diffs], Wed Mar 10 12:55:35 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.89: +2 -7 lines
Diff to previous 1.89 (colored)

remove an ugly hack from the time when we had no RTM_IFANNOUNCE messages:
if kif_find() did not find a matchnit re-fetched the complete table from the
kernel and retried. this is obsolete now, claudio ok

Revision 1.89 / (download) - annotate - [select for diffs], Thu Mar 4 11:26:36 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.88: +7 -7 lines
Diff to previous 1.88 (colored)

no ; after RB_PROTOTYPE / RB_GENERATE
From: Andrey Matveev <andrushock@korovino.net>

Revision 1.88 / (download) - annotate - [select for diffs], Wed Mar 3 17:08:45 2004 UTC (20 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.87: +7 -1 lines
Diff to previous 1.87 (colored)

plug a couple of little memory leaks in error paths that we hopefully never
reach - except for one missing free which was not in an error path. oups. at
least in a function that is only called once ever in bgpd's lifetime.
From: Patrick Latifi <pat at eyeo dot org>, thanks!

Revision 1.87 / (download) - annotate - [select for diffs], Sun Feb 29 11:14:19 2004 UTC (20 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Make sure that the fib output is nicely sorted. Use ntohl to compare
IP addresses so the tree gets correctly populated. OK henning@

Revision 1.86 / (download) - annotate - [select for diffs], Sat Feb 7 01:50:28 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.85: +2 -1 lines
Diff to previous 1.85 (colored)

when connected routes show up at runtime we have to set ifindex in struct kif

Revision 1.85 / (download) - annotate - [select for diffs], Sat Feb 7 01:41:52 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.84: +5 -5 lines
Diff to previous 1.84 (colored)

houps, fetchtable() had the default route special cased... bad.
sin_len == 0 here too.

Revision 1.84 / (download) - annotate - [select for diffs], Sat Feb 7 01:28:13 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.83: +6 -5 lines
Diff to previous 1.83 (colored)

the sockaddr holding the netmask and advertised by rtm_addrs might
mave sa_len == 0 to indicate a mask of /0

Revision 1.83 / (download) - annotate - [select for diffs], Sat Feb 7 00:16:14 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.82: +3 -5 lines
Diff to previous 1.82 (colored)

sin_family in the sockaddr_n representing the netmask we sniffed on the
routing socket is meaningless. so we're better off not checking it.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Jan 30 15:44:46 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.81: +17 -17 lines
Diff to previous 1.81 (colored)

please sparc64, with & ok claudio

Revision 1.81 / (download) - annotate - [select for diffs], Wed Jan 28 01:56:26 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.80: +6 -1 lines
Diff to previous 1.80 (colored)

log & ignore RTM_CHANGE messages for that we don't find an exact match
apparently pppd loves to issue change messages twice, once with and once without
netmask, and in the latter case we have to play the classless game, which
could lead to additional entries with wrong netmask in our internal view
of the routing table.

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jan 27 22:15:13 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.79: +16 -14 lines
Diff to previous 1.79 (colored)

make rt_sendmsg's local nextop and prefix struct in_addr too and don't use
log_ntoa, claudio ok

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

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

Revision 1.78 / (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.77: +3 -3 lines
Diff to previous 1.77 (colored)

use log_addr

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

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

ok claudio@

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

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

Revision 1.75 / (download) - annotate - [select for diffs], Thu Jan 22 03:07:51 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.74: +11 -2 lines
Diff to previous 1.74 (colored)

an RTM_IFINFO message can mean a lot. it does not necessarily mean that
the status of the interface in terms of our nexthop validation changed;
it might be something like a speed change that we don't care about.
save the decided state for nexthop verificartion in struct kif, and only
walk through the attached (connected) routes & report upwards if the state
actually changed.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Jan 18 19:15:00 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.73: +10 -6 lines
Diff to previous 1.73 (colored)

track interface type and baudrate as well

ok claudio@

Revision 1.73 / (download) - annotate - [select for diffs], Sat Jan 17 21:06:55 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.72: +13 -5 lines
Diff to previous 1.72 (colored)

keep track of interface link state and invalidate connected routes depending
on the interface in question if it has no link
now, if you pull the network cable all nexthops beeing in a connected
network on this interface get invalidated nicely.

ok claudio@

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

keep & track interface names as well, not only indices

Revision 1.71 / (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.70: +14 -8 lines
Diff to previous 1.70 (colored)

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

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jan 17 15:35:09 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.69: +3 -1 lines
Diff to previous 1.69 (colored)

actually update interface flags in if_change()

Revision 1.69 / (download) - annotate - [select for diffs], Sat Jan 17 15:00:29 2004 UTC (20 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.68: +35 -8 lines
Diff to previous 1.68 (colored)

use the new RTM_IFANNOUNCE messages to track interface (de-)appearance,
especially for cloneable devices like vlan/tun etc

ok markus@ and claudio@ a while back

Revision 1.68 / (download) - annotate - [select for diffs], Wed Jan 14 12:33:30 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.67: +23 -2 lines
Diff to previous 1.67 (colored)

add soon-needed kif_remove()

ok claudio@

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

KNF

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jan 11 22:01:13 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.65: +61 -38 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 19:53:48 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.64: +17 -7 lines
Diff to previous 1.64 (colored)

we need to have the address family set in bgpd_addr structs when they
contain anything worthwile...

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

when sending the nexthop status message, include the kroute that makes that
nexthop reachable. needed in the RDE for calculating the to-be-announced
nexthop.

ok claudio@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jan 11 19:14:43 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.62: +8 -7 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Sun Jan 11 02:35:14 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.61: +21 -3 lines
Diff to previous 1.61 (colored)

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

Revision 1.61 / (download) - annotate - [select for diffs], Fri Jan 9 19:08:50 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.60: +29 -6 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 14:10:06 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.59: +4 -1 lines
Diff to previous 1.59 (colored)

flag kernel routes whch are not conencted routes as static routes.
that's what they are, and it makes matching on them easier.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 9 13:47:07 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.58: +44 -43 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Fri Jan 9 01:23:12 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.57: +21 -19 lines
Diff to previous 1.57 (colored)

for RTM_IFINFO messages showing up on the routing socket do not ever
look into the first sockaddr structure after the msg header; does not
contain what we expect there and caused messages to get missed in some cases

Revision 1.57 / (download) - annotate - [select for diffs], Thu Jan 8 17:06:50 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.56: +5 -16 lines
Diff to previous 1.56 (colored)

in kroute_insert, use knexthop_validate instead of hand-baking a slightly
optimized version of it

Revision 1.56 / (download) - annotate - [select for diffs], Thu Jan 8 16:55:25 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

in knexthop_validate, always call kroute_detach_nexthop, not
only in the no-match-found case. if we fina a match we are calling
kroute_attach_nexthop anyway; and the match might be (in the common cases:
will be, if existant at all) different for the existing attachment.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jan 8 16:52:05 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.54: +5 -2 lines
Diff to previous 1.54 (colored)

fix kroute_detach_nexthop

Revision 1.54 / (download) - annotate - [select for diffs], Thu Jan 8 16:34:39 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

our own internal route flags should have been an u_int8_t from the beginning
on, not an int.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jan 8 16:17:12 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.52: +85 -86 lines
Diff to previous 1.52 (colored)

rename a few functions to further clarify things

Revision 1.52 / (download) - annotate - [select for diffs], Thu Jan 8 16:07:15 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.51: +555 -450 lines
Diff to previous 1.51 (colored)

big reorganization.
much nicer now.

ok claudio@

Revision 1.51 / (download) - annotate - [select for diffs], Thu Jan 8 11:40:03 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

KNF

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jan 8 11:39:41 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.49: +214 -4 lines
Diff to previous 1.49 (colored)

keep track of interface status. if an interface goes down mark all connected
routes that belong to it as invalid, and invalidate all nexthops belonging
to it, and vice versa when it goes up

"looks good" claudio@ on the version from yesterday night '-)

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jan 7 13:32:53 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.48: +63 -35 lines
Diff to previous 1.48 (colored)

deal with messages on the AF_ROUTE socket in a multiprotocol friendlier way.
this is also some preparation for v6 support.

"looks good" claudio@

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jan 7 12:38:51 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

fix a check that catched too much... now connected routes that appear
after startup (due to addition of an ip to an interface) are handled
correctly.

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jan 6 03:43:50 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

2004

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jan 5 16:17:22 2004 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.45: +11 -1 lines
Diff to previous 1.45 (colored)

protect against trying to couple when we're already coupled to the fib,
and log the coupling. same for decouple.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jan 2 01:46:20 2004 UTC (20 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored)

mark a few numbers U to please compilers; henning ok

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

typos from david

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

typo in comment
From: Dries Schellekens <gwyllion@ace.ulyssis.org>

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

style

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

consider the defualt route in kroute_match as well. it is a special case.

Revision 1.40 / (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.39: +34 -28 lines
Diff to previous 1.39 (colored)

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

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

provide kroute_fib_couple and _decouple, pumping all bgp routes from the
internal view to the kernel routing table respectively removing them all from
the kernel routing table
kroute_shutdown is now a simple wrapper to kroute_fib_decouple

Revision 1.38 / (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.37: +8 -2 lines
Diff to previous 1.37 (colored)

implement "no fib-update" much cooler

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

when a static route is deleted on that a nexthop depends, we re-check
wether there's another (bigger-prefix) non-bgp route suitable to reach the
prefix, and if that is the case change the references over to the new route.
if not, we need to invalidate the nexthop.
unfortunately, we cannot just call kroute_nexthop_insert (whoch does these
checks) again, as it does too much.
factor out the matching and reference adding code from kroute_nexthop_insert
to a new kroute_nexthop_checkmatch(), and make the surrpounding stuff cope.
the kroute parts of "static route addition/deletion affects nexthop-valifity"
work now.

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

detect when a newly added kernel route (non-bgp of course) matches a nexthop
that is flagged invalid yet and make it valid, notify RDE etc

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

factor out common code

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

20 minutes debugging for a missinf return (0) at the end of a function,
and gcc should have had complained... well.

Revision 1.33 / (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.32: +19 -11 lines
Diff to previous 1.32 (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.32 / (download) - annotate - [select for diffs], Fri Dec 26 17:35:48 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.31: +55 -32 lines
Diff to previous 1.31 (colored)

report as many errors upstream as possible instead of fatal() so they
can be handled better

Revision 1.31 / (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.30: +5 -3 lines
Diff to previous 1.30 (colored)

handle kroute_init failures nicer

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

provide a real log_err

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

127/8 is special, and thus needs special protection.
on startup, insert a fake route for it to our private view of the kernel
routing table, and flag it as kernel and connected route.
we never allow a bgp route to overwrite a kernel route.
prodded by theo

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

o improve logging dramatically
o handle more errors gracefullt instead of panic
o don't leak mem on RB_INSERT failues (not a common case anyway, but...)
o zap a few unneeded variables

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

handle IMSG_NEXTHOP_DELETE as well

Revision 1.26 / (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.25: +6 -6 lines
Diff to previous 1.25 (colored)

kroute_nexthop_check -> kroute_nexthop_add
kroute_validate_nexthop -> kroute_nexthop_insert

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

kroute_validate_nexthop is a private function

Revision 1.24 / (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.23: +1 -5 lines
Diff to previous 1.23 (colored)

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

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

o in struct nexthop_node, we don't need the full kroute_nexthop struct,
| the nexthop address itself is enough
o RB_INIT the nexthop table
o don't forget to set the key field before RB_INSERT...

Revision 1.22 / (download) - annotate - [select for diffs], Thu Dec 25 23:21:36 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.21: +3 -6 lines
Diff to previous 1.21 (colored)

nothing uses the special return value kroute_msg used to set for EEXIST any
more, so zap the special treatment for EEXIST

Revision 1.21 / (download) - annotate - [select for diffs], Thu Dec 25 23:15:58 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.20: +134 -6 lines
Diff to previous 1.20 (colored)

bring us closer to a complete nexthop verification that does NOT need
periodic scans:
-keep a tree of nexthops with valid/invalid flags
-provide kroute_match, which takes an IP address and gives the kernel route
 for that
-find the kernel route for a given nexthop with that
-keep a marker on the kernel route that a nexthop depends on it
-on removal of the kernel route, re-evaluate the affected nexthops for
 validity.

ok claudio@

Revision 1.20 / (download) - annotate - [select for diffs], Thu Dec 25 19:24:46 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.19: +23 -12 lines
Diff to previous 1.19 (colored)

detect connected routes and flag them as such

Revision 1.19 / (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.18: +95 -4 lines
Diff to previous 1.18 (colored)

track routing table changes that are _not_ caused by bgpd itself

ok claudio@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Dec 25 16:21:50 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.17: +36 -26 lines
Diff to previous 1.17 (colored)

factor out prefixlen_classful() and mask2prefixlen()

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

kill an inappropriate XXX

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

remove a useless check & comment

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

(more or less) handle ESRCH for RTM_ADD

Revision 1.14 / (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.13: +2 -2 lines
Diff to previous 1.13 (colored)

it actually makes more sense to call the merged function kroute_change

Revision 1.13 / (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.12: +16 -36 lines
Diff to previous 1.12 (colored)

kroute_change is obsolete, long live kroute_add

Revision 1.12 / (download) - annotate - [select for diffs], Thu Dec 25 01:59:34 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.11: +13 -5 lines
Diff to previous 1.11 (colored)

check with our local view wether there is already an entry for the to be
added prefix in the kernel routing table. if yes and inserted by us change
action from ADD to CHANGE, if not added by us do not add or change that
prefix.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Dec 25 01:49:53 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.10: +1 -4 lines
Diff to previous 1.10 (colored)

oups, remove debugging cruft

Revision 1.10 / (download) - annotate - [select for diffs], Thu Dec 25 01:48:07 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.9: +4 -1 lines
Diff to previous 1.9 (colored)

skip over routing table entires with flag LLINFO (that's arp cache)

Revision 1.9 / (download) - annotate - [select for diffs], Thu Dec 25 01:45:57 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.8: +107 -1 lines
Diff to previous 1.8 (colored)

dump a copy of the kernel routing table into our own view on startup

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

no O_NONBLOCK for routing and tcp sockets, theo

Revision 1.7 / (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.6: +11 -1 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Wed Dec 24 19:23:26 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.5: +96 -6 lines
Diff to previous 1.5 (colored)

keep track of the routes we inserted to the kernel
do only ever delete those, and no others

Revision 1.5 / (download) - annotate - [select for diffs], Tue Dec 23 17:38:49 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

use RTF_PROTO1 for now

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

no RTF_MASK

Revision 1.3 / (download) - annotate - [select for diffs], Tue Dec 23 16:07:37 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.2: +7 -3 lines
Diff to previous 1.2 (colored)

don't panic on EEXIST. that's normal for a full-table router to get a route
for its own connected network(s)

Revision 1.2 / (download) - annotate - [select for diffs], Tue Dec 23 15:50:12 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.1: +6 -2 lines
Diff to previous 1.1 (colored)

bzero, set sin_len, and fix an error message
from debugging session with claudio

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 22 15:22:13 2003 UTC (20 years, 5 months ago) by henning
Branch: MAIN

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@

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.