Commit graph

247 commits

Author SHA1 Message Date
Ondrej Zajicek 44f26560ec Workaround for some broken BGP implementations that skip initial KEEPALIVE. 2010-02-02 10:14:21 +01:00
Ondrej Zajicek 41677025ee Changes 'ignore communities' to 'interpret communities'. 2010-01-28 15:59:18 +01:00
Ondrej Zajicek 6cb8f742f1 Better handling of well-known communities.
Process well-known communities before the export filter (old behavior is
to process these attributes after, which does not allow to send route
with such community) and just for routes received from other BGP
protocols. Also fixes a bug in next_hop check.
2010-01-27 17:22:57 +01:00
Ondrej Zajicek cf31112f0d Implements MRTdump feature. 2010-01-03 12:17:52 +01:00
Ondrej Zajicek fbcb7d5faf Change default LOCAL_PREF attribute to 100 (suggested value by RFC 4277). 2009-12-21 11:50:42 +01:00
Ondrej Zajicek 0225ea4edd Merge branch 'ospf3' into new 2009-12-15 00:32:13 +01:00
Ondrej Zajicek f2d7da742b Fixes export of routes with link-local gw. 2009-12-15 00:30:07 +01:00
Ondrej Zajicek 43c1ceccb9 Remove bgp_as4_support variable. 2009-12-14 23:31:25 +01:00
Ondrej Zajicek bf47fe4b2e Implements BGP route refresh. 2009-11-26 20:47:59 +01:00
Ondrej Zajicek 3f9b7bfe9f Implements option that controls IPv6 BGP next hops when lladdr is missing. 2009-11-18 20:32:36 +01:00
Ondrej Zajicek d0e2d6d1e0 Show both IPv6 next hop addresses in BGP. 2009-11-17 14:17:23 +01:00
Ondrej Zajicek 3228c72cc0 Implements RFC 5004 - prefer older external routes. 2009-11-17 11:41:29 +01:00
Ondrej Zajicek 4cdd078453 Implements protocol-specific router id and updates documentation. 2009-10-12 23:31:42 +02:00
Ondrej Zajicek 52b9b2a178 Rename as_path_get_last/as_path_get_first to be consistent. 2009-10-12 20:44:58 +02:00
Ondrej Zajicek ea89da381f Workaround for stupid callback scheduler.
There is no reak callback scheduler and previous behavior causes
bad things during hard congestion (like BGP hold timeouts).

Smart callback scheduler is still missing, but main loop was
changed such that it first processes all tx callbacks (which
are fast enough) (but max 4* per socket) + rx callbacks for CLI,
and in the second phase it processes one rx callback per
socket up to four sockets (as rx callback can be slow when
there are too many protocols, because route redistribution
is done synchronously inside rx callback). If there is event
callback ready, second phase is skipped in 90% of iterations
(to speed up CLI during congestion).
2009-10-11 18:56:16 +02:00
Ondrej Zajicek a5bf5f781c Show bad peer AS number in log in decimal. 2009-09-24 23:14:44 +02:00
Ondrej Zajicek be6e39ebbf Passive option. 2009-09-24 22:12:11 +02:00
Ondrej Zajicek 54fe0d9230 Fixes setting of IP addresses to route attributes (NEXT_HOP). 2009-09-18 13:59:04 +02:00
Ondrej Zajicek 46eb80d5d5 Fixes headers for uintptr_t (and build on NetBSD). 2009-09-17 17:52:36 +02:00
Ondrej Zajicek 05198c12f4 Some cleanups. 2009-08-27 19:01:04 +02:00
Ondrej Zajicek 949bd34e81 Fixes bug related to AS2->AS4 conversion. 2009-08-25 19:01:37 +02:00
Ondrej Zajicek 70670bf317 Fixed bug related to reconfiguration of BGP with MD5 passwords. 2009-07-09 15:42:39 +02:00
Ondrej Zajicek d72cdff411 Replace 'bind' option with 'listen' option.
To be consistent with other daemons.
2009-06-23 11:08:30 +02:00
Ondrej Zajicek da95a7a7da Fixes bug in ORIGIN check. 2009-06-23 11:00:38 +02:00
Ondrej Zajicek 29c430f856 Changes handling of AS_PATH_CONFED_* segments in AS_PATH.
Although standard says that if we receive AS_PATH_CONFED_*
(and we are not a part of a confederation) segment, we should
drop session, nobody does that and it is unwise to do that.

