]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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)

6 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)

6 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)

6 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)

6 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)

6 years agolib: untrusted argument (Coverity 1448386) 2570/head
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>
6 years agoospf6d: null check (Coverity 23024) 2566/head
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>
6 years agolib: null check (2) (Coverity 1451361) 2569/head
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>
6 years agoospfd: null check (Coverity 23110) 2564/head
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>
6 years agolib zebra: str-z check (2) (Coverity 1465494) 2563/head
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>
6 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)

6 years agoMerge pull request #2559 from pacovn/Coverity_1302503_Logically_dead_code
Quentin Young [Tue, 26 Jun 2018 20:48:54 +0000 (16:48 -0400)]
Merge pull request #2559 from pacovn/Coverity_1302503_Logically_dead_code

lib ospfd: dead code (Coverity 1302503 1302502)

6 years agolib ospfd: dead code (Coverity 1302503 1302502) 2559/head
paco [Tue, 26 Jun 2018 18:16:13 +0000 (20:16 +0200)]
lib ospfd: dead code (Coverity 1302503 1302502)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2560 from pacovn/Coverity_1302500_Constant_variable_guards_dead_code
Quentin Young [Tue, 26 Jun 2018 19:05:53 +0000 (15:05 -0400)]
Merge pull request #2560 from pacovn/Coverity_1302500_Constant_variable_guards_dead_code

ospfd: dead code (Coverity 1302500)

6 years agoMerge pull request #2557 from pacovn/Coverity_1465490_Unchecked_return_value
Quentin Young [Tue, 26 Jun 2018 18:42:30 +0000 (14:42 -0400)]
Merge pull request #2557 from pacovn/Coverity_1465490_Unchecked_return_value

pimd: return check (Coverity 1465490)

6 years agoospfd: dead code (Coverity 1302500) 2560/head
paco [Tue, 26 Jun 2018 18:33:47 +0000 (20:33 +0200)]
ospfd: dead code (Coverity 1302500)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agopimd: return check (Coverity 1465490) 2557/head
paco [Tue, 26 Jun 2018 15:31:00 +0000 (17:31 +0200)]
pimd: return check (Coverity 1465490)

Unless someone intentionally changes MCAST_ALL_ROUTERS ("224.0.0.2") with a
wrong IP, this should never fail, so the fix is using "(void)" at the left
of the function call, as an explicit way of indicating we discard the
return value on purpose.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2503 from pacovn/Coverity_1469898_Uninitialized_scalar_variable
Quentin Young [Tue, 26 Jun 2018 15:35:58 +0000 (11:35 -0400)]
Merge pull request #2503 from pacovn/Coverity_1469898_Uninitialized_scalar_variable

lib: uninitialized variable (2) (Coverity 1469898)

6 years agoMerge pull request #2463 from pacovn/Coverity_1452539_Out-of-bounds_access
Quentin Young [Tue, 26 Jun 2018 15:34:31 +0000 (11:34 -0400)]
Merge pull request #2463 from pacovn/Coverity_1452539_Out-of-bounds_access

lib: out-of-bounds access (Coverity 1452539)

6 years agoMerge pull request #2534 from pacovn/Coverity_1470113_Untrusted_array_index_write
Russ White [Tue, 26 Jun 2018 15:18:38 +0000 (11:18 -0400)]
Merge pull request #2534 from pacovn/Coverity_1470113_Untrusted_array_index_write

zebra: untrusted array index (2) (Coverity 1470113)

6 years agoMerge pull request #2540 from LabNConsulting/working/master/bgp-twice-leaked-nht
Russ White [Tue, 26 Jun 2018 15:17:32 +0000 (11:17 -0400)]
Merge pull request #2540 from LabNConsulting/working/master/bgp-twice-leaked-nht

bgpd: don't nexthop-track twice-leaked routes that came from zebra

6 years agoMerge pull request #2542 from pacovn/Coverity_1452552_Out-of-bounds_access
Russ White [Tue, 26 Jun 2018 15:15:59 +0000 (11:15 -0400)]
Merge pull request #2542 from pacovn/Coverity_1452552_Out-of-bounds_access

isisd: out-of-bounds access (Coverity 1452552)

6 years agoMerge pull request #2545 from pacovn/Coverity_1468413_Explicit_null_dereferenced
Russ White [Tue, 26 Jun 2018 15:14:39 +0000 (11:14 -0400)]
Merge pull request #2545 from pacovn/Coverity_1468413_Explicit_null_dereferenced

bgpd: null check (Coverity 1468413)

