Commit Graph

18714 Commits

Author SHA1 Message Date
Emanuele Di Pascale
26eb18e259 isisd, yang: set default is-type to level-1-2
Currently isisd has this strange (legacy) behavior where the
first area is created by default with level-1-2, while every
other subsequent area uses the default defined in the yang model,
which is level-1. This is a source of confusion when trying to
configure the daemon programatically, either with frr-reload
or using the transactional cli. Given how rare having multiple
IS-IS instances is anyway, the easiest solution is to remove
this behavior and default to level-1-2 for every area.

Note that this does not affect fabricd, which continues using
exclusively level-2-only areas.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-12-17 16:54:47 +01:00
Quentin Young
6498fc458d
Merge pull request #5508 from ton31337/feature/show_ip_route_summary_json
zebra: Print json output for show_route_summary_cmd
2019-12-17 10:05:13 -05:00
Mark Stapp
7183a034d1 vtysh: add an alias for the nexthop-group config targets
Use an alias for the daemons who process the nexthop-group
config cli; makes it easier to expand that list in the future.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-17 09:56:26 -05:00
Russ White
a91d3df894
Merge pull request #5541 from sworleys/NHG-Fixes
zebra: a couple nhg fixes
2019-12-17 08:30:37 -05:00
Russ White
0aabd8c61d
Merge pull request #5540 from sworleys/NH-Defualt-Weight-One
lib: default nexthop weights to one
2019-12-17 08:29:46 -05:00
Donatas Abraitis
f4ec52f7cc bgpd: Print pretty json output for bgp_show_table()
This is not very cool:

```
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 4,
 "routerId": "192.168.0.1",
 "defaultLocPrf": 100,
 "localAS": 200,
 "routes": { "10.0.0.150/32": [{"valid":true,"bestpath":true,"pathFrom":"external","prefix":"10.0.0.150","prefixLen":32,"network":"10.0.0.150\/32","med":0,"metric":0,"weight":32768,"peerId":"(unspec)","aspath":"200 200 200","path":"200 200 200","origin":"incomplete","nexthops":[{"ip":"0.0.0.0","afi":"ipv4","used":true}]}],"10.0.0.200/32": [{"valid":true,"bestpath":true,"pathFrom":"external","prefix":"10.0.0.200","prefixLen":32,"network":"10.0.0.200\/32","med":0,"metric":0,"weight":32768,"peerId":"(unspec)","aspath":"200 200 200","path":"200 200 200","origin":"incomplete","nexthops":[{"ip":"0.0.0.0","afi":"ipv4","used":true}]}],"10.0.2.0/24": [{"valid":true,"bestpath":true,"pathFrom":"external","prefix":"10.0.2.0","prefixLen":24,"network":"10.0.2.0\/24","med":0,"metric":0,"weight":32768,"peerId":"(unspec)","aspath":"200 200 200","path":"200 200 200","origin":"incomplete","nexthops":[{"ip":"0.0.0.0","afi":"ipv4","used":true}]}],"192.168.0.0/24": [{"valid":true,"bestpath":true,"pathFrom":"external","prefix":"192.168.0.0","prefixLen":24,"network":"192.168.0.0\/24","med":0,"metric":0,"weight":32768,"peerId":"(unspec)","aspath":"200 200 200","path":"200 200 200","origin":"incomplete","nexthops":[{"ip":"0.0.0.0","afi":"ipv4","used":true}]}] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-17 12:49:30 +02:00
Donatas Abraitis
157a43d572 bgpd: Adjust warning message for bgp_show_regexp()
Before it was:
```
exit1-debian-9# show ip bgp regexp ^200a
Invalid character in as-path access-list ^200a
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-17 12:39:40 +02:00
Donatas Abraitis
3e5b31b37d bgpd: Print json output for show_ip_bgp_regexp_cmd
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-17 12:37:08 +02:00
Stephen Worley
b10d6b0744 zebra: pass type when finding individual nexthop
When we are doing a lookup on an individual nexthop,
we should still be passing along the type that gets passed
via the arguments. Otherwise, we will always think we own that
NHE when in reality anyone could have put that into the
kernel.

Before this patch, nexthops in the kernel will get swepped
out even if we didn't create them.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-16 16:46:30 -05:00
Stephen Worley
84a89a8d2e zebra: null check re->nhe not re->nhe->nhg on attach
We should be NULL checking the entire re->nhe struct, not
the group inside of it. When we get routes from the kernel
using a nexthop group (and future protocols) they will only
pass us an ID to use. Hence, this struct can (and will be)
NULL on first attach when only passed an ID.

There shouldn't be a situation where we have an re->nhe
and don't have an re->nhe->nhg anyway.

Before this patch you can easily make zebra crash by creating a
route in the kernel using a nexthop group and starting zebra.