Now we drop session just in case that peer ASN is in
AS_PATH_CONFED_* segment (to detect peer that considers BIRD
as a part of its confederation).
2009-06-23 10:50:57 +02:00
Ondrej Zajicek 789772ed45 Implements option that changes BGP listening socket parametres. 2009-06-18 19:20:07 +02:00
Ondrej Zajicek b99d378698 Minor BGP changes related to error wait time. 2009-06-07 00:38:38 +02:00
Ondrej Zajicek 7238262671 Fixes bug related to startup delay change. 2009-06-06 18:56:33 +02:00
Ondrej Zajicek dd91e46765 Differentiate between error delay and connect/reconnect delay.
The difference is here to reject incoming connections in the
first case.
2009-06-06 18:16:22 +02:00
Ondrej Zajicek 72b28a041d Implements import route limits. 2009-06-04 13:31:09 +02:00
Ondrej Zajicek f98e291579 The pipe cleanup. 2009-06-01 14:07:13 +02:00
Ondrej Zajicek 23ac9e9a9e Changes pipes to transfer all routes between routing table, not just optimal routes. 2009-05-31 15:24:27 +02:00
Ondrej Zajicek 10ab65a8c9 Fixes one recently introduced IPv6 BGP compatibility problem. 2009-05-06 15:18:52 +02:00
Ondrej Zajicek b7a735ea9d Allow 'third party' BGP updates for originated routes. 2009-04-29 22:17:40 +02:00
Ondrej Zajicek 4827b69ff4 Fixes BGP IPv6 link local next hop handling.
When sending 'third party' BGP update, Bird used bogus link local
addresses instead of addresses it received before.
2009-04-29 18:58:24 +02:00
Ondrej Zajicek ad440a570b Fixes handling of 'next hop self' and 'source address' configuration
options.
2009-04-28 18:11:56 +02:00
Ondrej Zajicek 64cf11f544 Fixes BGPv6 bug - missing endianity conversion.
Also removes code skipping SNPAs
(obsoleted by newer RFCs, should be ignored).
2009-04-23 23:15:07 +02:00
Ondrej Zajicek f307842ad8 Fixes BGPv6 bug - mandatory attributes weren't validated; 2009-04-23 14:44:02 +02:00
Ondrej Zajicek 8f0c887a52 Fixe bug in BGPv6 that causes to send invalid network withdraws. 2009-04-23 14:16:05 +02:00
Ondrej Zajicek b9539e78d8 Fixes bug in BGPv6 causing crash by checking missing attributes. 2009-04-23 12:36:24 +02:00
Ondrej Zajicek 48d79d521c Better handling of AS4 optional attribute errors
AS4 optional attribute errors were handled by session
drop (according to BGP RFC). This patch implements
error handling according to new BGP AS4 draft (*)
 - ignoring invalid AS4 optional attributes.

(*) http://www.ietf.org/internet-drafts/draft-chen-rfc4893bis-02.txt
2009-03-18 20:30:21 +01:00
Ondrej Zajicek e8ba557c7f Update capability handshake options
Add 'capabilities' option, change default behavior to advertise ipv4,
add some checks and ignore incoming capabilities when capabilities
are disabled.
2009-03-13 12:49:44 +01:00
Ondrej Zajicek e3299ab148 Added Cisco and Quagga capability workaround option. 2009-03-05 11:52:47 +01:00
Ondrej Zajicek 82a79586e5 Better handling of too long attributes
This patch extends the length for attributes from 1024 to 2048
(because both AS_PATH and AS4_PATH attributes take 2+4 B per AS).

