0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-20 12:25:20 +00:00
Commit Graph

144 Commits

Author SHA1 Message Date
Ondrej Zajicek (work)
9e7b3ebdf9 IO: Replace RX priority heuristic with explicit mark
In BIRD, RX has lower priority than TX with the exception of RX from
control socket. The patch replaces heuristic based on socket type with
explicit mark and uses it for both control socket and BGP session waiting
to be established.

This should avoid an issue when during heavy load, outgoing connection
could connect (TX event), send open, but then failed to receive OPEN /
establish in time, not sending notifications between and therefore
got hold timer expired error from the neighbor immediately after it
finally established the connection.
2016-04-06 11:49:34 +02:00
Jan Moskyto Matejka
9656dce72e ROA code switchoff 2015-12-20 13:04:07 +01:00
Ondrej Zajicek (work)
9b9a7143c4 Conf: Fixes bug in symbol lookup during reconfiguration
Symbol lookup by cf_find_symbol() not only did the lookup but also added
new void symbols allocated from cfg_mem linpool, which gets broken when
lookups are done outside of config parsing, which may lead to crashes
during reconfiguration.

The patch separates lookup-only cf_find_symbol() and config-modifying
cf_get_symbol(), while the later is called only during parsing. Also
new_config and cfg_mem global variables are NULLed outside of parsing.
2015-11-09 00:42:02 +01:00
Pavel Tvrdík
ae80a2de95 unsigned [int] -> uint 2015-06-08 02:24:08 +02:00
Ondrej Zajicek
8bcb5fb1e8 Implement latency tracking, internal event log and watchdog 2015-03-02 09:41:14 +01:00
Ondrej Zajicek
05476c4d04 IPv4/IPv6 integrated socket code. 2014-05-18 11:42:26 +02:00
Ondrej Zajicek
0c791f873a BGP graceful restart support.
Also significant core protocol state changes needed for that,
global graceful restart recovery state and kernel proto support
for recovery.
2014-03-20 14:07:12 +01:00
Ondrej Zajicek
4e398e34bf Workaround thread-unsafeness of cli_echo(). 2014-02-07 13:09:55 +01:00
Ondrej Zajicek
0aeac9cb7f Merge commit 'origin/bfd' 2013-11-22 02:48:44 +01:00
Ondrej Filip
1cd198cf52 Flag -f "run in foreground" added as requested by a package maintainter. 2013-10-05 22:45:08 +02:00
Ondrej Zajicek
0e175f9f0f Fixes some BFD bugs and makes logging thread-safe. 2013-10-05 20:12:28 +02:00
Ondrej Zajicek
e7c2380260 Implements PID file support.
Thanks to Thierry Fournier for the original patch.
2013-10-05 19:30:12 +02:00
Ondrej Zajicek
1103b32e83 Allows to define constants of all filter types. 2013-07-25 22:33:57 +02:00
Ondrej Zajicek
a92cf57dd6 Implements undo command and optional timeout for configuration
Several new configure command variants:

configure undo - undo last reconfiguration
configure timeout - configure with scheduled undo if not confirmed in timeout
configure confirm - confirm last configuration
configure check - just parse and validate config file
2012-12-26 12:40:48 +01:00
Ondrej Zajicek
4be266a983 Implements wildcard matching in config file include.
Also fixes some minor bugs in include.

Thanks Kelly Cochran for suggestion and draft patch.
2012-07-18 19:29:33 +02:00
Ondrej Zajicek
ab188fb76d Implements build options to specify socket dir and suffix. 2012-05-03 12:25:15 +02:00
Ondrej Filip
ed7c4b0cd5 Small bugfix in error message related to reconfiguration. 2012-04-09 14:19:28 +02:00
Ondrej Zajicek
72aed1a00b Adds krt_source route attribute.
Thanks Jeremie Dimino for the original patch.
2012-03-23 00:26:26 +01:00
Ondrej Zajicek
df27911880 Fixes problem with dirname().
Thanks Henrique de Moraes Holschuh for the original patch.
2012-03-19 13:00:00 +01:00
Ondrej Zajicek
af582c4811 Route Origin Authorization basics.
- ROA tables, which are used as a basic part for RPKI.
 - Commands for examining and modifying ROA tables.
 - Filter operators based on ROA tables consistent with RFC 6483.