`ip next add dev lo id 111`
`ip route add 1.1.1.1/32 nhid 111`

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-16 16:37:14 -05:00
Stephen Worley
e28492ae84 lib: default nexthop weights to one
Default all nexthop weights to one. The linux kernel does
some weird stuff where it adds one to all nexthop weight values
it gets. So, we added df7fb5800b with
some special subtracing/adding to account for this. Though, that patch
did not account for the default case of the weight being zero for
elements in the group.

Hence, this patch defaults the nexthop weight to one during creation.
This should be a valid value on all platforms anyway so shouldn't
affect anything.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-16 15:42:37 -05:00
Sri Mohana Singamsetty
8887295390
Merge pull request #5502 from ton31337/fix/rr_do_not_show_fqdn
bgpd: Show `ip` and `fqdn` in json output for `show [ip] bgp json`
2019-12-16 09:43:01 -08:00
Sri Mohana Singamsetty
b332774896
Merge pull request #5379 from pogojotz/fix-bgp-neighbors-prefix-count-segfault
bgpd: Special handling for 2-level routing tables
2019-12-16 09:41:35 -08:00
Donald Sharp
4e29b89aba
Merge pull request #5427 from liam-mcb/igmp-join-any
pimd: Add command to join any-source multicast.
2019-12-16 07:47:41 -05:00
David Lamparter
d45fdd5364
Merge pull request #5523 from donaldsharp/mlag_single_compile
mlag compile issue fixups
2019-12-16 13:45:36 +01:00
Donald Sharp
04dd9e420e
Merge pull request #5535 from opensourcerouting/santa-elf
*: cleanup elves were here
2019-12-16 07:42:47 -05:00
Donald Sharp
fd193241e9 zebra: Do not build mlag protobuf support if version 3 is not avail
Older versions of protobuf-c do not support version 3 of the
protocol.  Add a check into the system to see if we have
version 3 available and if so, compile it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-15 09:37:51 -05:00
Donald Sharp
14d9bbbe5c zebra: Allow zebra_mlag to compile with no j factor
If you compile FRR with no j factor zebra_mlag.c fails to
build because the vtysh extraction methodology runs first
before the protobuf compiler runs and that compilation does
not have the proper dependancy chain built for the inclusions
that zebra_mlag.c had.  Moving the DEF* code into a zebra_mlag_vty.c
which can be included in the vtysh extraction code and has
no mlag.proto dependancies makes the compilation work better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-15 09:36:23 -05:00
David Lamparter
ba7eb55ec6 tools: symalyzer
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14 12:41:19 +01:00
David Lamparter
45e69fa8f7 lib/linklist: flip the bitrot compost
The whole lib/linklist.c code shouldn't really be used for new code (the
lib/typesafe.h bits are better.)  So, a new need for these unused
functions shouldn't be coming up.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14 12:41:19 +01:00
David Lamparter
eb51bb9b1f lib: random unused bits cleanup
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14 12:41:19 +01:00
David Lamparter
25d8623340 lib/prefix: flip the bitrot compost
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14 12:28:18 +01:00
Donald Sharp
f4d7bc0820
Merge pull request #5452 from mjstapp/fix_notify_nhg
zebra: align dplane notify processing with nhg work
2019-12-13 14:11:34 -05:00
David Lamparter
1b3e9a21dd lib: make some variables static
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13 06:22:34 +01:00
David Lamparter
33de8d1dd0 lib: completely get rid of the MTYPE alias hack
Sometimes the easiest solution is hardest to find... the whole point of
all this "static const", aliasing, & co. was to make "MTYPE_FOO" usable
without adding the extra & as in "&MTYPE_FOO".  Making it a size-1 array
does that perfectly through the magic of ISO C array decay...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13 06:22:34 +01:00
David Lamparter
9fe602a17c lib: make rcu_free() NULL-safe
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-12-13 06:22:34 +01:00
David Lamparter
420dcec358 bgpd: remove redundant VNC build specs
rfapi_descriptor_rfp_utils.c is already built into libbgp.a and these
include paths have no effect at all.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-13 06:22:34 +01:00
Jafar Al-Gharaibeh
a10dbc9f7f
Merge pull request #5532 from donaldsharp/leaks
Leaks
2019-12-12 22:47:45 -06:00
Donald Sharp
ebeae7d58d isisd: Free memory when confused
When you call into lsp_update with confusion, the lsp is purged
and we do not do anything with the created tlv's from parsing
the incoming data.  To prevent the tlv's from being leaked
note confusion and delete the unneeded data.