6 years agopimd: untrusted argument (3) (Coverity 1465491) 2556/head
paco [Tue, 26 Jun 2018 15:09:07 +0000 (17:09 +0200)]
pimd: untrusted argument (3) (Coverity 1465491)

Additional fix over d94023d85c1682ae14def9d50f2474e8e6290e44 (PR #2546)

Removed all pointer arithmetic used for the checks, while keeping same
coverage. I hope this removes the Coverity warning (If this don't fix it, I'll
make Coverity work with a fork and try there as many times as necessary)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2547 from pacovn/Coverity_1458168_Dereference_null_return_value
Russ White [Tue, 26 Jun 2018 15:14:07 +0000 (11:14 -0400)]
Merge pull request #2547 from pacovn/Coverity_1458168_Dereference_null_return_value

eigrpd ospfd: null check (Coverity 1458168 1455335)

6 years agoMerge pull request #2535 from donaldsharp/netlink_talk_fun
Renato Westphal [Tue, 26 Jun 2018 15:03:52 +0000 (12:03 -0300)]
Merge pull request #2535 from donaldsharp/netlink_talk_fun

Netlink talk fun

6 years agoMerge pull request #2549 from pacovn/Coverity_1452317_Explicit_null_dereferenced
Renato Westphal [Tue, 26 Jun 2018 13:55:08 +0000 (10:55 -0300)]
Merge pull request #2549 from pacovn/Coverity_1452317_Explicit_null_dereferenced

ldpd: null check (Coverity 1452317)

6 years agoMerge pull request #2552 from qlyoung/remove-defun-deprecated
Renato Westphal [Tue, 26 Jun 2018 13:25:00 +0000 (10:25 -0300)]
Merge pull request #2552 from qlyoung/remove-defun-deprecated

Remove DEFUN_DEPRECATED

6 years agoMerge pull request #2548 from pacovn/Coverity_1453456_Unchecked_return_value_from_library
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 21:30:31 +0000 (17:30 -0400)]
Merge pull request #2548 from pacovn/Coverity_1453456_Unchecked_return_value_from_library

lib: check return value (Coverity 1453456)

6 years agolib: check return value (Coverity 1453456) 2548/head
paco [Mon, 25 Jun 2018 14:10:47 +0000 (16:10 +0200)]
lib: check return value (Coverity 1453456)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2546 from pacovn/Coverity_1465491_Untrusted_value_as_argument_2
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:53:26 +0000 (12:53 -0400)]
Merge pull request #2546 from pacovn/Coverity_1465491_Untrusted_value_as_argument_2

pimd: untrusted argument (2) (Coverity 1465491)

6 years agoMerge pull request #2530 from pacovn/Coverity_1399295_Out-of-bounds_read
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:46:57 +0000 (12:46 -0400)]
Merge pull request #2530 from pacovn/Coverity_1399295_Out-of-bounds_read

Coverity 1399295 out of bounds read

6 years agoMerge pull request #2536 from pacovn/Coverity_1470150_Dereference_null_return_value
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:43:31 +0000 (12:43 -0400)]
Merge pull request #2536 from pacovn/Coverity_1470150_Dereference_null_return_value

lib: null check (Coverity 1470150)

6 years agoMerge pull request #2550 from pacovn/Coverity_1399284_Dereference_null_return_value
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:40:02 +0000 (12:40 -0400)]
Merge pull request #2550 from pacovn/Coverity_1399284_Dereference_null_return_value

ospfd: null check (Coverity 1399284)

6 years agoMerge pull request #2544 from pacovn/Coverity_1468510_Dereference_null_return_value
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:39:17 +0000 (12:39 -0400)]
Merge pull request #2544 from pacovn/Coverity_1468510_Dereference_null_return_value

ospf6d: null check (Coverity 1468510)

6 years agolib: remove DEFUN_DEPRECATED 2552/head
Quentin Young [Fri, 1 Jun 2018 20:31:52 +0000 (20:31 +0000)]
lib: remove DEFUN_DEPRECATED

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: remove DEFUN_DEPRECATED usage
Quentin Young [Mon, 4 Jun 2018 16:05:56 +0000 (16:05 +0000)]
bgpd: remove DEFUN_DEPRECATED usage

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2543 from pacovn/Coverity_1399304_Out-of-bounds_access
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:38:44 +0000 (12:38 -0400)]
Merge pull request #2543 from pacovn/Coverity_1399304_Out-of-bounds_access

ospfd: out-of-bounds access (Coverity 1399304 1399286)