If there is not enough space for attributes, Bird skips that
route group. Old behavior (skipping remaining attributes)
leads to skipping required attributes and session drop.
2009-02-27 15:24:46 +01:00
Ondrej Zajicek cb53039271 Rate limit for most abundant log messages 2009-02-26 14:23:54 +01:00
Ondrej Zajicek cd17c651a6 Add format for BGP_AGGREGATOR attribute 2009-02-21 17:47:56 +01:00
Ondrej Zajicek 165a622727 Adds support for fallback to capabilityless BGP connect
When capability related error is received, next connect will be
without capabilities. Also cease error subcodes descriptions
(according to [RFC4486]) are added.
2008-12-24 17:24:41 +01:00
Ondrej Zajicek 591211557f Fixes bug related to reconfiguration of BGP.
BGP keeps its copy of configuration ptr and didn't update it during
reconfiguration. But old configuration is freed during reconfiguration.
That leads to unnecessary reset of BGP connection during reconfiguration
(old conf is corrupted and therefore different) and possibly other strange
behavior.
2008-12-24 12:18:10 +01:00
Ondrej Zajicek 11b32d9117 Major changes to BGP
Fixes two race conditions causing crash of Bird, several unhandled
cases during BGP initialization, and some other bugs. Also changes
handling of startup delay to be more useful and implement
reporting of last error in 'show protocols' command.
2008-12-19 01:34:39 +01:00
Ondrej Zajicek aebe06b40c Proper format functions for ORIGINATOR_ID, CLUSTER_LIST 2008-11-08 23:33:22 +01:00
Ondrej Zajicek 1389f3699f Fixes bugs in IPv6 code caused by recent commits. 2008-11-05 21:39:04 +01:00
Ondrej Zajicek a39b165e45 Multihop BGP was completely broken, because listening socket has always
ttl 1.
2008-11-01 16:58:40 +01:00
Ondrej Zajicek a92fe60717 Implementation of route server. 2008-11-01 12:55:43 +01:00
Ondrej Zajicek e16466b379 Fix race condition that breaks BGP connections after reconfigure.
RFC says that only connections in OpenConfirm and Established state
should participate in connection collision detection.

The current implementation leads to race condition when both sides
are trying to connect at the almost same time, then both sides
receive OPEN message by different connections at the almost same
time and close the other connection. Both connections are
closed and the both sides end in  start/idle or start/active
state.
2008-10-29 14:16:34 +01:00
Ondrej Zajicek b6bf284a90 Bugfixes in MULIT_EXIT_DISC attribute handling.
- Old MED handling was completely different from behavior
   specified in RFCs - for example they havn't been propagated
   to neighboring areas.

 - Update tie-breaking according to RFC 4271.

 - Change default value for 'default bgp_med' configuration
   option according to RFC 4271.
2008-10-26 22:59:21 +01:00
Ondrej Zajicek 4819c3e17a Bugfix in LOCAL_PREF attribute handling. 2008-10-26 22:54:23 +01:00
Ondrej Zajicek ba5ed6f3e4 Implementation of an option for disabling AS4 support per BGP instance. 2008-10-26 22:48:02 +01:00
Ondrej Zajicek 4847a894bf Implementation of route reflection for BGP 2008-10-26 22:45:09 +01:00
Ondrej Zajicek d51aa28190 Implementation of MD5 authentication of BGP sessions. 2008-10-26 22:42:39 +01:00
Ondrej Zajicek 11cb620266 Implementation of 4B ASN support for BGP 2008-10-26 22:36:08 +01:00
Ondrej Filip 85ae398a61 The source address configuration in BGP added. 2008-08-24 23:20:46 +00:00
Ondrej Filip 98ac61766d A lot of changes:
- metric is 3 byte long now
	- summary lsa originating
	- more OSPF areas possible
	- virtual links
	- better E1/E2 routes handling
	- some bug fixes..

I have to do:
	- md5 auth (last mandatory item from rfc2328)
	- !!!!DEBUG!!!!! (mainly virtual link system has probably a lot of bugs)
	- 2328 appendig E
