]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoMerge pull request #2609 from pacovn/clang_scan_nhrpd_vici_initialization
Donald Sharp [Mon, 2 Jul 2018 22:49:49 +0000 (18:49 -0400)]
Merge pull request #2609 from pacovn/clang_scan_nhrpd_vici_initialization

nhrpd: uninitialized variable (Clang scan)

5 years agoMerge pull request #2604 from pacovn/PVS-Studio_odd_operator_usage
Quentin Young [Mon, 2 Jul 2018 18:18:26 +0000 (14:18 -0400)]
Merge pull request #2604 from pacovn/PVS-Studio_odd_operator_usage

nhrpd: odd operator usage fix (PVS-Studio)

5 years agoMerge pull request #2603 from pacovn/PVS-Studio_format_warnings
Quentin Young [Mon, 2 Jul 2018 18:15:43 +0000 (14:15 -0400)]
Merge pull request #2603 from pacovn/PVS-Studio_format_warnings

eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)

5 years agonhrpd: uninitialized variable (Clang scan)
F. Aragon [Mon, 2 Jul 2018 18:07:59 +0000 (20:07 +0200)]
nhrpd: uninitialized variable (Clang scan)

Fix over 0a939f4f24fa34fea688482fbf57fb16eaf2a081 (there was a case not
covered by previous fix)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2601 from pacovn/PVS-Studio_scope_overlap
Donald Sharp [Mon, 2 Jul 2018 16:44:10 +0000 (12:44 -0400)]
Merge pull request #2601 from pacovn/PVS-Studio_scope_overlap

ripngd: variable scope overlap fix (PVS-Studio)

5 years agoMerge pull request #2600 from pacovn/PVS-Studio_sizeof_and_dead_code
Quentin Young [Mon, 2 Jul 2018 16:41:34 +0000 (12:41 -0400)]
Merge pull request #2600 from pacovn/PVS-Studio_sizeof_and_dead_code

eigrpd: sizeof() usage + dead code (PVS-Studio)

5 years agoeigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
F. Aragon [Mon, 2 Jul 2018 15:32:05 +0000 (17:32 +0200)]
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2533 from pguibert6WIND/doc_flowspec
Quentin Young [Mon, 2 Jul 2018 15:42:22 +0000 (11:42 -0400)]
Merge pull request #2533 from pguibert6WIND/doc_flowspec

doc: add flowspec information from user point of view

5 years agonhrpd: odd operator usage fix (PVS-Studio)
F. Aragon [Mon, 2 Jul 2018 15:37:23 +0000 (17:37 +0200)]
nhrpd: odd operator usage fix (PVS-Studio)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoripngd: variable scope overlap fix (PVS-Studio)
F. Aragon [Mon, 2 Jul 2018 14:53:16 +0000 (16:53 +0200)]
ripngd: variable scope overlap fix (PVS-Studio)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoeigrpd: sizeof() usage + dead code (PVS-Studio)
F. Aragon [Mon, 2 Jul 2018 14:44:46 +0000 (16:44 +0200)]
eigrpd: sizeof() usage + dead code (PVS-Studio)

Two issues:

1) Removed an unnecesary null check of 'ei'
2) Fixed the usage of sizeof(), as it was used the size of a pointer instead
   of the size of the structure

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agodoc: fix missing bgp keyword in debug bgp command
Philippe Guibert [Thu, 28 Jun 2018 06:41:35 +0000 (08:41 +0200)]
doc: fix missing bgp keyword in debug bgp command

Some debug bgp commands were missing bgp keyword.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agodoc: add flowspec information from user point of view
Philippe Guibert [Fri, 22 Jun 2018 15:37:29 +0000 (17:37 +0200)]
doc: add flowspec information from user point of view

Add some information for BGP flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agoMerge pull request #2475 from LabNConsulting/working/master/no_vrf_socket_4l3mdev
Russ White [Mon, 2 Jul 2018 03:06:22 +0000 (23:06 -0400)]
Merge pull request #2475 from LabNConsulting/working/master/no_vrf_socket_4l3mdev