Fixes: #5496
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-12 19:33:42 -05:00
Donald Sharp
0783b36d0e ripd, ripngd: Free up list after call into nb_cli_rpc
We have a clear memory leak after running `clear ip rip`
Fix this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-12 18:48:04 -05:00
Jafar Al-Gharaibeh
297def9386
Merge pull request #5531 from qlyoung/fix-ospf-ip-hl-trust
Fix ospf ip hl trust
2019-12-12 13:19:36 -06:00
Mark Stapp
1f6a5aca26 zebra: handle route notification with no nexthops
Handle the special case where a route update contains
no installed nexthops - that means the route is not
installed.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-12 12:55:51 -05:00
Donatas Abraitis
e7deb7e791 zebra: Print json output for show_route_summary_cmd
```
spine1-debian-9# sh ip route summary json
{
  "routes":[
    {
      "fib":1,
      "rib":1,
      "type":"kernel"
    },
    {
      "fib":11,
      "rib":11,
      "type":"connected"
    },
    {
      "fib":2,
      "rib":2,
      "type":"ebgp"
    },
    {
      "fib":1,
      "rib":1,
      "type":"ibgp"
    }
  ],
  "routesTotal":15,
  "routesTotalFib":15
}
spine1-debian-9# sh ipv6 route summary json
{
  "routes":[
    {
      "fib":7,
      "rib":7,
      "type":"connected"
    }
  ],
  "routesTotal":7,
  "routesTotalFib":7
}
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-12 17:20:11 +02:00
Liam McBirnie
771ce8ad24 pimd: Add command to join any-source multicast.
Allow 'ip igmp join' to join group for any source if no source is
specified.
Disallow joining source "0.0.0.0" as it is used to define an
any-source multicast group.

Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>
2019-12-12 13:09:46 +01:00
Donatas Abraitis
6d9a2ec9b4 tests: Test if ip and fqdn are included in show [ip] bgp json
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-12 10:35:54 +02:00
Donatas Abraitis
515c260288 bgpd: Show ip and fqdn in json output for show [ip] bgp <route> json
This should keep backward compatibility when bgp show-hostname is
enabled/disabled.

Also show the real originator IP instead of showing fqdn of the route
reflector.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-12 10:35:29 +02:00
Quentin Young
e947b307fc ospfd: tiny style fix
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-12 01:03:18 -05:00
Quentin Young
5405a012b4 ospfd: sizeof(pointer) -> sizeof(pointed-at)
14 years old eh?

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-12 01:03:18 -05:00
Quentin Young
01e3c3764d ospfd: fix misplaced trust in ip header length
We actually don't validate the IHL field, although it certainly looks
like we do at a casual glance.

This patch saves us from an assert in case we actually do get an IP
packet with an incorrect header length field.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-12 01:03:13 -05:00
Donald Sharp
2003a265bb
Merge pull request #5528 from opensourcerouting/bmp-dns-fixing
BMP: improve active outbound connection details
2019-12-11 13:22:34 -05:00
David Lamparter
7f2c2596e3
bgpd: Allow failed hostname lookup to continue in bmp (#5399)
bgpd: Allow failed hostname lookup to continue in bmp
2019-12-11 19:21:18 +01:00
Donald Sharp
37f4c2fb02
Merge pull request #5494 from opensourcerouting/mlag-module
zebra: create zebra_cumulus_mlag module
2019-12-11 13:14:02 -05:00
Mark Stapp
4c0b5436f9 zebra: accept async notification for un-install
Handle an async notification when a route-update operation
uninstalls one route in favor of another.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-11 11:22:53 -05:00
Mark Stapp
c81c2303e6
Merge pull request #5497 from donaldsharp/unequality_ecmp
Unequality ecmp
2019-12-11 11:02:15 -05:00
Mark Stapp
9880c0f3ae
Merge pull request #5527 from opensourcerouting/skiplist-uninit-warning
lib/skiplist: fix gcc-9 used-uninitialized warning
2019-12-11 09:03:08 -05:00
David Lamparter
150470da79 bgpd/bmp: print active outbound connections
... including timer & details about current state and last failure.

Fixes: #5401
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 13:36:24 +01:00
David Lamparter
3286ca0750 lib,nhrpd,bgpd/bmp: pass resolver failure details
To keep the calling code agnostic of the DNS resolver libary used, pass
a strerror-style string instead of a status code that would need extra
handling.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 13:33:36 +01:00
David Lamparter
9e89da8c55 bgpd/bmp: actually print uptime
Forgot to replace the stub here when finishing up...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 12:34:56 +01:00
David Lamparter
125dc9525b lib/resolver: support/bypass IP literals
libc-ares doesn't do IP literals, so we have to do that before running
off to do DNS.  Since this isn't BMP specific, move to lib/ so NHRP can
benefit too.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 12:27:05 +01:00
David Lamparter
6ce59f0bfe lib/skiplist: fix gcc-9 used-uninitialized warning
Under some circumstances (apparently depends on several optimization
flags), gcc-9 throws an used-uninitialized warning for this variable in
the skiplist code.  Just initialize to NULL.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 11:44:52 +01:00