Commit Graph

19618 Commits

Author SHA1 Message Date
Donatas Abraitis
acf6f22d15 bgpd: Return bool type for ecommunity_add_val and subgroup_announce_check
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-05 22:08:01 +03:00
Donatas Abraitis
71be4bd9ab
Merge pull request #6664 from donaldsharp/cpick_7.4
bgpd: Actually find the sequence number for `bgp extcommunity-list...`
2020-07-02 08:03:53 +03:00
Donald Sharp
34f6d0c67a bgpd: Actually find the sequence number for bgp extcommunity-list...
The code in the bgp extcommunity-list function was using
argv_find to get the correct idx.  The problem was that
we had already done argv_finds before and idx was non-zero
thus having us always set the seq pointer to what was last
looked up.  This causes us to pass in a value to the
underlying function and it would just wisely ignore it
causing a seq number of 0.

We would then write this seq number of 0 and then immediately
reject it on read in again.  BOO!

Actually handle argv_find the way it was meant to be.

Ticket:CM-29926
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-01 14:03:31 -04:00
Martin Winter
e4dcf108d6
FRRouting Release 7.4
BGPd
   Use sequence numbers for community lists
   Fixes to nexthop groups
   Add feature to limit outgoing number of routes
   Per Neighbor Graceful Restart
   Multiple Graceful Restart fixes
   Support sub-Type-4 and sub-Type-5 for the VPNv4 SRv6 backend
   rfc7606 support: treat certain malformed routes as withdraw
   allow origin override for route aggregates
   rfc6608 support: Subcodes for BGP Finite State Machine Error
   rfc7607 support: Codification of AS 0 Processing
   rfc6286 support: Autonomous-System-Wide Unique BGP Identifier for BGP-4
   Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth
   Enable rfc8212 by default except datacenter profile
staticd
   Add debug support
vtysh
   Add copy command to copy config from file into running config
LDPd
   adding support for LDP ordered label distribution control
ISISd
   IS-IS Segment Routing support
SHARPd
   add initial support to add/remove lsps
Zebra
   fix broadcast address in IPv4 networks with /31 mask
   Add Graceful Restart support for Protocol Daemon restarts
lib
   migrate route-maps to use northbound interface
plus countless bug fixes and other improvements

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-06-30 13:08:57 +02:00
Russ White
08d14c8157
Merge pull request #6629 from ton31337/fix/network_check_import_for_static_bgp_7.4
bgpd: [7.4] Do not treat the route as martian for static BGP routes
2020-06-23 11:46:56 -04:00
Donatas Abraitis
7ca4ef12b8 bgpd: Do not treat the route as martian for static BGP routes
If we have something like:
```
ip route 1.1.1.0/24 Null0
!
router bgp 100
 no bgp ebgp-requires-policy
 neighbor 192.168.0.2 remote-as 200
 !
 address-family ipv4 unicast
  network 1.1.1.0/24
  redistribute connected
 exit-address-family
!
line vty
!
```

1.1.1.0/24 is not advertised due to martian nexthop (0.0.0.0). It starts
working only when we use `redistribute static`.

By checking if it's a BGP static route we able to announce
1.1.1.0/24 with `network 1.1.1.0/24` without redistribute even when
`bgp import-check` is enabled.

Disabling `bgp import-check` works as well, but it's enabled by default
since 7.4.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-23 16:45:39 +03:00
Donald Sharp
e28f42625e
Merge pull request #6570 from mjstapp/fix_daemon_fini_7_4
[7.4] Daemons should call frr_fini() on shutdown
2020-06-11 18:47:49 -04:00
Mark Stapp
70504ec45a *: have daemons call frr_fini() at termination
Fix a number of library and daemon issues so that daemons can
call frr_fini() during normal termination. Without this,
temporary logging files are left behind in /var/tmp/frr/.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-11 15:41:52 -04:00
Mark Stapp
5812b45fb3 lib: don't try to change/reset capabilities if process has none
A couple of daemons take/use no capabilities/privs; allow cleanup
of the privs/capabilities library module even if a daemon has no
caps.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-11 15:41:52 -04:00
Donald Sharp
c8296ab8af
Merge pull request #6558 from opensourcerouting/7.4/zlogbuf-litter
[7.4] lib: set up TLS log buffer after forking
2020-06-10 19:04:39 -04:00
Donald Sharp
9bf78e1b50
Merge pull request #6560 from ton31337/fix/configuration_for_labeled_unicast_in_place_7.4
bgpd: [7.4] Make sure network/aggregate-address commands lay down under labeled safi
2020-06-10 18:52:47 -04:00
Donatas Abraitis
48b38d5b27 bgpd: Make sure network/aggregate-address commands lay down under labeled safi
unicast and labeled-unicast share the same table, but configuration should
be visible for both independently. Without this fix it confuses a bit
because when you enter `network 10.0.0.0/24` under labeled-unicast it's
written in unicast family block.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-10 23:12:36 +03:00
David Lamparter
0f133bad7f lib: set up TLS log buffer after forking
... it contains our pid, so doing it before fork leads to littering
buffers since we try to clean up with the forked pid...