2004-06-25 16:39:53 +00:00
Martin Mares 9831e5916f Staticized lots of local functions. 2004-06-05 09:58:23 +00:00
Martin Mares e21423bab8 ... in BGP. 2004-06-05 09:27:17 +00:00
Ondrej Filip 7fdd338c36 ALIGN -> BIRD_ALIGN 2004-06-01 10:28:25 +00:00
Martin Mares 38a608c55a Rewritten the I/O loop. All socket operations are now safe, meaning that
you can delete the socket from anywhere in the hooks and nothing should break.
Also, the receive/transmit buffers are now regular xmalloc()'ed buffers,
not separate resources which would need shuffling around between pools.

sk_close() is gone, use rfree() instead.
2004-05-31 21:48:19 +00:00
Martin Mares 6a57bb3110 Killed a couple of unused variables.
We really should compile with warnings enabled.
2004-05-31 20:57:38 +00:00
Martin Mares 6ea8ca1469 Updated a comment. 2003-02-23 10:22:04 +00:00
Martin Mares 11d4474c17 Better selection of link-local NLRI addresses, at least for our own
address. Need to do it better for the other neighbors -- the current
solution works only if they use the standard 64+64 global addresses
and the interface identifier in lower 64 bits is the same as for the
link-scope addresses.
2003-02-22 22:47:45 +00:00
Martin Mares 8c92bf6a0d Temporary fix for BGP protocol capability announcement for IPv6 mode. 2003-02-22 10:40:35 +00:00
Martin Mares 60a72ed49b Fixed length check miscalculation in IPv6 receive path. 2003-02-22 10:25:22 +00:00
Martin Mares 7d875e094b Added missing includes. 2002-11-13 08:47:06 +00:00
Martin Mares de10a974f2 Added missing semicolons. 2002-11-13 08:46:12 +00:00
Martin Mares bcbdcbb6ae Don't accept incoming connections when the neighbor is not up. 2000-06-20 07:49:08 +00:00
Martin Mares 58f7d004fd Fixes to the progdoc. 2000-06-07 13:25:53 +00:00
Martin Mares 2e9b24211a Spelling fixes to progdoc. 2000-06-07 12:29:08 +00:00
Martin Mares 54e55169da BGP documented. 2000-06-04 17:06:18 +00:00
Martin Mares bc00185e5a Updated to new neighbor cache. 2000-06-01 13:00:19 +00:00
Martin Mares fcb5f4a725 Updated all the Doc files to new format. 2000-05-31 11:30:18 +00:00
Martin Mares 7294f68b3b path metric' and disable after error' are switches, not numeric clauses. 2000-05-29 22:08:04 +00:00
Martin Mares d2a7c0e9b2 Don't print trace messages about null updates. 2000-05-19 18:05:19 +00:00
Martin Mares 5e88d73025 BGP now reports originating AS and origin type in get_route_info(). 2000-05-19 11:01:41 +00:00
Martin Mares f4ab231746 bgp_get_status: If protocol is down, don't print BGP state. 2000-05-15 12:19:28 +00:00
Martin Mares e3f2d5fce3 Cleanup of configuration.
o  Use `expr' instead of `NUM' and `ipa' instead of `IPA',
   so that defined symbols work everywhere.
o  `define' now accepts both numbers and IP addresses.
o  Renamed `ipa' in filters to `fipa'.

