Commit graph

84 commits

Author SHA1 Message Date
Ondrej Zajicek (work) b21104c97e Nest: Do not ignore secondary flag changes in ifa updates
Compare all IA_* flags that are set by sysdep iface code.

The old code ignores IA_SECONDARY flag when comparing whether iface
address updates from kernel changed anything. This is usually not an
issue as kernel removes all secondary addresses due to removal of the
primary one, but it breaks when sysctl 'promote_secondaries' is enabled
and kernel promotes secondary addresses to primary ones.

Thanks to 'Alexander' for the bugreport.
2021-12-18 01:09:52 +01:00
Ondrej Zajicek (work) b8bbbbaf56 Nest: Fix neighbor handling for colliding ranges
Resolve neighbors using longest prefix match. Although interface ranges
should not generally collide, it may happen for unnumbered links.

Thanks to Kenth Eriksson for the bugreport.
2020-05-11 04:29:36 +02:00
Maria Matejka fd9f0c0640 Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
2020-04-09 15:37:14 +02:00
Ondrej Zajicek (work) 18f70a6229 Nest: VRF of protocol can be explicitly specified as 'default'
Protocol can have specified VRF, in such case it is restricted to a set
of ifaces associated with the VRF, otherwise it can use all interfaces.

The patch allows to specify VRF as 'default', in which case it is
restricted to a set of iface not associated with any VRF.
2019-07-24 15:08:03 +02:00
Ondrej Zajicek (work) e2ae08694e Nest: Do not hard-reset interface when preferred address is changed
Modify protocols to use preferred address change notification instead on
depending on hard-reset of interfaces in that case, and remove hard-reset
in that case. This avoids issue when e.g. IPv6 protocol restarts
interface when IPv4 preferred address changed (as hard-reset is
unavoidable and common for whole iface).

The patch also fixes a bug when removing last address does not send
preferred address change notification.
2018-11-28 16:55:32 +01:00
Ondrej Zajicek (work) f2d8e6801e Filter: Make ifname attribute modifiable
Allow to change an interface associated with a route by setting
ifname attribute. It will also change the route to a direct one.
2018-11-05 22:03:21 +01:00
Ondrej Zajicek (work) addb1bcd86 Nest: Fix 'show interfaces summary' command
The command showed interfaces that were removed / in shutdown.
2018-10-11 14:39:13 +02:00
Ondrej Zajicek (work) a82f692e58 Nest: Trivial whitespace cleanup 2018-02-07 17:12:33 +01:00
Ondrej Zajicek (work) e87a95d97d Minor fixes for debug mode 2017-12-16 16:31:43 +01:00
Ondrej Zajicek (work) 7fc55925be Several minor fixes 2017-12-10 00:55:34 +01:00
Ondrej Zajicek (work) eb95b5ec1a Nest: Minor formatting changes 2017-12-08 15:16:47 +01:00
Ondrej Zajicek (work) 46434a3cad Merge commit '7b2c5f3d2826e3175bf31b1c36056c9efc587a2b' into int-new 2017-12-07 18:35:46 +01:00
Ondrej Zajicek (work) 4ff15a75c5 Merge commit '98bb80a243b58c43453e9be69d19d0350286549c' into int-new 2017-12-07 17:41:09 +01:00
Ondrej Zajicek (work) 153f02da3b Nest: Maintain separate IPv4, IPv6 and LLv6 preferred addresses
Also redesign preferred address selection and update protocols to use
appropriate preferred address.

Based on a previous work by Jan Maria Matejka.
2017-12-07 13:06:01 +01:00
Jan Moskyto Matejka 289c1a7968 Iface address debug dump fix 2017-10-17 16:52:18 +02:00
Ondrej Zajicek (work) 943478b00f Basic VRF support
Add basic VRF (virtual routing and forwarding) support. Protocols can be
associated with VRFs, such protocols will be restricted to interfaces
assigned to the VRF (as reported by Linux kernel) and will use sockets
bound to the VRF. E.g., different multihop BGP instances can use diffent
kernel routing tables to handle BGP TCP connections.

The VRF support is preliminary, currently there are several limitations:

- Recent Linux kernels (4.11) do not handle correctly sockets bound
to interaces that are part of VRF, so most protocols other than multihop
BGP do not work. This will be fixed by future kernel versions.

- Neighbor cache ignores VRFs. Breaks config with the same prefix on
local interfaces in different VRFs. Not much problem as single hop
protocols do not work anyways.

- Olock code ignores VRFs. Breaks config with multiple BGP peers with the
same IP address in different VRFs.

- Incoming BGP connections are not dispatched according to VRFs.
Breaks config with multiple BGP peers with the same IP address in
different VRFs. Perhaps we would need some kernel API to read VRF of
incoming connection? Or probably use multiple listening sockets in
int-new branch.

- We should handle master VRF interface up/down events and perhaps
disable associated protocols when VRF goes down. Or at least disable
associated interfaces.

- Also we should check if the master iface is really VRF iface and
not some other kind of master iface.

- BFD session request dispatch should be aware of VRFs.

- Perhaps kernel protocol should read default kernel table ID from VRF
iface so it is not necessary to configure it.