Fixes: #6541
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-06-10 20:38:02 +02:00
Donald Sharp
b286cd18e9
Merge pull request #6553 from ton31337/fix/bgp_dampening_vty_bug_7.4
bgpd: [7.4] Duplicate `bgp dampening ...` stuff
2020-06-10 11:08:03 -04:00
Donatas Abraitis
923e64a83b bgpd: Print dampening configuration per AF, not per neighbor
This caused duplicate `bgp dampening ...` to be printed per neighbor.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-10 16:25:00 +03:00
Donatas Abraitis
abe702de9f bgpd: Allow setting dampening for more address families
Until now, it was possible to set only for ipv4 unicast/multicast.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-10 16:24:56 +03:00
Donald Sharp
1cc3b453b6
Merge pull request #6539 from ton31337/fix/refcnt_check_for_dep_data_route-map_7.4
lib: [7.4] Make sure route_map_dep_data is not NULL before decrementing ref…
2020-06-09 15:27:20 -04:00
David Lamparter
a261fd2753
Merge pull request #6524 from ton31337/fix/set_ipv6_ll_if_global_zero_7.4
bgpd: [7.4] Use IPv6 LL address as nexthop if global was set to ::/LL
2020-06-09 16:42:37 +02:00
Donatas Abraitis
8517e219c9 lib: Make sure route_map_dep_data is not NULL before decrementing refcount
```
2  0x00007fb9adb07a10 in core_handler (signo=11, siginfo=0x7ffe1414a630, context=<optimized out>) at lib/sigevent.c:228
        sa_default = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
        sigset = {__val = {8192, 0 <repeats 15 times>}}
3  <signal handler called>
No locals.
4  route_map_dep_update (type=RMAP_EVENT_CLIST_DELETED, rmap_name=0x55d807ddd410 "export4-as49917", dep_name=<optimized out>, dephash=0x55d807adf170) at lib/routemap.c:2750
        dep = 0x55d807d35b00
        dname = 0x55d8081ba560 "123:124"
        rname = 0x55d8081ba540 "export4-as49917"
        ret = 0
        dep_data = 0x0
        ret_dep_data = 0x0
        tmp_dep_data = {rname = 0x55d8081ba540 "export4-as49917", refcnt = 0}
5  route_map_upd8_dependency (type=RMAP_EVENT_CLIST_DELETED, arg=<optimized out>, rmap_name=0x55d807ddd410 "export4-as49917") at lib/routemap.c:2865
        upd8_hash = 0x55d807adf170
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-09 15:02:07 +03:00
Donatas Abraitis
b6251279e0 bgpd: Use IPv6 LL address as nexthop if global was set to ::/LL
This happens between Bird and FRR. Maybe others as well, dunno.

Bird sends ::(fe80::1588) and we have a nexthop as :: which is inaccessible:

```
BGP routing table entry for fdff:b87d:f5b0::/48
Paths: (1 available, no best path)
  Not advertised to any peer
  4242421588 4242422547 4242422601 4242423605
    :: (inaccessible) from fe80::1588 (172.20.16.140)
    (fe80::1588) (used)
      Origin IGP, invalid, external
      Last update: Mon May 25 14:27:02 2020