Don't open per vrf sockets when net.ipv4.tcp|udp_l3mdev_accept != 0

5 years agoMerge pull request #2593 from rtrlib/2018-07-01-master-bugfix
Donald Sharp [Sun, 1 Jul 2018 23:40:57 +0000 (19:40 -0400)]
Merge pull request #2593 from rtrlib/2018-07-01-master-bugfix

bgpd: fix rpki segfault

5 years agobgpd: fix rpki segfault
Marcel Röthke [Sun, 1 Jul 2018 20:54:51 +0000 (22:54 +0200)]
bgpd: fix rpki segfault

If a cache server was added after rpki was started it's tr_socket would
not be initialized. This would lead to a segfault if the rtr manager
ever decides to switch to that socket or if rpki support is stopped.

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agoMerge pull request #2592 from tigranmartirosyan/master
Donald Sharp [Sat, 30 Jun 2018 13:26:22 +0000 (09:26 -0400)]
Merge pull request #2592 from tigranmartirosyan/master

fixed #2567: Json status of BGP peer is not updated properly

5 years agofixed #2567: Json status of BGP peer is not updated properly
Tigran Martirosyan [Sat, 30 Jun 2018 12:27:25 +0000 (16:27 +0400)]
fixed #2567: Json status of BGP peer is not updated properly

5 years agoMerge pull request #2574 from pacovn/Coverity_1399202_Copy-paste_error
Russ White [Fri, 29 Jun 2018 22:35:12 +0000 (18:35 -0400)]
Merge pull request #2574 from pacovn/Coverity_1399202_Copy-paste_error

bgpd: copy-paste error (Coverity 1399202)

5 years agoMerge pull request #2582 from donaldsharp/work_smarter_not_slower
Russ White [Fri, 29 Jun 2018 22:18:34 +0000 (18:18 -0400)]
Merge pull request #2582 from donaldsharp/work_smarter_not_slower

bgpd: Remove HAVE_CUMULUS from evpn commands

5 years agoMerge pull request #2588 from pacovn/Clang_dereference1
Russ White [Fri, 29 Jun 2018 22:12:48 +0000 (18:12 -0400)]
Merge pull request #2588 from pacovn/Clang_dereference1

bgpd isisd: null check (Clang scan)

5 years agoMerge pull request #2577 from pacovn/Coverity_1399377_Structurally_dead_code
Quentin Young [Fri, 29 Jun 2018 21:08:58 +0000 (17:08 -0400)]
Merge pull request #2577 from pacovn/Coverity_1399377_Structurally_dead_code

bgpd: dead code (Coverity 1399377)

5 years agobgpd: dead code (Coverity 1399377)
F. Aragon [Thu, 28 Jun 2018 14:09:21 +0000 (16:09 +0200)]
bgpd: dead code (Coverity 1399377)

Replacing "continue" with "break" because the loop is a "while (0)"

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2517 from pguibert6WIND/flowspec_other_options
Russ White [Fri, 29 Jun 2018 17:45:44 +0000 (13:45 -0400)]
Merge pull request #2517 from pguibert6WIND/flowspec_other_options

Flowspec support other options

5 years agoMerge pull request #2532 from donaldsharp/various_stuff
Jafar Al-Gharaibeh [Fri, 29 Jun 2018 17:41:02 +0000 (12:41 -0500)]
Merge pull request #2532 from donaldsharp/various_stuff

Redistribution and some extra developer debug code

5 years agoMerge pull request #2583 from donaldsharp/more_warnings
Russ White [Fri, 29 Jun 2018 17:39:42 +0000 (13:39 -0400)]
Merge pull request #2583 from donaldsharp/more_warnings

zebra: Fix use of uninited variable