- Perhaps we should have per-VRF default table.
2017-09-06 17:38:48 +02:00
Michal 'vorner' Vaner 080d9e4ce2
Nicer log output
non-primary is ugly, just omit it (and use primary in the other case).
2017-08-10 14:35:14 +02:00
Michal 'vorner' Vaner 5699a2036c
Less confusing log message
A non-primary address isn't necessarily secondary, that's an independent
flag.
2017-08-10 13:06:05 +02:00
Jan Moskyto Matejka 3e236955c9 Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
2016-11-01 14:52:54 +01:00
Ondrej Zajicek (work) f4a60a9bc4 Channels - explicit links between protocols and tables
The patch adds support for channels, structures connecting protocols and
tables and handling most interactions between them. The documentation is
missing yet.
2016-02-01 10:28:50 +01:00
Ondrej Zajicek (work) 23c212e7f1 Follow-up work on integration 2015-12-21 03:33:18 +01:00
Jan Moskyto Matejka 7fd4143ead Integrated address print lengths
Minor changes by Ondrej Santiago Zajicek
2015-12-20 13:47:39 +01:00
Ondrej Zajicek (work) d44e686e9b Follow-up commit on integrated BIRD
Use net_addr for interface address prefixes, support net_addr in
configuration parser.
2015-11-12 02:03:59 +01:00
Ondrej Zajicek f92e6ab364 Changes order of iface/addr/neigh event hooks.
Now the order is:

Up   -> iface, addr, neigh
Down -> neigh, addr, iface

It fixes the case when an iface appears, related static routes are
activated and exported to OSPF before the iface notification and
therefore forwarding addresses are not encoded in generated external
LSAs.
2014-11-03 20:35:58 +01:00
Ondrej Zajicek e4d179f2c2 Minor changes to default router ID calculation. 2013-11-24 12:50:53 +01:00
Ondrej Zajicek cd3b02d198 Allows IP of loopback to be used in automatic router ID selection.
Thanks to Alexander V. Chernikov for the patch.
2013-04-16 17:53:22 +02:00
Ondrej Zajicek 79b4e12e60 Implements interface masks for choosing router id.
Router ID could be automatically determined based of subset of
ifaces/addresses specified by 'router id from' option. The patch also
does some minor changes related to router ID reconfiguration.

Thanks to Alexander V. Chernikov for most of the work.
2012-12-27 12:56:23 +01:00
Ondrej Zajicek 09686693d3 Implements handling of BSD iface arrival/departure notifications.
Thanks to Alexander V. Chernikov for original patch.
2012-01-23 03:15:12 +01:00
Ondrej Zajicek 732a0a257d Fixes problems with creating/removing/renaming ifaces on BSD. 2012-01-23 01:26:40 +01:00
Ondrej Zajicek bc09257117 Fixes another minor bug in iface scan.
Iface flags are not updated in some cases.
2012-01-21 22:56:16 +01:00
Ondrej Zajicek 69a8259c5e Allows sticky link-local neighbors.
Allows using NEF_STICKY neighbors with link-local addresses. This is
used for static route nexthops, they can be specified like fe80::1%eth0
.
2012-01-01 12:14:42 +01:00
Ondrej Zajicek cf7f064531 Fixes problem with sticky neighbors and iface address changes.
Thanks Matthias Schiffer for the bugreport and the original patch.
2011-12-12 00:24:15 +01:00
Ondrej Zajicek a506476acd There may be more IP address records with the same IP. 2011-05-01 18:42:32 +02:00
Ondrej Zajicek 52a43ae3b7 Minor changes in addresses.
Mainly changes IA_UNNUMBERED to IA_PEER and adds IA_HOST. Also do not
show broadcast addr in show interfaces. Nobody cares for that.
2011-03-28 22:46:18 +02:00
Ondrej Zajicek 8cab377d92 Remove unnecessary check. 2010-12-22 23:33:40 +01:00
Ondrej Zajicek fe181e7c63 Adds support for iface link check to static protocol. 2010-11-11 12:24:27 +01:00
Ondrej Zajicek f25cb0ef9f Implements link state detection.
Also changes some symbol names (IFF_ADMIN_DOWN -> IFF_SHUTDOWN,
IFF_LINK_UP -> IFF_ADMIN_UP).
2010-11-11 10:03:02 +01:00
Ondrej Zajicek 5d53b80770 Allow iface pattern matching code to match peer address on ptp links. 2010-03-19 18:46:56 +01:00
Ondrej Zajicek 0aad2b9292 Temporary OSPF commit - sockets. 2010-03-14 16:36:59 +01:00
Ondrej Zajicek 53434e44a9 Better flushing of interfaces.
When device protocol goes down, interfaces should be flushed
asynchronously (in the same way like routes from protocols are flushed),
when protocol goes to DOWN/HUNGRY.

This fixes the problem with static routes staying in kernel routing
table after BIRD shutdown.
2010-02-27 16:00:07 +01:00
Ondrej Zajicek 874b868544 Implements primary address selection base on 'primary' option. 2009-05-29 22:49:30 +02:00
Ondrej Zajicek 20e94fb85b A change in OSPF and RIP interface patterns.
Allows to add more interface patterns to one common 'options'
section like:

interface "eth3", "eth4" { options common to eth3 and eth4 };

Also removes undocumented and unnecessary ability to specify
more interface patterns with different 'options' sections:

interface "eth3" { options ... }, "eth4" { options ... };
2009-05-06 22:02:45 +02:00
Martin Mares 7b7a7b43a6 There can be multiple primary addresses with different scopes
and only the highest scope one has IA_PRIMARY set, so report
the remaining ones as "Unselected".
2003-02-22 22:39:06 +00:00
Ondrej Filip a5096a1bde Yet another nasty bugfix of iface_patts_equal(). 2000-11-08 22:46:54 +00:00
Ondrej Filip 0639f7263a Bugfix in iface_patts_equal.
When both patterns were NULL strcmp it sigfaulted.
2000-11-08 17:06:35 +00:00
Martin Mares 5c18880e35 Avoid sentence containing a colon to start new doc subsection. 2000-06-05 21:26:11 +00:00
Martin Mares 3d675cdbe7 More documentation. 2000-06-03 14:40:39 +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 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 85a291ff30 IPv6 address classification fixes. 2000-05-02 15:21:51 +00:00