```

bgpd[9554]: fe80::1588 went from OpenConfirm to Established
bgpd[9554]: fe80::1588 [FSM] Timer (routeadv timer expire)
bgpd[9554]: fe80::1588 rcvd UPDATE w/ attr: , origin i, mp_nexthop ::(fe80::1588)
bgpd[9554]: fe80::1588 rcvd UPDATE wlen 0 attrlen 120 alen 0
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:2d42::/64 IPv6 unicast
bgpd[9554]: Allocated bnc ::/128(VRF default) peer 0x0
bgpd[9554]: bgp_update(0.0.0.0): NH unresolved
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:d42::/64 IPv6 unicast

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-06-07 18:29:01 +03:00
Donald Sharp
1edce7d2c8
Merge pull request #6413 from FRRouting/dev_isis_sr
isisd: IS-IS Segment Routing support
2020-05-15 15:06:55 -04:00
Donald Sharp
848a8ed789
Merge pull request #6409 from ton31337/feature/missing_to_7.4
[7.4] bgpd two fixes
2020-05-15 07:47:05 -04:00
Donatas Abraitis
7288f0807b
Merge pull request #6408 from donaldsharp/reload_74
[7.4] DC's
2020-05-15 09:04:29 +03:00
Donatas Abraitis
90a80a85c4 bgpd: Set a proper SAFI for labaled-unicast when looking for scount
The problem is that peer_af_array returns NULL when SAFI is changed to
unicast. We use unicast table, but peer is created and activated under
labeled-unicast, hence we should lookup with a proper SAFI id.

Without this patch peer_af_find() returns NULL and we can't show
PfxSnt in `show bgp summary`.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-14 23:01:45 +03:00
Donatas Abraitis
2564e16cd2 bgpd: Use default AFI_IP6/SAFI_UNICAST when displaying statistics
Without specifying a default afi/safi we get a segfault:

```
(gdb) frame 4
bgp_table_stats (..., afi=32724, safi=SAFI_UNICAST, ...
11349		if (!bgp->rib[afi][safi]) {
(gdb)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-14 23:01:02 +03:00
Donald Sharp
c26ad06464 bgpd: bgp bestpath bandwidth should not be a legal command
The `bgp bestpath bandwidth` command should not be a legal
command.  Pull out the `no` form to allow this.  Allow
`no bgp bestpath bandwidth` to work as we would expect.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:46:58 -04:00
Donald Sharp
a92314dcbd bgpd: really remove the no ip as-path... command
We had already removed the `ip as-path..` command
to have `bgp as-path` but for some reason a `no ip as-path..`
command ALIAS was still around.  Kill with extreme prejudice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:45:03 -04:00
Donald Sharp
410a6bdcff tools: revert frr-reload.py remove stderr redirects"
This reverts commit 3fa139a65b.

This is being reverted because this commit completely
breaks the invocation of frr-reload.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-14 15:44:55 -04:00
Renato Westphal
82624cef0c
Merge pull request #6342 from Orange-OpenSource/dev_isis_sr
isisd: Preparation to merge Segment-Routing into master
2020-05-14 14:23:03 -03:00
Olivier Dugeon
d4d008fea1 isisd: Update documentation for Segment Routing
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
c0083e5338 isisd: Update Segment Routing Show Commands
* Improve `show isis segment-routing prefix-sids` output
 * Add new `show isis segment-routing node' command

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
f2333421ff isisd: IS-IS-SR preparation for master 5/5
Update comments (doxygen style) for all functions.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
c3f7b406b1 isisd: IS-IS-SR preparation for master 4/5
* Regroup fonctions to install label for Prefix and Adjacency SID
 * Change 'replace_semantics' variable name by 'make_before_break' in
   sr_prefix_reinstall() function and adjust comments
 * Call directly lsp_regenerate_schedule() from isis_nb_config.c when MSD
   is updated

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:43 +02:00
Olivier Dugeon
b407c77a4a isisd: IS-IS-SR preparation for master 3/5
Add debug macro and debug messages

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:36:38 +02:00
Olivier Dugeon
b1d80d434c isisd: IS-IS-SR preparation for master 2/5
* Rename functions following rules: isis_sr_XXX is kept for external functions
   and isis_sr prefix remove for static ones
 * Rename local_label & remote_label variables by input_label & output_label
 * Change parameter order (to follow other functions) in sr_node_srgb_update()

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:23:50 +02:00
Olivier Dugeon
cab10e86a4 isisd: IS-IS-SR preparation for master 1/5
* Rename RB-TREE variable from tree_sr_XXX to srdb_XXX
 * Replace parse_flags by an enum and rename it srdb_state which reflects
   more the role of this flag: determined the state of SR-Node and SR-Prefix
   stored in the SRDB: VALIDATED, NEW, MODIFIED, UNCHANGED

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-05-14 16:22:23 +02:00
Donatas Abraitis
cb390caaa7
Merge pull request #6393 from opensourcerouting/7.4/init-config-perms
[7.4] build: use configfile mode in init script
2020-05-14 12:46:38 +03:00
David Lamparter
1d4cdc165e build: use configfile mode in init script
This only applies for split-config;  the init script would create an
empty config file with default permissions.

Reported-by: Robert Scheck <robert@fedoraproject.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5c90637711)
2020-05-13 22:20:36 +02:00
Mark Stapp
faad472899
Merge pull request #6365 from donaldsharp/bsd_v6_Null_bs
zebra: Add code to install v6 blackhole routes on *bsd
2020-05-07 13:12:55 -04:00
Donald Sharp
381477e8a6 zebra: Add code to install v6 blackhole routes on *bsd
This code was just missing.  Take the few minutes and
get it done.

!
ip route 4.5.6.7/32 Null0
ipv6 route 4::5/128 Null0
!
$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.122.1      UGS      vtnet0
4.5.6.7/32         127.0.0.1          UG1B        lo0
127.0.0.1          link#2             UH          lo0
192.168.122.0/24   link#1             U        vtnet0
192.168.122.40     link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
4::5/128                          ::1                           UG1B        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::5054:ff:fe5a:e705%vtnet0    link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
$

$ uname -a
FreeBSD donna 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
$

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-07 11:24:05 -04:00
Donald Sharp
b4b1d1ebdb
Merge pull request #6356 from ton31337/fix/aggregator_0_ignore
bgpd: Ignore aggregator attribute if it's malformed (0.0.0.0)
2020-05-06 19:43:21 -04:00
Jafar Al-Gharaibeh
a9b763e381
Merge pull request #6358 from donaldsharp/zebra_onlink
zebra: Loosen ONLINK restrictions a tiny bit
2020-05-06 15:25:48 -05:00
Mark Stapp
03ab61c488
Merge pull request #6359 from sworleys/NHG-No-IPv4-IPv6
zebra: abstract 5549 check into a function
2020-05-06 15:42:52 -04:00
Renato Westphal
57ecb94d17
Merge pull request #6357 from mjstapp/fix_ldp_topo1_how
tests: remove unused ref files from ldp topotest
2020-05-06 12:23:36 -03:00
Renato Westphal
ee02198a38
Merge pull request #6352 from volta-networks/fix_ldp_dscp
ldpd: LDP does not always send traffic with correct DSCP value.
2020-05-06 12:23:01 -03:00
Donald Sharp
5cfaa2d92b zebra: Loosen ONLINK restrictions a tiny bit
Loosen the ONLINK restrictions such that when an upper
level protocol sends us a nexthop with an ONLINK attribute
just ensure that interface is up and usable.  ONLINK effectively
means we know what we are doing to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-06 10:15:41 -04:00
Karen Schoener
def23eb395 ldpd: LDP does not always send traffic with correct DSCP value.
Adding code so that the LDP neighbor that does not initiate the
TCP connection also sets the DSCP (via setsocketopt).

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-05-06 09:46:07 -04:00
Mark Stapp
fa6e939421 tests: remove unused ref files from ldp topotest
Remove a couple of a couple of mis-named reference output files
from the ldp-topo1 suite.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-05-06 09:31:21 -04:00
Donatas Abraitis
cbfc39df11 bgpd: Ignore aggregator attribute if it's malformed (0.0.0.0)
This is not the attribute involved in path selection and by rfc7606 it should
be just ignored.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-06 12:55:55 +03:00
Donatas Abraitis
6ded3e181b bgpd: Use slightly modified version of error message if AS path contains 0
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-05-06 12:55:13 +03:00