6 years agoMerge pull request #2541 from pacovn/Coverity_1221445_1221448_Out-of-bounds_access
Jafar Al-Gharaibeh [Mon, 25 Jun 2018 16:37:57 +0000 (12:37 -0400)]
Merge pull request #2541 from pacovn/Coverity_1221445_1221448_Out-of-bounds_access

ospfd: OoB access (Coverity 1221445 1221448)

6 years ago*: remove deprecated 'log trap' commands
Quentin Young [Fri, 1 Jun 2018 20:31:48 +0000 (20:31 +0000)]
*: remove deprecated 'log trap' commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopimd: untrusted argument (2) (Coverity 1465491) 2546/head
paco [Mon, 25 Jun 2018 13:25:26 +0000 (15:25 +0200)]
pimd: untrusted argument (2) (Coverity 1465491)

Additional fix over 18e994a0437cfba9f4c09bd62293e13e49ea774b (PR #2457)

Previous correction was not enough for fixing the Coverity warning. Now we
ensure we don't overflow the buffer.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: null check (Coverity 1399284) 2550/head
paco [Mon, 25 Jun 2018 15:18:17 +0000 (17:18 +0200)]
ospfd: null check (Coverity 1399284)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: OoB access (Coverity 1399304 1399286) 2543/head
paco [Mon, 25 Jun 2018 10:55:53 +0000 (12:55 +0200)]
ospfd: OoB access (Coverity 1399304 1399286)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoldpd: null check (Coverity 1452317) 2549/head
paco [Mon, 25 Jun 2018 14:47:15 +0000 (16:47 +0200)]
ldpd: null check (Coverity 1452317)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoeigrpd ospfd: null chk (Coverity 1458168 1455335) 2547/head
paco [Mon, 25 Jun 2018 13:43:04 +0000 (15:43 +0200)]
eigrpd ospfd: null chk (Coverity 1458168 1455335)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: Log how we got to this failure. 2535/head
Donald Sharp [Fri, 22 Jun 2018 18:26:56 +0000 (14:26 -0400)]
zebra: Log how we got to this failure.

When a filter function fails to work correctly, we get an
error message that something has gone wrong.  Unfortunately
we may not have any clues as to where the decode failure
happened.  Add a backtrace to give us a clue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add error messages in places where we have a decode problem
Donald Sharp [Fri, 22 Jun 2018 18:22:02 +0000 (14:22 -0400)]
zebra: Add error messages in places where we have a decode problem

When we receive a netlink message from the kernel we have
handler functions for when we send a netlink command, if these
return a failure ( < 0 ) then we output that we had a parse
issue.  But if all we get is:

2018-06-21T23:47:45.298156+00:00 qct-ix1-08 zebra[1484]: netlink-cmd (NS 0) filter function error

Then it is not very useful to figure out *where* the error happened.

Add more error code when in a decode path to hopefully allow us
to figure out where this message is coming from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: null check (Coverity 1468413) 2545/head
paco [Mon, 25 Jun 2018 13:03:17 +0000 (15:03 +0200)]
bgpd: null check (Coverity 1468413)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospf6d: null check (Coverity 1468510) 2544/head
paco [Mon, 25 Jun 2018 11:09:34 +0000 (13:09 +0200)]
ospf6d: null check (Coverity 1468510)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoisisd: out-of-bounds access (Coverity 1452552) 2542/head
paco [Mon, 25 Jun 2018 10:16:32 +0000 (12:16 +0200)]
isisd: out-of-bounds access (Coverity 1452552)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoospfd: OoB access (Coverity 1221445 1221448) 2541/head
paco [Mon, 25 Jun 2018 09:19:55 +0000 (11:19 +0200)]
ospfd: OoB access (Coverity 1221445 1221448)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agobgpd: don't nexthop-track twice-leaked routes that came from zebra 2540/head
G. Paul Ziemba [Sun, 24 Jun 2018 19:39:03 +0000 (12:39 -0700)]
bgpd: don't nexthop-track twice-leaked routes that came from zebra

Issue 2381: interface based routes not marked "up" when they originate
in zebra, redistributed to bgp vrf, then imported to vpn and then
imported by another vrf.

Routes that are redistributed into BGP from zebra should not get
nexthop tracking (the assumption is that the originating protocol
is responsible to export or withdraw the route according to its own
notion of nexthop status).

The vpn-vrf route-leaking code checks the source route sub_type to
decide whether to use nexthop tracking on the resulting leaked route.

A route that is redistributed from zebra into bgp will have
sub_type==BGP_ROUTE_REDISTRIBUTE. If it is leaked to the vpn RIB,
the resulting vpn RIB route will have sub_type==BGP_ROUTE_IMPORTED.
If THAT vpn route is leaked to another vrf, the original code will
examine only the leak-source route sub_type and, since it is
not BGP_ROUTE_REDISTRIBUTE, will wrongly try to use nexthop tracking
on the new route in the final vrf.

This change modifies the leak function to track back up the
parent links to the ultimate parent of the leak source route
and look at that route's sub_type instead.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agolib: null check (Coverity 1470150) 2536/head
paco [Fri, 22 Jun 2018 19:35:01 +0000 (21:35 +0200)]
lib: null check (Coverity 1470150)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2520 from donaldsharp/privs_smivs
Jafar Al-Gharaibeh [Fri, 22 Jun 2018 19:19:13 +0000 (14:19 -0500)]
Merge pull request #2520 from donaldsharp/privs_smivs

lib: Fix privs when using HAVE_CAPABILITIES

6 years agolib: uninitialized variable (2) (Coverity 1469898) 2503/head
paco [Wed, 20 Jun 2018 16:25:28 +0000 (18:25 +0200)]
lib: uninitialized variable (2) (Coverity 1469898)

Previous correction (2c2d5cb397c140c05ad81e8c79273bd3af13b595) was not enough,
so now it is ensured that the argument shift is not negative nor zero.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agozebra: untrusted array index (2) (Coverity 1470113) 2534/head
paco [Fri, 22 Jun 2018 15:14:57 +0000 (17:14 +0200)]
zebra: untrusted array index (2) (Coverity 1470113)

This is a correction over 7f61ea7bd47bfd86a2c873870507281b1837dcdd in order
to avoid the TAINTED_SCALAR Coverity warning (ending in "Untrusted array
index read"). This is equivalent to the previous commit, but avoiding
pointer arithmetic with tainted variables.

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2512 from pacovn/Coverity_1399200_Unchecked_return_value_from_library
Quentin Young [Fri, 22 Jun 2018 18:11:09 +0000 (14:11 -0400)]
Merge pull request #2512 from pacovn/Coverity_1399200_Unchecked_return_value_from_library

vtysh: return value check (Coverity 1399200)

6 years agoripd: out-of-bounds read (Coverity 1399295) 2530/head
paco [Fri, 22 Jun 2018 13:41:35 +0000 (15:41 +0200)]
ripd: out-of-bounds read (Coverity 1399295)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2449 from donaldsharp/lib_delayed_read
Lou Berger [Fri, 22 Jun 2018 17:13:05 +0000 (13:13 -0400)]
Merge pull request #2449 from donaldsharp/lib_delayed_read

Lib delayed read

6 years agolib: out-of-bounds access (Coverity 1452539) 2463/head
paco [Fri, 15 Jun 2018 14:54:09 +0000 (16:54 +0200)]
lib: out-of-bounds access (Coverity 1452539)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agovtysh: return value check (Coverity 1399200) 2512/head
paco [Thu, 21 Jun 2018 10:09:44 +0000 (12:09 +0200)]
vtysh: return value check (Coverity 1399200)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agoMerge pull request #2501 from pacovn/infer_unused1
Quentin Young [Thu, 21 Jun 2018 19:12:33 +0000 (15:12 -0400)]
Merge pull request #2501 from pacovn/infer_unused1

bgpd isisd ldpd lib ospfd pimd: redundancy (infer, grouped)

6 years agoMerge pull request #2505 from pacovn/Coverity_1143220_Argument_cannot_be_negative
Quentin Young [Thu, 21 Jun 2018 19:02:31 +0000 (15:02 -0400)]
Merge pull request #2505 from pacovn/Coverity_1143220_Argument_cannot_be_negative

tools: return check (2) (Coverity 1143220)

6 years agoMerge pull request #2511 from pacovn/Coverity_1452287_et_al_Explicit_null_dereferenced
Quentin Young [Thu, 21 Jun 2018 19:00:12 +0000 (15:00 -0400)]
Merge pull request #2511 from pacovn/Coverity_1452287_et_al_Explicit_null_dereferenced

ldpd, lib: null check (Coverity 1452287 and 20 alike)

6 years agoMerge pull request #2408 from ajones-rvbd/ajones-issue-2403
Quentin Young [Thu, 21 Jun 2018 18:43:16 +0000 (14:43 -0400)]
Merge pull request #2408 from ajones-rvbd/ajones-issue-2403

tests: use BUILT_SOURCES in tests/Makefile.am for automake 1.16.1

6 years agoMerge pull request #2502 from pacovn/Coverity_1221459_Use_after_free
Quentin Young [Thu, 21 Jun 2018 18:38:47 +0000 (14:38 -0400)]
Merge pull request #2502 from pacovn/Coverity_1221459_Use_after_free

ospf6d: fix use after free (2) (Coverity 1221459)

6 years agoMerge pull request #2513 from pacovn/Coverity_1455334_et_al_Dereference_null_return_value
Quentin Young [Thu, 21 Jun 2018 18:34:56 +0000 (14:34 -0400)]
Merge pull request #2513 from pacovn/Coverity_1455334_et_al_Dereference_null_return_value

eigrpd: null check (Coverity 1455334 and 4 alike)

6 years agoMerge pull request #2518 from pacovn/Coverity_23106_Explicit_null_dereferenced
Quentin Young [Thu, 21 Jun 2018 18:24:11 +0000 (14:24 -0400)]
Merge pull request #2518 from pacovn/Coverity_23106_Explicit_null_dereferenced

bgpd: null check (Coverity 23106)

6 years agoMerge pull request #2519 from pacovn/Coverity_1399238_Logically_dead_code
Quentin Young [Thu, 21 Jun 2018 18:20:48 +0000 (14:20 -0400)]
Merge pull request #2519 from pacovn/Coverity_1399238_Logically_dead_code

bgpd: dead code (Coverity 1399238)

6 years agoMerge pull request #2522 from pacovn/Coverity_1399277_Explicit_null_dereferenced
Quentin Young [Thu, 21 Jun 2018 18:18:47 +0000 (14:18 -0400)]
Merge pull request #2522 from pacovn/Coverity_1399277_Explicit_null_dereferenced

lib: null check (Coverity 1399277)

6 years agoMerge pull request #2523 from pacovn/Coverity_1455380_Dereference_null_return_value
Quentin Young [Thu, 21 Jun 2018 18:17:58 +0000 (14:17 -0400)]
Merge pull request #2523 from pacovn/Coverity_1455380_Dereference_null_return_value

bgpd: null check (Coverity 1455380)

6 years agobgpd: null check (Coverity 1455380) 2523/head
paco [Thu, 21 Jun 2018 15:49:13 +0000 (17:49 +0200)]
bgpd: null check (Coverity 1455380)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agolib: null check (Coverity 1399277) 2522/head
paco [Thu, 21 Jun 2018 15:34:16 +0000 (17:34 +0200)]
lib: null check (Coverity 1399277)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agosharpd: Does not need any special priv's 2520/head
Donald Sharp [Thu, 21 Jun 2018 15:28:16 +0000 (11:28 -0400)]
sharpd: Does not need any special priv's

Remove the unnecessary privs that we were requesting
for the sharp daemon.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: dead code (Coverity 1399238) 2519/head
paco [Thu, 21 Jun 2018 15:22:55 +0000 (17:22 +0200)]
bgpd: dead code (Coverity 1399238)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agolib: Fix privs when using HAVE_CAPABILITIES
Donald Sharp [Thu, 21 Jun 2018 15:22:51 +0000 (11:22 -0400)]
lib: Fix privs when using HAVE_CAPABILITIES

If your daemon does not need any special privileges
and you are compiling with HAVE_CAPABILIES, the
zprivs->change pointer will end up NULL due
to the way zprivs_caps_init.  So as a check
let's add a NULL check for zprivs->change
and set it to a function that will do nothing.

This change prevents a crash if you raise privileges
when your daemon needs no special privileges.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2510 from donaldsharp/extended_ack
Renato Westphal [Thu, 21 Jun 2018 15:16:53 +0000 (12:16 -0300)]
Merge pull request #2510 from donaldsharp/extended_ack

zebra: Add extended Ack error parsing to FRR

6 years agobgpd: null check (Coverity 23106) 2518/head
paco [Thu, 21 Jun 2018 13:58:51 +0000 (15:58 +0200)]
bgpd: null check (Coverity 23106)

Signed-off-by: F. Aragon <paco@voltanet.io>
6 years agospf6d: fix use after free (2) (Coverity 1221459) 2502/head
paco [Wed, 20 Jun 2018 16:09:35 +0000 (18:09 +0200)]
spf6d: fix use after free (2) (Coverity 1221459)

Previous fix was incomplete, as calling ospf6_lsa_unlock() frees 'req' but
it does not put it to zero, so it was called ospf6_lsdb_remove() afterwards
even being 'req' already freed.

Signed-off-by: F. Aragon <paco@voltanet.io>