Commit Graph

11864 Commits

Author SHA1 Message Date
Chirag Shah
99b4e972b5 bgpd: fix default RD value in running-cfg
When bgp vrf is configured with non-default
RD value, config flag is set.
Upon removing non-default RD value the flag was not reset,
thus displayed default RD value in running-config.

router bgp 5550 vrf vrf1
 rd 45.0.2.2:5

Unset the RD configuration flag under bgp_vrf instance.

Ticket:CM-20206

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 22:19:08 -07:00
Chirag Shah
62710e2b33 zebra: Hide default vrf instance of l3vni cmd
Hide following l3vni config from DEFAULT_VRF instance
until it is fully supported.

TORS1(config)# vni 2222456 prefix-routes-only

Ticket:CM-20572

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 15:42:20 -07:00
Quentin Young
b682099337 doc: update workflow.rst
* Rewrap lines to 80 characters
* Update some portions to reflect current practices
* Clean up some formatting (indent, markup, etc)
* Reorganize sections on patch submission
* Remove link to nonexistent github wiki page

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-15 18:38:38 +00:00
Quentin Young
7cc0626c42 lib: ignore user CFLAGS when building Clippy
Unfortunately user CFLAGS causes #define conflicts with #defines in
Python development headers, which causes build failures under certain
platforms when using -Werror.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-15 18:35:53 +00:00
paco
4f9a63adba
bgpd: null check (Coverity 1399274)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 20:09:55 +02:00
paco
cc35bc7c8f
bgpd: null check (Clang scan-build)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 20:02:23 +02:00
Quentin Young
972c2ee9de tests: fixup minor autotools nit
Makes super strict builds fail due to a warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-15 17:17:42 +00:00
paco
2c2d5cb397
lib: uninitialized variable (Coverity 1469898)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 19:13:58 +02:00
Quentin Young
65c4ceac44
Merge pull request #2447 from ajones-rvbd/ajones-issue-2391
alpine: add unit tests to build
2018-06-15 12:40:19 -04:00
paco
c28135f38e
isisd: out-of-bounds access (Coverity 1399309)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 18:36:20 +02:00
Quentin Young
97b1dd19a1
Merge pull request #2409 from LabNConsulting/working/master/vtysh-2400
vtysh: -u fixes
2018-06-15 12:33:44 -04:00
Donald Sharp
6389e663e9
Merge pull request #2458 from pacovn/Coverity_1221437_Unchecked_return_value
ospf6d: unchecked return value (Coverity 1221437)
2018-06-15 10:53:58 -04:00
paco
18e994a043
pimd: Untrusted val as argument (Coverity 1465491)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 14:46:25 +02:00
paco
246879c303
ospf6d: unchecked return value (Coverity 1221437)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 13:08:37 +02:00
paco
5beb290a7b
bgpd: out-of-bounds access (Coverity 1399306)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 12:39:10 +02:00
paco
1d1c0de9f0
bgpd: dead code (Coverity 1399373)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-15 11:55:13 +02:00
Pascal Mathis
1f2263be24
bgpd: Fix crash when showing filtered routes
This commit fixes the issue mentioned in #2419, which is caused by a
double-free. The problem of the current implementation is that
*bgp_input_modifier* already frees the passed attributes under specific
circumstances, which can then lead to a double-free as *bgp_attr_undup*
does not check if the attributes are set to NULL.

As it is not transparent to the function caller if the attributes get
freed or not and the similar function *bgp_output_modifier* also does
not flush the passed attributes, the line has been removed altogether.

All callers of *bgp_input_modifier* already deal by themself with
freeing/flushing/unduping BGP attributes, so it is safe to remove.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-15 00:08:46 +02:00
Rafael Zalamena
e4a374681d
Merge pull request #2426 from pacovn/Coverity_23089_Buffer_not_null_terminated
ospfd: buffer termination (Coverity 23089)
2018-06-14 18:02:34 -03:00
Rafael Zalamena
67f23e08c3
Merge pull request #2438 from pacovn/Coverity_1457300_Dereference_after_null_check
ospfd: null check (Coverity 1457300)
2018-06-14 17:58:10 -03:00
Arthur Jones
95bd0d7e05 alpine: add unit tests to build
Now that make check works on alpine, add it to the build

Testing done: alpine linux build -- check works

Issue: https://github.com/FRRouting/frr/issues/2391

Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-06-14 10:27:24 -07:00
paco
9ffaacb0f7
ospfd: OoB access (Cov 1452454 1452455 1452456)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-14 19:19:44 +02:00
Donald Sharp
259952c503
Merge pull request #2422 from pacovn/Coverity_23201_Dereference_before_null_check
bgpd: null check (Coverity 23201)
2018-06-14 13:03:50 -04:00
Pascal Mathis
4c3911425c
bgpd: Finalize group-overrides for peer/AF attrs
This commit finalizes the previous commits which introduced a generic
approach for making all BGP peer and address-family attributes
overrideable by keeping track of the configuration origin in separate
internal structures.