Pavel, please update filters to accept define'd symbols as well.
2000-05-15 11:48:23 +00:00
Martin Mares 02bd064ab7 Adapted to new rt_notify semantics. 2000-05-13 11:02:02 +00:00
Martin Mares 2138d3b4d8 Use correct flags for the LOCAL_PREF attribute.
When an invalid attribute is found, copy the entire attribute to the data
section of the NOTIFICATION message.
2000-05-11 12:20:07 +00:00
Martin Mares c09d1e8df2 KEEPALIVE TIME ought to set keepalive time, not connect retry time :) 2000-05-08 22:32:17 +00:00
Martin Mares 0c3588bf5e Don't crash when the socket gets closed between updates.
Also, this time not only update `remains', but update it right :)
2000-05-08 14:53:22 +00:00
Martin Mares 9ff8f334ed Update `remains' counter correctly. 2000-05-08 14:32:19 +00:00
Martin Mares 93d6bf38a6 The bgp_list is gone. Incomming connections are now handled in a much
more straightforward manner by scanning the active configuration for
matching protocols.
2000-05-08 13:26:30 +00:00
Martin Mares 507eea4c8b Don't generate corrupted packets when sending only route deletes. 2000-05-08 12:37:24 +00:00
Martin Mares 79681f4a19 Link the instance to the global BGP list as soon as possible. 2000-05-08 11:04:22 +00:00
Martin Mares acfce55c86 Setup of incoming connection is now a separate function. 2000-05-07 10:41:45 +00:00
Martin Mares ab1129c1bd Added skeleton Doc files for the whole developer's documentation. 2000-05-05 17:17:42 +00:00
Martin Mares beaf86e13c Removed RTS_RIP_EXT. 2000-05-04 21:23:10 +00:00
Martin Mares 2a149b18cc Unused variables in IPv6 code. 2000-05-04 20:38:44 +00:00
Martin Mares 93a786cb03 Removed a lot of unused variables.
Please try compiling your code with --enable-warnings to see them. (The
unused parameter warnings are usually bogus, the unused variable ones
are very useful, but gcc is unable to control them separately.)
2000-05-04 20:30:36 +00:00
Martin Mares cf3d6470d7 IPv6 BGP support finished. Also simplified the BGP stuff a bit. 2000-05-04 20:02:56 +00:00
Martin Mares 1c1da87b27 Receive-only IPv6 BGP. 2000-05-04 09:03:31 +00:00
Martin Mares 53943a0022 Defined format specifier %M' which behaves as %m', but takes the
error code as an argument.