5 years agoMerge pull request #2581 from qlyoung/fix-vtysh-autocomplete
Russ White [Fri, 29 Jun 2018 17:31:21 +0000 (13:31 -0400)]
Merge pull request #2581 from qlyoung/fix-vtysh-autocomplete

vtysh: fix autocomplete garbage printouts

5 years agoMerge pull request #2578 from pacovn/Coverity_1453455_Dereference_null_return_value
Russ White [Fri, 29 Jun 2018 17:28:28 +0000 (13:28 -0400)]
Merge pull request #2578 from pacovn/Coverity_1453455_Dereference_null_return_value

bgpd: null check (Coverity 1453455)

5 years agoMerge pull request #2573 from pacovn/Coverity_23065_Explicit_null_dereferenced
Russ White [Fri, 29 Jun 2018 17:27:04 +0000 (13:27 -0400)]
Merge pull request #2573 from pacovn/Coverity_23065_Explicit_null_dereferenced

bgpd: null check (Coverity 23065)

5 years agoMerge pull request #2514 from pacovn/Coverity_1462467_1465497_Control_flow_issues
Russ White [Fri, 29 Jun 2018 17:24:42 +0000 (13:24 -0400)]
Merge pull request #2514 from pacovn/Coverity_1462467_1465497_Control_flow_issues

zebra: control flow issues (Coverity 1462467 1465497)

5 years agoMerge pull request #2586 from pacovn/clang_scan_nhrpd_vici_initialization
Quentin Young [Fri, 29 Jun 2018 16:55:55 +0000 (12:55 -0400)]
Merge pull request #2586 from pacovn/clang_scan_nhrpd_vici_initialization

nhrpd: uninitialized variable (Clang scan)

5 years agoMerge pull request #2587 from pacovn/Clang_scan_dead_code
Quentin Young [Fri, 29 Jun 2018 16:18:38 +0000 (12:18 -0400)]
Merge pull request #2587 from pacovn/Clang_scan_dead_code

isisd zebra: dead code (Clang scan)

5 years agobgpd isisd: null check (Clang scan)
F. Aragon [Fri, 29 Jun 2018 15:14:23 +0000 (17:14 +0200)]
bgpd isisd: null check (Clang scan)

This correction fixes three bugs detected by Clang scan:

Bug Group: Logic error
Bug Type: Dereference of null pointer

File: bgpd/bgp_evpn.c
Function: bgp_evpn_unconfigure_import_rt_for_vrf
Line: 4246

File: isisd/isis_spf.c
Function: isis_print_paths
Line: 69 (two bugs of same type in one line)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2562 from pacovn/Coverity_1221444_1221446_Out-of-bounds_read
Jafar Al-Gharaibeh [Fri, 29 Jun 2018 15:48:33 +0000 (10:48 -0500)]
Merge pull request #2562 from pacovn/Coverity_1221444_1221446_Out-of-bounds_read

ospf6d: OoB read (Coverity 1221444 1221446)

5 years agoisisd zebra: dead code (Clang scan)
F. Aragon [Fri, 29 Jun 2018 15:01:29 +0000 (17:01 +0200)]
isisd zebra: dead code (Clang scan)

This correction fixes two bugs detected by Clang scan:

Bug Group: Dead store

Bug Type: Dead assignment
File: zebra/kernel_netlink.c
Function: netlink_parse_extended_ack
Line: 548

Bug Type: Dead increment
File: isisd/isis_lsp.c
Function: lsp_bits2string
Line: 625

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agonhrpd: uninitialized variable (Clang scan)
F. Aragon [Fri, 29 Jun 2018 14:51:08 +0000 (16:51 +0200)]
nhrpd: uninitialized variable (Clang scan)

This correction fixes two bugs detected by Clang scan:

Bug Group: Logic error
Bug Type: Assigned value is garbage or undefined
File: nhrpd/vici.c
Function: vici_parse_message
Lines: 100, 105

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2575 from pacovn/Coverity_1399219_Copy-paste_error
Donald Sharp [Fri, 29 Jun 2018 15:17:52 +0000 (11:17 -0400)]
Merge pull request #2575 from pacovn/Coverity_1399219_Copy-paste_error