First of all, the test suite was greatly extended to also check the
internal data structures of peer/AF attributes, so that inheritance for
internal values like 'peer->weight' is also being checked in all cases.

This revealed some smaller issues in the implementation, which were also
fixed in this commit. The test suite now fully passes and covers all the
usual situations that should normally occur.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:33 +02:00
Pascal Mathis
a14810f43f
bgpd: Implement group-overrides for peer attrs
This commit introduces BGP peer-group overrides for the last set of
peer-level attrs which did not offer that feature yet. The following
attributes have been implemented: description, local-as, password and
update-source.

Each attribute, with the exception of description because it does not
offer any inheritance between peer-groups and peers, is now also setting
a peer-flag instead of just modifying the internal data structures. This
made it possible to also re-use the same implementation for attribute
overrides as already done for peer flags, AF flags and AF attrs.

The `no neighbor <neigh> description` command has been slightly changed
to support negation for no parameters, one parameter or * parameters
(LINE...). This was needed for the test suite to pass and is a small
change without any bigger impact on the CLI.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:32 +02:00
Pascal Mathis
b90a8e13ee
bgpd: Implement group-overrides for peer timers
This commit implements BGP peer-group overrides for the timer flags,
which control the value of the hold, keepalive, advertisement-interval
and connect connect timers. It was kept separated on purpose as the
whole timer implementation is quite complex and merging this commit
together with with the other flag implementations did not seem right.

Basically three new peer flags were introduced, namely
*PEER_FLAG_ROUTEADV*, *PEER_FLAG_TIMER* and *PEER_FLAG_TIMER_CONNECT*.
The overrides work exactly the same way as they did before, but
introducing these flags made a few conditionals simpler as they no
longer had to compare internal data structures against eachother.

Last but not least, the test suite has been adjusted accordingly to test
the newly implemented flag overrides.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:30 +02:00
Pascal Mathis
598a3d4288
bgpd: Improve test suite for peer-group overrides
This commit introduces the current test suite for BGP peer-group
overrides by adding support for custom check handlers (which can check
internal data structures more thoroughly) and by fixing several small
mistakes and issues that slipped through. Also some parts of the code
have been cleaned up to avoid duplicate and/or hard-to-read code.

Additionally a first experimental check for a BGP peer attribute with
values (advertisement-interval <value>) has been added to the test
suite. As this test suite is currently not passing, it has not been
added to the python test caller.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:28 +02:00
Pascal Mathis
527de3dca2
bgpd: Cleanup peer/AF-flag override implementation
This commit cleans up some ugly leftovers from previous flag-override
implementation and refactors the AF-flag override implementation to
match the same behavior the newly added peer-flag override
implementation has.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:27 +02:00
Pascal Mathis
e7103a9644
bgpd: Fix AF-attribute overrides when binding peer
The current implementation of the overrides for peer address-family
attributes suffered a bug, which caused all peer-specific attributes to
be lost when the peer was added to a peer-group which already had that
specific address-family active.

This commit extends the *peer_group2peer_config_copy_af* function to
respect overridden flags properly. Additionally, the arguments of the
macros *PEER_ATTR_INHERIT* and *PEER_STR_ATTR_INHERIT* have been
reordered to be more consistent and easy to read.

This commit also adds further test cases to the BGP peer attributes test
suite, so that this kind of error is being caught in future commits. The
missing AF-attribute *distribute-list* has also been added to the test
suite.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:25 +02:00
Pascal Mathis
9fb964de21
bgpd: Implement group-overrides for peer flags
The current implementation of peer flags (e.g. shutdown, passive, ...)
only has partial support for overriding flags of a peer-group when the
peer is a member. Often settings might get lost if the user toys around
with the peer-group configuration, which can lead to disaster.

This commit introduces the same override implementation which was
previously integrated to support proper peer flag/attribute override on
the address-family level. The code is very similar and the global
attributes now use their separate state-arrays *flags_invert* and
*flags_override*.

The test suite for BGP peer attributes was extended to also check peer
global attributes, so that the newly introduced changes are covered. An
additional feature was added which allows to test an attribute with an
*interface-peer*, which can be configured by running `neighbor IF-TEST
interface`. This was introduced so that the dynamic runtime inversion of
the `extended-nexthop` flag, which is only enabled by default for
interface peers, can also be tested.

Last but not least, two small changes have been made to the current bgpd
implementation:

- The command `strict-capability-match` can now also be set on a
peer-group, it seems like this command slipped through while
implementing peer-groups in the very past.