2012-03-18 17:32:30 +01:00
Ondrej Zajicek
9b7fdfc84a Fixes for include. 2011-10-10 01:41:08 +02:00
Ondrej Filip
48ec367aab Configuration can include other files. 2011-09-11 21:21:47 +02:00
Ondrej Zajicek
b1b1943360 The generalized TTL security mechanism (RFC 5082) support.
Thanks to Alexander V. Chernikov for the patch.
2011-08-16 23:13:05 +02:00
Ondrej Zajicek
e8b89a6104 Update and document the privilege restriction. 2011-05-15 16:29:44 +02:00
Ondrej Zajicek
1bc2695744 Allows run with restricted privileges.
Adds option -u and -g to specify user and group.
When different user (than root) is specified,
linux capabilities CAP_NET_* are kept.
2011-05-10 02:42:17 +02:00
Ondrej Zajicek
acc93efd4c Use constants from /etc/iproute2/rt_* files. 2011-04-28 00:31:37 +02:00
Ondrej Zajicek
44d4ab7a96 Configurable syslog name.
Also fixes a bug in syslog initialization.
2010-04-07 15:34:45 +02:00
Ondrej Zajicek
97e46d28ff Adds check for no protocol and some minor CLI fixes.
- Adds check to deny config file with no specified protocol to prevent
  loading of empty config file.
- Moves CLI init before config parse to receive immediate error message
  when cannot open control socket.
- Fixes socket name path check and other error handling in CLI init.
2010-03-17 12:19:22 +01:00
Ondrej Zajicek
e0a45fb421 Restricted read-only CLI.
Also adds support for executing commands using birdc <cmd>.
2010-02-21 09:57:26 +01:00
Ondrej Zajicek
76b53a4e20 Adds some log messages related to configure.
Also fixes a bug in the previous patch.
2010-02-06 22:57:51 +01:00
Ondrej Zajicek
a6250a7d10 Fix -p option. 2009-11-26 23:23:29 +01:00
Ondrej Zajicek
a4644ed6ab Implement option to exit after config file parsing. 2009-11-19 11:44:17 +01:00
Ondrej Zajicek
653b4015f1 After shutdown, BIRD should have exit code 0. 2009-11-13 14:54:43 +01:00
Ondrej Zajicek
d3f36e5978 Fixes BIRD socket unlink. 2009-11-13 14:43:29 +01:00
Ondrej Zajicek
6baef17ecf Fixes bug in CLI TX buffer management. 2009-07-14 14:18:54 +02:00
Ondrej Zajicek
bf1aec970e Adds support for soft reconfiguration. 2009-06-19 23:49:34 +02:00
Ondrej Filip
3c3271d9fc Close fd of config file after reconfiguration. 2008-08-24 23:24:14 +00:00
Martin Mares
8411a37e7d Detach from the TTY properly. 2007-06-20 07:33:26 +00:00
Ondrej Filip
41c8976e29 Test old instance of BIRD. 2004-06-06 17:05:25 +00:00
Martin Mares
6578a60493 Marked unused parameters in sysdep code as such. 2004-06-05 09:11:07 +00:00
Ondrej Filip
cb4dd4e2f7 Deleted useless rfree. (Socked was freed by cli_free()) 2004-06-02 15:14:49 +00:00
Martin Mares
ea0ac8f69a Move CLI socket to the newly created CLI's pool.
(thanks to Andreas for the original idea)
2004-05-31 22:00:18 +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
5f2a6a9ff3 Fix handling on full pipe to client in bird. Prevent packet overflows
for even only medium sized route table output. Fix a strange garbled
output problem in the client. The latter seems to be caused by some
library doing tcflush while there is still command output pending. So
the best fix here is to do fflush and then tcdrain. Note that this
problem occurs only under certain load situations and is not too easy to
reproduce.

(by Andreas)
2004-05-31 17:55:30 +00:00
Ondrej Filip
b1a1fabac7 *BSD port added. (Tested on FreeBSD and NetBSD) 2004-05-31 13:25:00 +00:00
Martin Mares
f9eb8f7e06 If compiled with --enable-debug, don't even try to log to syslog unless
the user forces it in the config file.
2000-06-19 23:50:02 +00:00
Martin Mares
5ddf4a58f9 During initialization, log to both syslog and stderr. When a configuration
file has been read and it doesn't specify any logging, log to syslog only
(if syslog is not available, then stderr).
2000-06-09 07:32:57 +00:00
Martin Mares
4761efdb43 Tracing of CLI connections/commands can be now controlled
by `debug commands <level>' in the configuration. Level 0 means
no tracing, 1 means connections only, 2 includes all commands.
2000-05-29 22:10:18 +00:00
Martin Mares
e67af42805 Support --version and --help. 2000-05-29 21:58:35 +00:00
Martin Mares
4524331a3d Fixed type in daemonization code. 2000-05-08 22:31:34 +00:00
Martin Mares
0bcba21e89 When not debugging, daemonize automatically. 2000-05-08 19:10:36 +00:00
Martin Mares
9a220cabbc #ifdef out lots of debugging information.
The long resource/routing table dump printed upon startup is gone now
and if you wish to see it, just send bird SIGUSR1 or use the `debug'
commands.
2000-05-04 20:52:28 +00:00
Martin Mares
f75e3bbc01 Fixed a couple of nasty CLI bugs which were triggered on long or multi-part
outputs. It took a whole evening to hunt them down, but now the CLI seems
to work fine.