bgpd: copy-paste error (Coverity 1399219)

5 years agobgpd: null check (Coverity 1453455)
F. Aragon [Thu, 28 Jun 2018 14:16:35 +0000 (16:16 +0200)]
bgpd: null check (Coverity 1453455)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: null check (Coverity 23065)
paco [Thu, 28 Jun 2018 13:21:00 +0000 (15:21 +0200)]
bgpd: null check (Coverity 23065)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoospf6d: OoB read (Coverity 1221444 1221446)
paco [Wed, 27 Jun 2018 09:47:57 +0000 (11:47 +0200)]
ospf6d: OoB read (Coverity 1221444 1221446)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: Add some asserts because of our linklist stuff
Donald Sharp [Fri, 29 Jun 2018 02:33:35 +0000 (22:33 -0400)]
bgpd: Add some asserts because of our linklist stuff

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Fix use of uninited variable
Donald Sharp [Fri, 29 Jun 2018 01:06:23 +0000 (21:06 -0400)]
zebra: Fix use of uninited variable

Allow compiler to think the value is actually set to
something useful in an impossible case.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Fix some build issues from removing HAVE_CUMULUS
Donald Sharp [Fri, 29 Jun 2018 00:57:36 +0000 (20:57 -0400)]
bgpd: Fix some build issues from removing HAVE_CUMULUS

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Use correct data size
Donald Sharp [Fri, 29 Jun 2018 00:45:32 +0000 (20:45 -0400)]
bgpd: Use correct data size

a vni_t is 32 bit, so we only need to use a normal
integer for json commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Remove HAVE_CUMULUS from evpn commands
Donald Sharp [Tue, 19 Jun 2018 18:12:18 +0000 (14:12 -0400)]
bgpd: Remove HAVE_CUMULUS from evpn commands

In order to make EVPN behavior work without special casing
the code, bring the evpn commands under HAVE_CUMULUS into
the fold.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2561 from pacovn/Coverity_1399231_Logically_dead_code
Jafar Al-Gharaibeh [Thu, 28 Jun 2018 19:48:17 +0000 (14:48 -0500)]
Merge pull request #2561 from pacovn/Coverity_1399231_Logically_dead_code

lib ospf6d: dead code (Coverity 1399231)

5 years agovtysh: fix autocomplete garbage printouts
Quentin Young [Thu, 28 Jun 2018 18:37:01 +0000 (18:37 +0000)]
vtysh: fix autocomplete garbage printouts

The semantics for suppressing output received from daemons changed
slightly when pipe actions were introduced, causing raw autocomplete
output to be printed where it shouldn't have been.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #2576 from pacovn/Coverity_1399228_Logically_dead_code
Quentin Young [Thu, 28 Jun 2018 16:55:25 +0000 (12:55 -0400)]
Merge pull request #2576 from pacovn/Coverity_1399228_Logically_dead_code

bgpd: dead code (Coverity 1399228)

5 years agoMerge pull request #2572 from pacovn/Coverity_1399203_Unchecked_return_value
Quentin Young [Thu, 28 Jun 2018 16:35:58 +0000 (12:35 -0400)]
Merge pull request #2572 from pacovn/Coverity_1399203_Unchecked_return_value

bgpd: return value (Coverity 1399203)

5 years agoMerge pull request #2579 from pacovn/Coverity_1424370_Unchecked_return_value_from_library
Quentin Young [Thu, 28 Jun 2018 16:25:45 +0000 (12:25 -0400)]
Merge pull request #2579 from pacovn/Coverity_1424370_Unchecked_return_value_from_library

isisd: return check (Coverity 1424370)

