Commit Graph

13160 Commits

Author SHA1 Message Date
David Lamparter
552b74195d
Merge pull request #2940 from ton31337/fix/as-path_validation
bgpd: Validate as-path access-list before continuing regarding invali…
2018-08-31 15:56:44 +02:00
Donatas Abraitis
fbc7ead79c plist: Add safety check to avoid going over 4294967295 for prefix-list 2018-08-31 16:38:56 +03:00
Don Slice
985d248279 bgpd: change conditional operators for bgp/ospf json changes
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-31 12:50:02 +00:00
Donatas Abraitis
672c2d75e0 bgpd: Validate as-path access-list before continuing regarding invalid chars
Signed-off-by: Donatas Abraitis donatas.abraitis@gmail.com
2018-08-31 14:13:24 +03:00
Christoffer
cbb6b2a378
.github: Updated ISSUE_TEMPALTE.md
Addressed all of @qlyoung's "presentational nits
and a formatting suggestion". As well as
@rwestphal's idea of OS and FRR name+version
numbers.

Signed-off-by: Christoffer <netravnen@gmail.com>
2018-08-31 13:04:08 +02:00
Lou Berger
e93c6338f8
Merge pull request #2785 from donaldsharp/AGGanomics
Abstract `void *aggregate` pointer in `struct route_node`
2018-08-31 06:58:12 -04:00
David Lamparter
479e2eebed
Merge pull request #2951 from qlyoung/sort-route-maps
lib: sort route-maps for display
2018-08-31 12:17:20 +02:00
Donald Sharp
0e20f68b70 static: Put vty_frame around vrf output in staticd.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-31 11:29:27 +02:00
Donald Sharp
f591b309f2 staticd: Fix mixup in vrf translations
When we store the nexthop for ref-counting, keep
track of the nexthop vrf_id as well.  This will allow
us to track the nexthop per vrf!

Additionally when we get the callback from zebra about
a nexthop update, iterate over all static routes to
see if the nexthop we are getting a callback is
one we are concerned about.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-31 11:29:27 +02:00
Donald Sharp
88d52a3f22 vtysh: Let staticd know about vrf sub-mode
staticd was not transitioning into vrf sub-mode, this fixes it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-31 11:29:27 +02:00
David Lamparter
5c724747c1
Merge pull request #2923 from pguibert6WIND/fix_veth_namespace
zebra: when veth link is used across vrf, the link may not be good
2018-08-31 08:51:01 +02:00
Donald Sharp
c2b2356701 lib: Move aggregate pointer into aggregate route/table
Move the aggregate pointer from the route_node into agg_node
so that people using struct route_node will see a savings
in data size.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-30 17:47:59 -04:00
Donald Sharp
fe08ba7e11 bgpd, ripngd: Convert to using new agg_table/route
Switch bgp and ripngd to use the new aggregate table and
route data structures.  This was mainly a search and replace
operation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-30 17:47:59 -04:00
Donald Sharp
8e1f651213 lib: Add Aggregate Table and Aggregate_node
Add a abstraction for `struct route_node` and `struct route_table`
such that we can have an aggregate route_node and table.  This
is because only bgp/rfapi and ripng use the aggregate data pointer
in `struct route_node`.  For full route tables other routing
protocols and tables are paying a 8 byte overhead per node.
A full bgp table ends up being ~1.2 million routes in bgp
and zebra.  This is not an insiginificant amount of data.

So create the data structures for this replacement, but
do not replace the aggregate pointer yet.  This is because
later commits will convert rfapi and ripng over to this
new data, and finally we'll move the aggregate pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-30 17:47:59 -04:00
Quentin Young
78b1bb5ff3 lib: sort route-maps for display
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-30 21:22:22 +00:00
Donald Sharp
d0b6f68174 ospf6d: Remove deprecated code after 1 year
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-30 14:29:04 -04:00
Don Slice
874f58d87b ospfd: fix more warnings with the bgp ospf json commit
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 17:24:57 +00:00
Quentin Young
a91a5dcdd6
Merge pull request #2947 from mjstapp/fix_os_name
lib: fix use of frrpthread os_name
2018-08-30 13:01:22 -04:00
Martin Winter
17808c03d7 configure: Update version to 6.1-dev
We are now working on 6.1-dev for new work.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-30 09:11:10 -07:00
Don Slice
94d4c685c5 bgpd/ospfd: resolve warnings for bgp/ospf json commit
Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
2018-08-30 15:54:46 +00:00
Mark Stapp
c5e7bf3fa6 lib: fix use of frrpthread os_name
Fix test for presence of configured os pthread name.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-08-30 11:44:45 -04:00
David Lamparter
66a9aa8b88
Merge pull request #2859 from LabNConsulting/working/master/meminfo
lib: qmem show changes (header and max)
2018-08-30 16:44:47 +02:00
Thibaut Collet
379eb245f6 lib/if.c: fix CLANG warning
Fix CLANG warning:
Report for if.c | 2 issues
===============================================
< WARNING: else is not generally useful after a break or return
< #390: FILE: /tmp/f1-28557/if.c:390:

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
2018-08-30 16:29:06 +02:00
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
Thibaut Collet
ee2f2c23ca zebra: fix crash when interface vrf changes
This crash occurs only with netns implementation.
vrf meaning is different regarging its implementation (netns or
vrf-lite)