Use it in socket hooks where we really shouldn't rely on errno containing
the right value or even existing.
2000-05-02 16:10:04 +00:00
Martin Mares 85368cd4b7 Full protocol tracing. 2000-05-02 16:07:41 +00:00
Martin Mares d1a74339d4 Handle redistribution of unknown attributes correctly. 2000-05-02 12:51:39 +00:00
Martin Mares cea6366400 The `bgp_origin' attribute is now an enum. 2000-04-28 15:13:29 +00:00
Martin Mares f94557dec5 Some more fixes for attributeless UPDATEs. 2000-04-27 22:40:19 +00:00
Martin Mares 54896cbdba Path attribute can be missing if we process a packet with empty NLRI section. 2000-04-27 22:31:11 +00:00
Martin Mares 9165888ad2 Handle connect errors correctly. 2000-04-27 19:41:10 +00:00
Martin Mares 5db9bae286 IBGP fixes. 2000-04-26 13:26:31 +00:00
Martin Mares 6fd766c17e Implemented automatic restart after error with all the timers needed. 2000-04-25 23:08:31 +00:00
Martin Mares 8573314326 Avoid printing of error messages on Cease notifications. 2000-04-25 23:08:03 +00:00
Martin Mares b3155b3399 Randomize timers properly. 2000-04-25 22:01:19 +00:00
Martin Mares 42532f0846 Support dynamic reconfiguration. 2000-04-25 21:58:17 +00:00
Martin Mares 99f70c78e1 Use the same attribute names as in filters. 2000-04-25 21:31:15 +00:00
Martin Mares 684c25d98f When sending BGP attributes, re-create the flags, so that attributes
added by filters which get the flags wrong are fixed automagically.
2000-04-25 21:21:52 +00:00
Martin Mares efcece2da3 Better reporting of both local and remote errors. 2000-04-25 21:13:25 +00:00
Martin Mares a47a01083b Real parsing of BGP OPEN options including capability
negotiation.
2000-04-25 13:32:17 +00:00
Martin Mares 8b258e4e65 LOCAL_PREF is now always present and exported over all ibgp connections [draft]
Allow setting of address of the local end of the TCP connection.

Several bug fixes.
2000-04-21 13:01:28 +00:00
Martin Mares 2a9e064d7b If no NLRI's are present in an UPDATE message, parse the attributes, but
don't check presence of mandatory attributes. [draft-09]
2000-04-21 12:25:35 +00:00
Martin Mares 7787ace61a Synced to draft-ietf-idr-bgp4-09. 2000-04-20 22:54:22 +00:00
Martin Mares 9bc6ab4041 Fixed reporting of unknown options. 2000-04-20 22:34:50 +00:00
Martin Mares 5f532adde2 Temporarily ignore unknown options. 2000-04-19 13:54:35 +00:00
Martin Mares f381cdce52 The ATOMIC_AGGREGATE parameter is optional transitive. 2000-04-19 13:54:17 +00:00
Martin Mares e0d6a7bda4 Delay fetching of router ID. 2000-04-19 13:28:56 +00:00
Martin Mares 035044b1d9 Select the right source address and don't check port numbers. 2000-04-19 12:51:14 +00:00
Martin Mares bd2d8190dd Honor standard communities (no_export, no_advertise, no_export_subconfed)
when exporting routes.
2000-04-17 13:13:08 +00:00
Martin Mares 56a2bed46b Don't import/export MED and LOCAL_PREF on external links.
Added real comparison of BGP routes (inspired by the Cisco one).
Default local preference and default MED are now settable.
Defined filter keywords for all BGP attributes we know.
2000-04-17 12:46:07 +00:00
Martin Mares e3558ab14e Normalize community sets when exporting.
Set PARTIAL bits correctly.
2000-04-17 11:25:15 +00:00
Martin Mares 1ed2fe9609 Send and receive communities. 2000-04-17 10:19:15 +00:00
Martin Mares f421cfdd80 Sending of update messages works! 2000-04-17 09:37:31 +00:00
Martin Mares c0668f3696 Created nest/a-path.c and a-set.c which should contain general operations
on AS paths and community sets.

Moved as_path_prepend() there.

Pavel, please move the other functions as well.
2000-04-17 07:53:29 +00:00
Martin Mares c8f685cb9d Made last Pavel's changes compile. 2000-04-12 14:14:47 +00:00
Pavel Machek 0a40e97328 as_path_prepend is usable outside bgp. 2000-04-12 14:12:37 +00:00
Martin Mares c2b28c9910 Real bucket lists. 2000-04-12 14:09:26 +00:00
Pavel Machek ac7a2145cc f_new_dynamic_attr gets third argument, type as filters know it. 2000-04-12 14:02:04 +00:00
Martin Mares 12d5677aa3 Define BGP_PATH. 2000-04-12 13:56:04 +00:00
Martin Mares 7750634946 Introduced `ARRAY_SIZE' macro to replace all the sizeof(a)/sizeof(*a) constructs. 2000-04-12 13:21:23 +00:00
Martin Mares ae8f558499 Implemented outgoing attribute cache. 2000-04-10 12:39:51 +00:00
Martin Mares 48e842cc98 Use neighbor cache to track direct route to the peer or multihop destination.
Calculate next_hop properly based on the local address we get from the
neighbor entry.
2000-04-10 11:21:40 +00:00
Martin Mares ef2c708dfa More BGP progress...
For Pavel: You can use bgp_path_prepend() for prepending AS numbers to AS paths.
2000-04-09 22:05:02 +00:00
Martin Mares 10be74da20 Formatting of dynamic attributes (except for paths and communities which
will be added soon).
2000-04-01 10:21:11 +00:00
Martin Mares f880924990 BGP now handles incoming routes (IPv4 only). 2000-04-01 09:17:33 +00:00
Martin Mares c00d31befa Parsing of BGP attributes. 2000-03-31 23:21:37 +00:00
Martin Mares 973399ae2c Basic analysis of UPDATE packets. 2000-03-30 18:44:23 +00:00
Martin Mares b552ecc4d7 Connection state machine works. 2000-03-30 17:39:48 +00:00
Martin Mares 3fdbafb6f4 More BGP. This time it connects, but the state machine still isn't complete. 2000-03-30 10:44:20 +00:00
Martin Mares 72a6ef11fe Construction of BGP packets. 2000-03-21 15:53:50 +00:00
Martin Mares c01e37416d Started work on BGP. Wrote main part of the connection handling code. 2000-03-20 21:50:17 +00:00
Martin Mares 2638249d34 Bare skeleton of the BGP. 2000-03-19 22:09:07 +00:00