5 years agoMerge pull request #2580 from pacovn/Coverity_1424529_Dereference_after_null_check
Quentin Young [Thu, 28 Jun 2018 16:23:56 +0000 (12:23 -0400)]
Merge pull request #2580 from pacovn/Coverity_1424529_Dereference_after_null_check

isisd: null check (Coverity 1424529)

5 years agoisisd: null check (Coverity 1424529)
F. Aragon [Thu, 28 Jun 2018 14:48:37 +0000 (16:48 +0200)]
isisd: null check (Coverity 1424529)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoisisd: return check (Coverity 1424370)
F. Aragon [Thu, 28 Jun 2018 14:31:37 +0000 (16:31 +0200)]
isisd: return check (Coverity 1424370)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: dead code (Coverity 1399228)
paco [Thu, 28 Jun 2018 13:56:29 +0000 (15:56 +0200)]
bgpd: dead code (Coverity 1399228)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: copy-paste error (Coverity 1399219)
paco [Thu, 28 Jun 2018 13:39:59 +0000 (15:39 +0200)]
bgpd: copy-paste error (Coverity 1399219)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: copy-paste error (Coverity 1399202)
paco [Thu, 28 Jun 2018 13:31:38 +0000 (15:31 +0200)]
bgpd: copy-paste error (Coverity 1399202)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: return value (Coverity 1399203)
paco [Thu, 28 Jun 2018 10:41:52 +0000 (12:41 +0200)]
bgpd: return value (Coverity 1399203)

The return value can be ignored because in case of error both the 'afi'
and 'safi' variables are set to the invalid values (AFI_MAX, SAFI_MAX),
and the invalid values are handled properly afterwards in the 'default'
blocks.

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoospf6d: dead code (Coverity 1399231)
paco [Tue, 26 Jun 2018 19:19:11 +0000 (21:19 +0200)]
ospf6d: dead code (Coverity 1399231)

It should have the same behavior when debug not enabled, and slightly
different behavior when debug enabled (previously dead code now should
show debug messages in debug mode)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: rework enumerate function, handle not values
Philippe Guibert [Fri, 22 Jun 2018 07:17:04 +0000 (09:17 +0200)]
bgpd: rework enumerate function, handle not values

The handling of reverse values is in a separate function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add an icmp flag for flowspec icmp entries
Philippe Guibert [Thu, 21 Jun 2018 10:29:18 +0000 (12:29 +0200)]
bgpd: add an icmp flag for flowspec icmp entries

Some values for icmp type/code can not be encoded like port source or
port destination. This is the case of 0 value that is authorized for
icmp.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: rework icmp enumerate list
Philippe Guibert [Wed, 20 Jun 2018 14:59:17 +0000 (16:59 +0200)]
bgpd: rework icmp enumerate list

As the other enumerate list, icmp type and code are handled as the other
combinations. The icmp type and code options are the last options to be
injected into PBR. If icmp type is present only, all the filtering will
apply to this icmp type. if icmp code is present only, then all the
combination will be done with icmp type ranging from 0 to 255 values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: fix recursive call combination
Philippe Guibert [Wed, 20 Jun 2018 13:30:40 +0000 (15:30 +0200)]
bgpd: fix recursive call combination

The recursive algorithm was taking into account the fact that all the
bpof structures were filled in. Because the dscp value was not given,
the pkt_len parsing could not be achieved. Now the iteration takes into
account each type according to the previous one, thus guaranting all
parameters to be parsed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: handle policy routing fragment handling
Philippe Guibert [Wed, 20 Jun 2018 12:06:31 +0000 (14:06 +0200)]
zebra: handle policy routing fragment handling

incoming iptable entries with fragment parameter is handled.
An iptable context is created for each fragment value received from BGP.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: support for flowspec fragment list into policy routing
Philippe Guibert [Wed, 20 Jun 2018 11:55:20 +0000 (13:55 +0200)]
bgpd: support for flowspec fragment list into policy routing