Now I run three BGP connections with several thousand routes!
2000-04-27 22:35:08 +00:00
Martin Mares
e1ddd99377 Changed handling of incoming connections, so that we can send data
from the send hook without worrying about existence of socket buffers.

Also, don't forget to copy peer addresses.
2000-04-26 13:26:11 +00:00
Martin Mares
3991d84e8f Changed initialization of protocol list -- now we call proto_build() instead
of calling the protocols manually.

Implemented printing of dynamic attributes in `show route all'.

Each protocol can now register its own attribute class (protocol->attr_class,
set to EAP_xxx) and also a callback for naming and formatting of attributes.
The callback can return one of the following results:

	GA_UNKNOWN	Attribute not recognized.
	GA_NAME		Attribute name recognized and put to the buffer,
			generic code should format the value.
	GA_FULL		Both attribute name and value put to the buffer.

Please update protocols generating dynamic attributes to provide
the attr_class and formatting hook.
2000-04-01 10:19:47 +00:00
Martin Mares
221135d6bf Include "lib/string.h" instead of <string.h>. It should give us bzero()
and other non-portable functions on all systems.
2000-03-31 23:30:21 +00:00
Martin Mares
320f417357 Defined sk_close() which closes the socket safely even if called from
socket hook. Replaces the SK_DELETED hack.

Squashed a couple of bugs in handling of TCP sockets.
2000-03-30 10:43:37 +00:00
Martin Mares
f098e072be Fixed a bunch of FIXME's by removing them :) 2000-03-12 22:53:05 +00:00
Martin Mares
6b9fa32080 Great cleanup of debug messages. LOCAL_DEBUG turned off in most modules,
several debug() calls converted to DBG().
2000-03-12 21:01:38 +00:00
Martin Mares
bf8558bc9c Converted shutdown to a kind of reconfiguration, it's no more handled
as a exception in protocol state machines. Introduced a `shutdown'
CLI command. Killed few reconfiguration bugs.
2000-01-16 17:40:26 +00:00
Martin Mares
50fe90edf3 First attempt on dynamic reconfiguration. There are still lots of bugs
and problems to solve, but the hardest part works.
2000-01-16 16:44:50 +00:00
Martin Mares
f545d38707 Added universal locking mechanism which will solve problems
with protocols wanting to use the same port on the same interface
during reconfiguration time.

How to use locks: In the if_notify hook, just order locks for the
interfaces you want to work with and do the real socket opening after the
lock hook function gets called. When you stop using the socket, close
it and rfree() the lock.

Please update your protocols to use the new locking mechanism.
1999-12-09 18:54:20 +00:00
Martin Mares
dc82daaa9b - Path to control socket is selectable via command-line option.
- die() when control socket open failed.
1999-12-08 13:20:19 +00:00
Martin Mares
a0c37b45e5 Logging is now configurable. You can define multiple log outputs (to both
files and syslog) and assign lists of message categories to each of them.
1999-12-06 13:45:56 +00:00
Martin Mares
b9672a845f The CLI I/O functions work as desired. 1999-10-31 15:43:44 +00:00
Martin Mares
7d3aab1c16 First steps of the Command Line Interface: I/O routines. 1999-10-29 12:10:10 +00:00
Pavel Machek
0498d92f95 Believe it or not, printf()'s does not work too much without this one. 1999-04-02 11:45:55 +00:00
Martin Mares
5bc512aa3a Clarify resource dumps and include them in the main debugging dump. 1999-03-29 20:14:33 +00:00
Martin Mares
7e5f5ffdda Moved to a much more systematic way of configuring kernel protocols.
o  Nothing is configured automatically. You _need_ to specify
     the kernel syncer in config file in order to get it started.
  o  Syncing has been split to route syncer (protocol "Kernel") and
     interface syncer (protocol "Device"), device routes are generated
     by protocol "Direct" (now can exist in multiple instances, so that
     it will be possible to feed different device routes to different
     routing tables once multiple tables get supported).

See doc/bird.conf.example for a living example of these shiny features.
1999-03-26 21:44:38 +00:00
Martin Mares
7a2105becd Use dmalloc instead of EFence when available (dmalloc has lot of improvements
over EFence and also hopefully smaller memory overhead, but sadly it's non-free
for commercial use).