- With vrf-lite implementation vrf is a property of the interface that
  can be changed as the speed or the state (iproute2 command: "ip link
  set dev IF_NAME master VRF_NAME"). All interfaces of the system are in
  the same netns and so interface name is unique.
- With netns implementation vrf is a characteristic of the interface
  that CANNOT be changed: it is the id of the netns where the interface
  is located. To change the vrf of an interface (iproute2 command to
  move an interface "ip netns exec VRF_NAME1 ip link set dev IF_NAME
  netns VRF_NAME2") the interface is deleted from the old vrf and
  created in the new vrf.
  Interface name is not unique, the same name can be present in the
  different netns (typically the lo interface) and search of interface
  must be done by the tuple (interface name, netns id).

Current tests on the vrf implementation (vrf-lite or netns) are not
sufficient. In some cases (for example when an interface is moved from
a vrf X to the default vrf and then move back to VRF X) we can have a
corruption message and then a crash of zebra.

To avoid this corruption test on the vrf implementation, needed when an
interface changes, has been rewritten:
- For all interface changes except deletion the if_get_by_name function,
  that checks if an interface exists and creates or updates it if
  needed, is changed:
    * The vrf-lite implementation is unchanged: search of the interface
      is based only on the name and update the vrf-id if needed.
    * The netns implementation search of the interface is based on the
      (name, vrf-id) tuple and interface is created if not found, the
      vrf-id is never updated.
- deletion of an interface (reception of a RTM_DELLINK netlink message):
    * The vrf-lite implementation is unchanged: the interface
      information are cleared and the interface is moved to the default
      vrf if it does not belong to (to allow vrf deletion)
    * The netns implementation is changed: only the interface
      information are cleared and the interface stays in its vrf to
      avoid conflict with interface with the same name in the default
      vrf.

This implementation reverts (partially or totally):
commit 393ec5424e ("zebra: fix missing node attribute set in ifp")
commit e9e9b1150f ("lib: create interface even if name is the same")
commit 9373219c67 ("zebra: improve logs when replacing interface to an
other netns")
Fixes: b53686c52a ("zebra: delete interface that disappeared")

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-30 14:37:59 +02:00
Thibaut Collet
20c87e98d8 vrf: return vrf implementation for default vrf
To correct potential crash with netns implementation of vrf (see next
commit) it is necessary to allow any daemons to know the vrf
implementation whatever the vrf.
With current implementation the daemons do not know the vrf
implementation for the default vrf. For this vrf the returned vrf
implementation is always vrf-lite.
To solve this issue a netns name is set to the default vrf to just test
is presence to know the used implementation.

For zebra a netns name (if needed) is set in the vrf_init function just
before enabling the vrf. So this information is propagated to the other
daemons thanks the zapi message called when the vrf is enable at zebra
layer and override the default configuration (vrf-lite) of the daemon.

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
2018-08-30 14:37:55 +02:00
David Lamparter
2282d92812 doc: drop colspan/rowspan elements
The sphinx 'text' writer apparently doesn't support these, and the
'dummy' writer is only available on recent versions, and all of this
makes the build a bit annoying...

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
50dc6dbd69 doc: html default off
... RPM builds break if we enable this unconditionally; should really
change this in CI instead.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
b8dd5f9d9b build: add Makefile variable easy access
This adds 2 helper targets for use in scripts to easily get at Makefile
variables without parsing the Makefile or config.status.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
0fca9cee36 build: improve python search pattern
- try pythonN.N-config after pythonN-config
- use "python-config --ldflags" instead of --libs
- add Python 3.6 to explicitly searched versions
- if linking fails, try with "-lz" added

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
892d21b171 build: add warning when overwriting vars on "make"
doing things like `make CC="mmix-linux-musl-gcc"` breaks the hosttools/
cross-compilation setup pretty hard and just straight up should not be
done.  These vars belong on `configure`, not `make`.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
2a636b4350 build: cache a few more results in ./configure
Makes configure re-runs faster if the `-C` option is used.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
e0597bb2a5 build: -Werror does not belong in AM_CPPFLAGS
(probably neither do the ASAN/... FLAGS, but let's leave that alone.)

Also, it was intentional that it's $(WERROR) and not @WERROR@.  The
former can be overwritten at comandline as "make WERROR=" while the
latter can't.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
e386324530 build: non-recursive solaris
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
84c5337efd build: fix some oddities in solaris/
target_* is always wrong for FRR because we are not a compiler.  We only
use host_* and build_*.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
b716e79ac5 build: trigger fewer unneccessary clippy rebuilds
Make sure we include the clippy binary file in our timestamp mangling so
`make` will correctly determine when clippy files don't need to be
rebuilt.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
0d0812a4ad build: non-recursive debianpkg
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
9e53b31551 build: non-recursive doc + parallel sphinx
Sphinx actually does work with a parallel build, if the doctree creation
is a separate step (which the other builds will then just read
unmodified.)  This can be done with the "dummy" target.

This also adds "-j6" to sphinx-build and adds a "--disable-doc-html"
switch on ./configure to turn on/off building HTML docs separately.

Also, HTML docs are now installed by "make install" to
/usr/share/doc/frr/html.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-30 08:06:44 +02:00
David Lamparter
f177317a20
Merge pull request #2942 from mjstapp/fix_new_atomics
libs: fix missing atomics for some gcc versions
2018-08-30 08:04:29 +02:00
David Lamparter
53acd58416
Merge pull request #2754 from chiragshah6/mdev1
*: pthread set name abstraction
2018-08-30 08:00:25 +02:00
Chirag Shah
57019528a0 *: pthread set name abstraction
Testing Done:

 TOR#cat /proc/2670/task/2672/comm
 bgpd_ka

TOR# ps H -C bgpd -o 'pid tid cmd comm'
  PID   TID CMD                         COMMAND
  2670  2670 /usr/lib/frr/bgpd -M snmp - bgpd
  2670  2671 /usr/lib/frr/bgpd -M snmp - bgpd
  2670  2672 /usr/lib/frr/bgpd -M snmp - bgpd_ka

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-08-29 15:41:54 -07:00
Mark Stapp
1ed98c2db6 libs: fix missing atomics for some gcc versions
stdatomic.h does not have aliases for all of the useful gcc
atomic primitives; add them in for that path through
frratomic.h.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-08-29 15:39:19 -04:00
Christian Franke
2e7d2b93b6
Merge pull request #2938 from pguibert6WIND/spurious_message
lib: remove spurious message when netns is not available
2018-08-29 19:21:59 +02:00
Quentin Young
4ebfd799c0
Merge pull request #2917 from opensourcerouting/doc-devel-openwrt
doc/developer/openwrt: Update instructions for building for OpenWRT
2018-08-29 11:39:07 -04:00
Lou Berger
752a286dfa rfp_example: add 'rfp full-table-download' config to support topotest
Signed-off-by: Lou Berger <lberger@labn.net>
2018-08-29 11:08:10 -04:00
Lou Berger
3a022a7f18 rfapi: debug related changes to support topotest -- add cost
Signed-off-by: Lou Berger <lberger@labn.net>
2018-08-29 09:20:24 -04:00
Philippe Guibert
0e4864eaf0 zebra: do not update link if interface is veth interface
when interface is a virtual ethernet interface, then there is no need to
update link pointer of interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-29 11:34:08 +02:00
Christoffer
272fd0c3cd
.github: Add ISSUE_TEMPLATE.md
Content of file ISSUE_TEMPLATE.md lossly based upon
e38fcc3c00/.github/ISSUE_TEMPLATE.md

Signed-off-by: Christoffer <netravnen@gmail.com>
2018-08-29 11:19:20 +02:00
Christoffer
52686b3ba6
.github: Updated PULL_REQUEST_TEMPLATE.md per Quentin's request.
Signed-off-by: Christoffer <netravnen@gmail.com>
2018-08-29 11:13:16 +02:00
Lou Berger
7e678379ed doc: add comment on closing PRs
Signed-off-by: Lou Berger <lberger@labn.net>
2018-08-29 09:48:12 +02:00