Commit graph

223 commits

Author SHA1 Message Date
Ondrej Zajicek (work) 28b3b55122 KRT: Fix IPv6 route learn
Internal table used for route learn was created with non-matching net
type for IPv6 kernel proto.

Thanks to Toke Hoiland-Jorgensen for the bugreport
2018-02-06 16:08:45 +01:00
Ondrej Zajicek (work) 85ad5855a0 Nest: Fix corner case in recursive next hop lookup
Thanks to Svenne Krap for the bugreport.
2018-01-29 12:49:37 +01:00
Ondrej Zajicek (work) 75d98b6013 Merge branch 'master' into int-new 2018-01-23 18:29:32 +01:00
Ondrej Zajicek (work) b940579115 Filter: Allow silent filter execution
A filter should log messages only if executed explicitly (e.g., during
route export or route import). When a filter is executed for technical
reasons (e.g., to establish whether a route was exported before), it
should run silently.
2018-01-16 16:20:01 +01:00
Ondrej Zajicek (work) 7fc55925be Several minor fixes 2017-12-10 00:55:34 +01:00
Ondrej Zajicek (work) f047271cb9 Timers: Parse and format functions for microsecond times
Date/time output (e.g. in logs, show commands) can use %f to specify
subsecond time. By default, millisecond precision is used in output.
2017-12-07 13:49:27 +01:00
Ondrej Zajicek (work) f2dd602fef Backport some minor changes from int-new 2017-09-12 16:33:29 +02:00
Ondrej Zajicek (work) a1f5e514ef Implement onlink flag for nexthops
Add proper support for per-nexthop onlink flag in routes to handle next
hop addresses that are not covered by interface IP ranges. Supported by
kernel and static protocols.

Thanks to Vincent Bernat for the idea.
2017-07-04 23:36:21 +02:00
Jan Moskyto Matejka 05d47bd53e Linpool: default allocation size 2017-05-16 15:34:57 +02:00
Jan Moskyto Matejka f8d44b01df Nest: split route show into separate file 2017-05-15 12:10:51 +02:00
Ondrej Zajicek (work) b29499996b Nest: Update of show route cmd
Some code cleanup, multiple bugfixes, allows to specify also channel
for 'show route export'. Interesting how such apparenty simple thing
like show route cmd has plenty of ugly corner cases.
2017-04-25 19:02:31 +02:00
Ondrej Zajicek (work) 4278abfe27 Check validity of dest w.r.t. net_type
Allow to define static roa/flow routes without dest.
2017-04-18 13:56:40 +02:00
Jan Moskyto Matejka 7ee07a3c39 Nest: Fix route lookup 2017-04-12 16:05:56 +02:00
Jan Moskyto Matejka 2faf519cf9 Client: multitable version of show route 2017-04-12 16:04:22 +02:00
Ondrej Zajicek (work) 1e37e35c3e BGP: Support for MPLS labels and VPN SAFI
Basic support for SAFI 4 and 128 (MPLS labeled IP and VPN) for IPv4 and
IPv6. Should work for route reflector, but does not properly handle
originating routes with next hop self.

Based on patches from Jan Matejka.
2017-03-22 18:16:49 +01:00
Jan Moskyto Matejka 3c74416465 Nexthop: Fixed recursive route mpls label merging 2017-03-17 15:48:32 +01:00
Ondrej Zajicek (work) 665be7f6bd Nest: Minor fixes in show route 2017-03-09 13:47:00 +01:00
Jan Moskyto Matejka 039a65d0e4 Nexthop: Fixed hostentry 2017-02-24 14:05:11 +01:00
Jan Moskyto Matejka 93f50ca317 Nest: names for nhu_state values
It took too much time to analyze what's the meaning of nhu_state values
so I spent less than the same amount of time documenting it.
2017-02-22 14:11:01 +01:00
Ondrej Zajicek (work) 62e64905b7 Several minor fixes 2017-02-20 02:26:45 +01:00
Jan Moskyto Matejka d47c3d64b2 MPLS: Label stack concatenation for recursive routes 2016-12-22 21:38:33 +01:00
Jan Moskyto Matejka d14f8c3c45 Netlink: MPLS routes in kernel
Anyway, Bird is now capable to insert both MPLS routes and MPLS encap
routes into kernel.

It was (among others) needed to define platform-specific AF_MPLS to 28
as this constant has been assigned in the linux kernel.