If the DMALLOC_OPTIONS environment variable is not set, switch on `reasonable'
checks by default.

Also introduced mb_allocz() for cleared mb_alloc().
1999-03-04 11:36:26 +00:00
Martin Mares
2d14045224 Rewrote the kernel syncer. The old layering was horrible.
The new kernel syncer is cleanly split between generic UNIX module
and OS dependent submodules:

  -  krt.c (the generic part)
  -  krt-iface (low-level functions for interface handling)
  -  krt-scan (low-level functions for routing table scanning)
  -  krt-set (low-level functions for setting of kernel routes)

krt-set and krt-iface are common for all BSD-like Unices, krt-scan is heavily
system dependent (most Unices require /dev/kmem parsing, Linux uses /proc),
Netlink substitues all three modules.

We expect each UNIX port supports kernel routing table scanning, kernel
interface table scanning, kernel route manipulation and possibly also
asynchronous event notifications (new route, interface state change;
not implemented yet) and build the KRT protocol on the top of these
primitive operations.
1999-03-03 19:49:56 +00:00
Martin Mares
f4aabcee62 Perform gracious shutdown upon receipt of SIGTERM. Finally we can
test the whole protocol shutdown code... :)
1999-02-13 20:15:36 +00:00
Martin Mares
4c9dd1e4b9 Synchronize signals to the main select/event/timer loop.
Parse command line options.
1999-02-13 19:43:21 +00:00
Martin Mares
14dea0ed25 Run the event queue before writing SIGUSR dumps. 1999-02-11 22:51:15 +00:00
Martin Mares
31b3e1bbf5 Implemented new configuration/reconfiguration interface and defined protocol
state machines. Full explanation will follow soon.
1999-02-05 21:37:34 +00:00
Pavel Machek
ca3d562b24 filters_init() renamed to filters_postconfig(). 1999-01-15 18:13:55 +00:00
Pavel Machek
b9d70dc84e Filters, second try. This time they have their own directory. 1999-01-15 16:49:17 +00:00
Pavel Machek
41183888ee Properly initialize filters. Also bumped version to 0.0.0 as it
actually does something.
1999-01-15 14:40:50 +00:00
Martin Mares
08c69a7720 die() -> bug() where appropriate. 1998-12-20 14:27:37 +00:00
Martin Mares
980ffedbb0 Kernel syncer is now configurable. It will probably need some more
options, but at least basic tuning is possible now.
1998-12-06 17:40:42 +00:00
Martin Mares
c74c0e3cdf First attempt at protocol configuration (now done only for RIP). 1998-11-27 21:09:57 +00:00
Martin Mares
70591fa064 Compile and use the new configuration code by default. 1998-11-27 19:37:07 +00:00
Martin Mares
7d83290780 Generate router_id automatically if possible (standard "smallest of local
regular interface addresses" rule).

Protocols should NOT rely on router_id existence -- when router ID is not
available, the router_id variable is set to zero and protocols requiring
valid router ID should just refuse to start, reporting such error to the log.
1998-10-19 18:13:36 +00:00
Martin Mares
7e7790c61f Since almost every UNIX system requires different techniques for reading
the kernel routing table as opposed to modifying it which is approximately
the same on non-netlink systems, I've split the kernel routing table
routines to read and write parts. To be implemented later ;-)
1998-10-18 12:50:43 +00:00
Martin Mares
0432c0173b Split protocol init to building of protocol list and real protocol init.
Added kernel route table syncer skeleton.
1998-10-18 11:53:21 +00:00
Martin Mares
47b793064c Solve chicken-and-egg problems with protocol startup. We now queue all inactive
protocols and don't send route/interface updates to them and when they come up,
we resend the whole route/interface tables privately.

Removed the "scan interface list after protocol start" work-around.
1998-10-17 11:05:18 +00:00
Martin Mares
93f1c532e9 Moved scanning of interfaces, so that they get initialized after all
routing protocol instances.
1998-10-14 13:38:17 +00:00
Pavel Machek
86b0023033 Making SIGUSR1 dump also all protocols. 1998-07-09 19:37:39 +00:00
Martin Mares
fd50083df4 Killed socket debug code. Initialize config pool and protocols.
More to come later...
1998-06-03 08:43:44 +00:00
Martin Mares
869c695998 Synced to new interface code. 1998-06-01 21:41:32 +00:00
Martin Mares
8a48ecb8b1 Implemented scanning of network interfaces. Mostly very ugly code due to
terrible kernel interface (SIOGIFCONF and friends).
1998-05-26 21:42:05 +00:00
Martin Mares
b5d9ee5c87 Added UNIX implementation of both timers and sockets. Timers should work,
sockets were tested only in TCP mode. main.c now contains some test
cases for socket code.
1998-05-24 14:50:18 +00:00
Martin Mares
2326b001d6 Added routing table and routing attribute code. 1998-05-20 11:54:33 +00:00
Martin Mares
25697773b5 The library is now glued together from generic and OS-dependent parts
by the `mergedirs' script. Few more IP address manipulation functions
and some fixes.
1998-05-15 07:56:13 +00:00