- The macro `COND_FLAG` was introduced inside lib/zebra.h, which now
allows to either set or unset a flag based on a condition. The syntax
for using this macro is: `COND_FLAG(flag_variable, flag, condition)`

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-06-14 18:55:18 +02:00
Renato Westphal
0d0ca0bb34
Merge pull request #2435 from pacovn/Coverity_1464993_Buffer_not_null_terminated
ospfd: buffer termination (Coverity 1464993)
2018-06-14 13:44:10 -03:00
paco
1f9d4e3d49
ospfd: buffer termination (Coverity 23089)
Details:
- INET_ADDRSTRLEN is 16, for xxx.xxx.xxx\0, so 15 is now passed
 to the strncpy call instead of 16, ensuring ASCII-z output

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-14 17:43:19 +02:00
paco
a247298087
bgpd: null check (Coverity 23201)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-14 17:18:08 +02:00
paco
e4407ea6d0
ospfd: buffer termination (Coverity 1464993)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-14 16:59:31 +02:00
Rafael Zalamena
c0519af39f
Merge pull request #2430 from pacovn/clang_scan_ospf_dereference
ospfd: dereference check (Clang scan-build)
2018-06-14 11:14:52 -03:00
Rafael Zalamena
fbd3d404ae
Merge pull request #2434 from pacovn/Coverity_1457145_Out-of-bounds_access
lib: out-of-bounds access (Coverity 1457145)
2018-06-14 11:09:05 -03:00
Donald Sharp
dd52a18493
Merge pull request #2436 from pacovn/Coverity_1143220_Argument_cannot_be_negative
tools: return check (Coverity 1143220)
2018-06-14 10:02:25 -04:00
Rafael Zalamena
d17840aa8a
Merge pull request #2437 from pacovn/Coverity_1436343_Dereference_after_null_check
lib: null check (Coverity 1436343)
2018-06-14 11:00:57 -03:00
Renato Westphal
ff9f7454d1
Merge pull request #2428 from donaldsharp/zserv_debug
zebra: Cleanup code to test for failure once
2018-06-14 10:43:40 -03:00
Rafael Zalamena
ff456781b7
Merge pull request #2410 from pacovn/Coverity_1448806_Out-of-bounds_access
lib: Out-of-bounds access (Coverity 1448806, 1448810)
2018-06-14 10:29:35 -03:00
Lou Berger
447c4754a1
Merge pull request #2439 from chiragshah6/evpn_dev
bgpd: Fix bgpd crash in evpn vni route-map apply
2018-06-14 09:21:14 -04:00
Donald Sharp
24614afe1e
Merge pull request #2441 from MasterofJOKers/workflow_pr_info_url
doc: Correct wiki URL in workflow-documentation
2018-06-14 06:27:15 -04:00
MasterofJOKers
3f4f5b0437 doc: Correct wiki URL in workflow-documentation
The organization on github is called "FRRouting".

Signed-off-by: MasterofJOKers <joker@someserver.de>
2018-06-14 09:33:32 +02:00
Quentin Young
a4044dc10d pbrd: add logging messages when out of table id's
* Add log messages to indicate when we have run out of table IDs
* Increase minimum range size to 1000 to reduce risk of hitting this

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-13 20:00:58 +00:00
paco
4ac99370b0
lib: null check (Coverity 1436343)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 19:53:09 +02:00
Renato Westphal
293c8113bf
Merge pull request #2431 from pacovn/Coverity_1399290_Out-of-bounds_access
tools: out-of-bounds access (Coverity 1399290)
2018-06-13 14:49:52 -03:00
Donald Sharp
11b3759359
Merge pull request #2416 from pacovn/Coverity_1399389_Structurally_dead_code
bgpd: dead code (Coverity 1399389)
2018-06-13 13:38:03 -04:00
Chirag Shah
80ced71057 bgpd: Fix bgpd crash in evpn vni route-map
When evpn configured wiht route-map with vni which is not
configured. Upon receiving evpn routes (i.e Type-2, Type-3),
route-map match will be triggered. Since there is no l2vni
exists in db, some of the member fields in bgp_info (i.e.
dummy_info_extra) are passed uninitialized to evpn filter match cb.
This results in inaccessible memory causes crash.

Fix is to memset the bgp_info prior to passing to evpn filter cb.
In evpn vni filter cb, ensure to have NULL check for member filed
of the bgp_info.

memset bgp_info at few places where it is passed to route_match.

Ticket:CM-21335
Reviewed By:
Testing Done:

Configure route-map with not configured l2vni
Simulate to learn l2vpn type-2, 3 route

Restart frr.service with below config
address-family l2vpn evpn
  neighbor fear route-map EVPN_VNI out

route-map EVPN_VNI deny 10
 match evpn vni 140010

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-13 10:14:24 -07:00
paco
e89ffeee92
ospfd: null check (Coverity 1457300)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 19:04:43 +02:00
Quentin Young
56c6f60c6b lib: fix missing includes in pbr.h
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-13 16:23:46 +00:00
Quentin Young
8c28c034dc pbrd, lib: move PBR_STR def. to lib
Per request

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-13 16:22:01 +00:00