No support for BSD now, it may be added in the future.
2016-12-22 21:38:33 +01:00
Jan Moskyto Matejka f2010f9c65 Static: Protocol rework wrt. struct nexthop changes; MPLS label support 2016-12-22 21:38:33 +01:00
Jan Moskyto Matejka ec5e5d23fa Nexthop: Support for label stack in nest 2016-12-22 13:23:52 +01:00
Jan Moskyto Matejka 4e276a8920 Merged multipath and single-path data structures.
Dropped struct mpnh and mpnh_*()
Now struct nexthop exists, nexthop_*(), and also included struct nexthop
into struct rta.

Also converted RTD_DEVICE and RTD_ROUTER to RTD_UNICAST. If it is needed
to distinguish between these two cases, RTD_DEVICE is equivalent to
IPA_ZERO(a->nh.gw), RTD_ROUTER is then IPA_NONZERO(a->nh.gw).

From now on, we also explicitely want C99 compatible compiler. We assume
that this 20-year norm should be known almost everywhere.
2016-12-22 13:01:06 +01:00
Ondrej Zajicek (work) 77234bbbde Basic flow specification support (RFC 5575)
Add flow4/flow6 network and rt-table type and operations, config grammar
and static protocol support.

Squashed flowspec branch from Pavel Tvrdik.
2016-12-07 15:54:19 +01:00
Jan Moskyto Matejka ad88b94bca Merge branch 'int-new-rpki-squashed' (early part) into int-new 2016-12-07 15:30:46 +01:00
Ondrej Zajicek (work) d15b0b0a1b BGP redesign
Integrated and extensible BGP with generalized AFI handling,
support for IPv4+IPv6 AFI and unicast+multicast SAFI.
2016-12-07 14:20:52 +01:00
Pavel Tvrdik f6e8e141df Check table type at `show route for ...' 2016-12-07 09:35:24 +01:00
Pavel Tvrdík 65d2a88dd2 RPKI protocol with one cache server per protocol
The RPKI protocol (RFC 6810) using the RTRLib
(http://rpki.realmv6.org/) that is integrated inside
the BIRD's code.

Implemeted transports are:
 - unprotected transport over TCP
 - secure transport over SSHv2

Example configuration of bird.conf:
  ...
  roa4 table r4;
  roa6 table r6;

  protocol rpki {
    debug all;

    # Import both IPv4 and IPv6 ROAs
    roa4 { table r4; };
    roa6 { table r6; };

    # Set cache server (validator) address,
    # overwrite default port 323
    remote "rpki-validator.realmv6.org" port 8282;

    # Overwrite default time intervals
    retry   10;         # Default 600 seconds
    refresh 60;         # Default 3600 seconds
    expire 600;         # Default 7200 seconds
  }

  protocol rpki {
    debug all;

    # Import only IPv4 routes
    roa4 { table r4; };

    # Set cache server address to localhost,
    # use default ports tcp => 323 or ssh => 22
    remote 127.0.0.1;

    # Use SSH transport instead of unprotected transport over TCP
    ssh encryption {
      bird private key "/home/birdgeek/.ssh/id_rsa";
      remote public key "/home/birdgeek/.ssh/known_hosts";
      user "birdgeek";
    };
  }
  ...
2016-12-07 09:35:24 +01:00
Ondrej Zajicek (work) 8860e991f6 Merge branch 'master' into int-new 2016-11-08 19:27:58 +01:00
Ondrej Zajicek (work) cc5b93f72d Merge tag 'v1.6.2' into int-new 2016-11-08 17:04:29 +01: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
Jan Moskyto Matejka 2e7fb11a6e Fixed memory bloating on kernel merge paths together with export filter.
Some memory was being allocated from bad linpool, not from the given one
as they should.

Thanks to Madhu and Justin Cattle for reporting this.
2016-10-12 14:22:01 +02:00
Pavel Tvrdik a290da25a1 rt-table: Fix kernel protocol export filter memory bug
Kernel protocol calls rt_export_merged(), which used @rte_update_pool for
temporary allocations, supposing it is called from other functions from
rt-table.c that handles locking and flushing of the linpool. Therefore,
linpool was not flushed properly and memory leaked.

Add linpool argument to rt_export_merged() and use @krt_filter_lp when
called from kernel protocol.

Thanks to Justin Cattle and Alexander Frolkin for the bugreport.

(Commit squashed and updated by Ondrej Zajicek)
2016-09-15 15:57:51 +02:00
Ondrej Zajicek (work) 84cac51a51 Nest: Keep multipath next hops sorted 2016-09-14 11:53:54 +02:00
Pavel Tvrdik d107ef78df Whitespace fixes 2016-08-16 13:02:32 +02:00
Ondrej Filip 6887f409f0 Prepare for longer interface names - clean up of the code. 2016-07-17 14:54:52 +02:00
Ondrej Zajicek (work) af678af0d5 Merge remote-tracking branch 'origin/master' into int-new 2016-05-12 18:03:23 +02:00
Ondrej Zajicek (work) 286e2011d2 Miscellaneous minor fixes 2016-05-12 16:04:47 +02:00
Pavel Tvrdik 8e433d6a52 Prog Doc: Complete several missing parameters 2016-05-12 15:49:44 +02:00
Jan Moskyto Matejka 2003a18407 Route update: move table lookup from protocols into rte_update2().
Many protocols do almost the same when creating a rte_update request
before calling rte_update2(). This commit should simplify the protocol
side of the route-creation routine.
2016-04-08 13:09:06 +02:00
Jan Moskyto Matejka 4bdf1881dc Channelize: rt_notify arg conversion table -> channel 2016-04-07 10:08:23 +02:00
Pavel Tvrdík 1bb3ecb2a5 Fix closing flushed channel
Fix reading from freed memory.
  Free at: channel_set_state(c, CS_DOWN)
  Read at: WALK_LIST2_DELSAFE(c, n, x, tab->channels, table_node)

==00:00:00:00.261 24718==
==00:00:09:31.755 24718== Invalid read of size 8
==00:00:09:31.755 24718==    at 0x4061BA: rt_prune_table (rt-table.c:1688)
==00:00:09:31.755 24718==    by 0x405D5E: rt_event (rt-table.c:1559)
==00:00:09:31.755 24718==    by 0x45D089: ev_run (event.c:85)
==00:00:09:31.755 24718==    by 0x45D158: ev_run_list (event.c:142)
==00:00:09:31.755 24718==    by 0x462814: io_loop (io.c:2412)
==00:00:09:31.755 24718==    by 0x468712: main (main.c:833)
==00:00:09:31.755 24718==  Address 0x5601538 is 136 bytes inside a block of size 304 free'd
==00:00:09:31.755 24718==    at 0x4C29D2A: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:09:31.755 24718==    by 0x46FF3E: rfree (resource.c:166)
==00:00:09:31.755 24718==    by 0x470309: mb_free (resource.c:415)
==00:00:09:31.755 24718==    by 0x406A6B: rt_unlock_table (rt-table.c:1921)
==00:00:09:31.755 24718==    by 0x40DAE3: channel_do_down (proto.c:297)
==00:00:09:31.755 24718==    by 0x40DD46: channel_set_state (proto.c:359)
==00:00:09:31.755 24718==    by 0x4061AD: rt_prune_table (rt-table.c:1692)
==00:00:09:31.755 24718==    by 0x405D5E: rt_event (rt-table.c:1559)
==00:00:09:31.755 24718==    by 0x45D089: ev_run (event.c:85)
==00:00:09:31.755 24718==    by 0x45D158: ev_run_list (event.c:142)
==00:00:09:31.755 24718==    by 0x462814: io_loop (io.c:2412)
==00:00:09:31.755 24718==    by 0x468712: main (main.c:833)
==00:00:09:31.755 24718==  Block was alloc'd at
==00:00:09:31.755 24718==    at 0x4C28C10: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:09:31.755 24718==    by 0x470FBC: bird_xmalloc (xmalloc.c:29)
==00:00:09:31.755 24718==    by 0x4701E6: mb_alloc (resource.c:339)
==00:00:09:31.755 24718==    by 0x406C29: rt_commit (rt-table.c:1977)
==00:00:09:31.755 24718==    by 0x45C36D: config_do_commit (conf.c:269)
==00:00:09:31.755 24718==    by 0x45C545: config_commit (conf.c:361)
==00:00:09:31.755 24718==    by 0x4686F9: main (main.c:822)
==00:00:09:31.755 24718==
2016-02-08 16:08:50 +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
Pavel Tvrdík 0264ccf6f4 Rewrite roa_check() for integrated BIRD
Thanks to Ondrej Zajicek for his support with writing this code.
2016-01-20 16:46:58 +01:00
Pavel Tvrdík b9f5692186 Fix check in net_route() in debug mode 2016-01-07 18:24:14 +01:00
Pavel Tvrdík de9b87f558 Add NET ROA4/6 structures 2016-01-07 18:21:31 +01:00
Ondrej Zajicek (work) 04632fd77f Follow-up work on integration 2015-12-24 15:56:04 +01:00
Ondrej Zajicek (work) 600998fcb1 Modify FIB_WALK() and FIB_ITERATE() to work with new FIB code
Returned user data pointers have offset relative to fib_node.
2015-12-21 20:28:44 +01:00