The flowspec fragment attribute is taken into account to be pushed in
BGP policy routing entries. Valid values are enumerate list of 1, 2, 4,
or 8 values. no combined value is supported yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: align fragment flowspec decoding with tcpflags
Philippe Guibert [Wed, 20 Jun 2018 06:32:43 +0000 (08:32 +0200)]
bgpd: align fragment flowspec decoding with tcpflags

As fragment bitmask and tcpflags bitmask in flowspec protocol is encoded
in the same way, it is not necessary to differentiate those two fields.
Moreover, it overrides the initial fragment limit set to 1. It is now
possible to handle multiple framgent values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: support for enumerate pkt len
Philippe Guibert [Tue, 19 Jun 2018 14:02:55 +0000 (16:02 +0200)]
bgpd: support for enumerate pkt len

The packet length can be injected from fs entry with an enumerate list;
the negation of the value is also taken into account.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: introduce recursive operations for or flowspec operations
Philippe Guibert [Tue, 19 Jun 2018 13:02:26 +0000 (15:02 +0200)]
bgpd: introduce recursive operations for or flowspec operations

So as to add or remove entries with flowspec or operations like tcp
flags or dscp enum list, a mechanism is put in place that adds
recursivity.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: enumerate support for dscp values
Philippe Guibert [Tue, 19 Jun 2018 13:02:15 +0000 (15:02 +0200)]
bgpd: enumerate support for dscp values

If one dscp value or an enumerate list of or values of dscp are
provided, then the bgp pbr entries created will take into account the
dscp values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: add show pbr iptable dscp information
Philippe Guibert [Tue, 19 Jun 2018 12:54:59 +0000 (14:54 +0200)]
zebra: add show pbr iptable dscp information

The iptable configured with dscp displays the dscp value configured.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years ago*: add flowspec dscp handling
Philippe Guibert [Wed, 13 Jun 2018 09:59:07 +0000 (11:59 +0200)]
*: add flowspec dscp handling

Only one dscp value is accepted as filtering option.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add a parameter to handle param or combinations
Philippe Guibert [Mon, 18 Jun 2018 09:52:19 +0000 (11:52 +0200)]
bgpd: add a parameter to handle param or combinations

Before adding/removing to zebra, flowspec entries parses the list of
combinations or avaialble and creates contexts in order to be injected
to zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: use a bgp_pbr_or_filter structure to host tcpflags combinations
Philippe Guibert [Mon, 18 Jun 2018 09:50:16 +0000 (11:50 +0200)]
bgpd: use a bgp_pbr_or_filter structure to host tcpflags combinations

tcp flags combinations ( or enumerates)  are hosted in a structure that
will be analysed later, when wanting to inject that information to
zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: extend enumerate API to handle or operations
Philippe Guibert [Mon, 18 Jun 2018 09:18:21 +0000 (11:18 +0200)]
bgpd: extend enumerate API to handle or operations

The flowspec enumerate list can either be and values or or values.
In the latter case, a list is created that will be used later.
Also, the API supports the check for both and or or operations. This API
does not permit to handle both and and or operations at the same time.
The list will have to be either and or or. An other API retrieves the
operator unary value that is used: and or or. or 0 is the two operators
are used at the same time.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: do not add default route for flowspec for each FS entry
Philippe Guibert [Wed, 13 Jun 2018 09:56:35 +0000 (11:56 +0200)]
bgpd: do not add default route for flowspec for each FS entry

Because the Flowspec entries are parsed first, then injected to Zebra,
there are cases where the install feedback from zebra is not received.
This leads to unnecessary add route events, whereas one should be
enough.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd, lib: share flags values for iptable configuration
Philippe Guibert [Wed, 13 Jun 2018 09:12:08 +0000 (11:12 +0200)]
bgpd, lib: share flags values for iptable configuration

Those flags can be shared between BGP and Zebra. That is why
those flags are moved to common pbr.h header file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: handling of policy routing iptable tcpflags
Philippe Guibert [Tue, 12 Jun 2018 16:32:21 +0000 (18:32 +0200)]
zebra: handling of policy routing iptable tcpflags

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: support for flowspec tcp flags
Philippe Guibert [Tue, 12 Jun 2018 16:31:52 +0000 (18:31 +0200)]
bgpd: support for flowspec tcp flags

Ability to handle flowspec tcp flags.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: fix display with flowspec tcp flags option
Philippe Guibert [Tue, 12 Jun 2018 16:26:35 +0000 (18:26 +0200)]
bgpd: fix display with flowspec tcp flags option

When displaying RIB FS summary, the TCP option is not displayed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: simplify API in BGP policy-routing to handle Flowspec
Philippe Guibert [Tue, 12 Jun 2018 12:45:35 +0000 (14:45 +0200)]
bgpd: simplify API in BGP policy-routing to handle Flowspec

To handle FS params between FS RIB and BGP PBR entities, a structure
intermediate named bgp_pbr_filter is used, and contains all filtering
information that was before passed as a parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: add packet length into pbr support
Philippe Guibert [Mon, 11 Jun 2018 13:30:11 +0000 (15:30 +0200)]
zebra: add packet length into pbr support

The packet length is added to iptable zapi message.
Then the iptable structure is taking into account the pkt_len field.
The show pbr iptable command displays the packet length used if any.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add debug routine to display which PBR entry is handled
Philippe Guibert [Mon, 11 Jun 2018 13:41:57 +0000 (15:41 +0200)]
bgpd: add debug routine to display which PBR entry is handled

To know which entry is set/unset, a debug handler is present, that
displays which entry is injected/removed to/from zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add support of bgp flowspec filtering per packet length
Philippe Guibert [Mon, 11 Jun 2018 13:35:37 +0000 (15:35 +0200)]
bgpd: add support of bgp flowspec filtering per packet length

It is possible to do filtering based on packet length value or a range
of packet-length.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add comment to inform that icmp can be stored in that struct
Philippe Guibert [Mon, 4 Jun 2018 16:13:00 +0000 (18:13 +0200)]
bgpd: add comment to inform that icmp can be stored in that struct

Generic ipset entry structure will be reused to host icmp information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: handle ICMP type and code from flowspec
Philippe Guibert [Mon, 4 Jun 2018 16:11:04 +0000 (18:11 +0200)]
bgpd: handle ICMP type and code from flowspec

It is possible for flowspec entries containing ICMP rule to insert PBR
entries based on ICMP type and ICMP code.
Flowspec ICMP filtering can either have icmp type or icmp code or both.
Not all combinations are permitted:
- if icmp code is provided, then it is not possible to derive the
  correct icmp value. This will not be installed
- range of ICMP is authorised or list of ICMP, but not both.
- on receiving a list of ICMPtype/code, each ICMP type is attempted to
  be associated to ICMP code. If not found, then ICMPtype is combined
  with all known ICMP code values associated to that ICMP type.
- if a specific ICMP type/code is needed, despite the ICMP code/type
  combination does not exist, then it is possible to do it by forging a
  FS ICMP type/code specific for that.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: improve show zebra ipset output for icmp
Philippe Guibert [Tue, 5 Jun 2018 15:01:14 +0000 (17:01 +0200)]
zebra: improve show zebra ipset output for icmp

The icmp type/code is displayed.
Also, the flags are correctly set in case ICMP protocol is elected.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: pbr ipset_type2_str command is externalised
Philippe Guibert [Thu, 21 Jun 2018 13:01:01 +0000 (15:01 +0200)]
zebra: pbr ipset_type2_str command is externalised

The API of that function that converts ipset types is externalised.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agopimd: Remove redistribution request
Donald Sharp [Fri, 22 Jun 2018 14:45:03 +0000 (10:45 -0400)]
pimd: Remove redistribution request

pim does not pay attention to redistribution events
from zebra so let's not request them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Add a bit of code to look at fifo
Donald Sharp [Fri, 22 Jun 2018 14:38:53 +0000 (10:38 -0400)]
lib, zebra: Add a bit of code to look at fifo

When in a dev build add a bit of code to track max
depth of a fifo and to allow zebra to report on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Re-add tracking of redistribution events
Donald Sharp [Fri, 22 Jun 2018 14:33:42 +0000 (10:33 -0400)]
zebra: Re-add tracking of redistribution events

Somewhere along the way we lost the tracking of
redistribution events.  Put them back in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2563 from pacovn/Coverity_1465494_String_not_null_terminated_2
Quentin Young [Wed, 27 Jun 2018 19:15:22 +0000 (15:15 -0400)]
Merge pull request #2563 from pacovn/Coverity_1465494_String_not_null_terminated_2

lib zebra: str-z check (2) (Coverity 1465494)

5 years agoMerge pull request #2570 from pacovn/Coverity_1448386_Untrusted_value_as_argument
Quentin Young [Wed, 27 Jun 2018 19:09:34 +0000 (15:09 -0400)]
Merge pull request #2570 from pacovn/Coverity_1448386_Untrusted_value_as_argument

lib: untrusted argument (Coverity 1448386)

5 years agoMerge pull request #2569 from pacovn/Coverity_1451361_Dereference_before_null_check_2
Jafar Al-Gharaibeh [Wed, 27 Jun 2018 17:51:48 +0000 (13:51 -0400)]
Merge pull request #2569 from pacovn/Coverity_1451361_Dereference_before_null_check_2

lib: null check (2) (Coverity 1451361)

5 years agoMerge pull request #2566 from pacovn/Coverity_23024_Dereference_null_return
Jafar Al-Gharaibeh [Wed, 27 Jun 2018 17:49:08 +0000 (13:49 -0400)]
Merge pull request #2566 from pacovn/Coverity_23024_Dereference_null_return

ospf6d: null check (Coverity 23024)

5 years agoMerge pull request #2564 from pacovn/Coverity_23110_Dereference_after_null_check
Jafar Al-Gharaibeh [Wed, 27 Jun 2018 17:47:47 +0000 (13:47 -0400)]
Merge pull request #2564 from pacovn/Coverity_23110_Dereference_after_null_check

ospfd: null check (Coverity 23110)

5 years agolib: untrusted argument (Coverity 1448386)
paco [Wed, 27 Jun 2018 13:50:04 +0000 (15:50 +0200)]
lib: untrusted argument (Coverity 1448386)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoospf6d: null check (Coverity 23024)
paco [Wed, 27 Jun 2018 12:52:54 +0000 (14:52 +0200)]
ospf6d: null check (Coverity 23024)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agolib: null check (2) (Coverity 1451361)
paco [Wed, 27 Jun 2018 13:24:45 +0000 (15:24 +0200)]
lib: null check (2) (Coverity 1451361)

Additional correction to fa3016309b33395c02cf10e7e198517c5b81e55a

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoospfd: null check (Coverity 23110)
paco [Wed, 27 Jun 2018 12:41:50 +0000 (14:41 +0200)]
ospfd: null check (Coverity 23110)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agolib zebra: str-z check (2) (Coverity 1465494)
paco [Wed, 27 Jun 2018 10:43:43 +0000 (12:43 +0200)]
lib zebra: str-z check (2) (Coverity 1465494)

This is an additional correction after  45981fda0634f7277c27c2a55e30d7f3433ffa16 / PR #2462. I hope
this fixes the Coverity warning (I've added an additional check for ensuring
the string provided by the inotify read is zero-terminated).

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #2556 from pacovn/Coverity_1465491_Untrusted_value_as_argument_3
Donald Sharp [Tue, 26 Jun 2018 23:59:27 +0000 (19:59 -0400)]
Merge pull request #2556 from pacovn/Coverity_1465491_Untrusted_value_as_argument_3

pimd: untrusted argument (3) (Coverity 1465491)