Donald Sharp [Fri, 22 Jul 2016 09:58:08 +0000 (05:58 -0400)]
lib: Setup prefix.h to allow it to store (s,g)
We need the ability to store the (s,g) in a struct prefix.
This will allow us to consolidate some duplicated code in
pimd as well as set us up to switch from a link list to a
table to store (s,g) state.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
David Lamparter [Fri, 13 Jan 2017 14:31:04 +0000 (15:31 +0100)]
build: fix several ldpd XML-CLI build issues
- the location of ldp_vty_cmds.c can be either in srcdir or builddir,
depending on whether a premade file from a dist tarball is used
- perl libxml support is only needed if that file is absent
- the actual perl script wasn't even included in the dist tarball
- the include location doesn't work when srcdir != builddir
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Philippe Guibert [Tue, 17 Jan 2017 16:51:40 +0000 (17:51 +0100)]
bgpd: avoid recalculating as_val value in str2prefix_rd
This is an optimisation that consists in avoiding calling twice atol()
function when converting an ext. community to an AS4 byte or a standard AS byte value.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix nexthop comparison for nexthop vpnv6 attribute
As nexthop attribute for vpnv6 also contains a blank RD and a blank tag,
the IPv6 address length increases from 16 to 24 bytes. The same was
observed for vpnv4 nexthop, but was missing for VPNv6.
The same is done for martian nexthop debugging.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Donald Sharp [Mon, 16 Jan 2017 13:57:20 +0000 (08:57 -0500)]
zebra: Some code cleanup based upon Review.
Cleanup 2 spots in the code:
1) In if_netlink.c -> combine multi-line if statement into 1 line
2) In zebra_ptm.c -> only handle code that needs to be inside the if statement
in the if statement.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 16 Jan 2017 00:13:23 +0000 (19:13 -0500)]
bgpd: Put back show command to way it was originally
I modified the 'show ....' command to be one long line.
Upon reflection and porting the large-community code
I have decided that we need to put this back to the way
it was before.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Some show commands are added for handling vpnv6.
As the commands was present for vpnv4, but not vpnv6, the handler
routine for vty vpnv4 have been extended for vpnv6.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix nexthop comparison for nexthop vpnv6 attribute
As nexthop attribute for vpnv6 also contains a blank RD and a blank tag,
the IPv6 address length increases from 16 to 24 bytes. The same was
observed for vpnv4 nexthop, but was missing for VPNv6.
The same is done for martian nexthop debugging.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
David Lamparter [Fri, 13 Jan 2017 13:10:00 +0000 (14:10 +0100)]
watchfrr: indent to Linux CodingStyle
before this patch, watchfrr was using an inconsistent style that matched
neither GNU nor Linux kernel nor BSD style. Reindent to Linux kernel
style, which should be pretty close to pimd & ldpd.
David Lamparter [Thu, 15 Dec 2016 23:14:55 +0000 (00:14 +0100)]
tests: fix mis-fixed format string
PRIu64 is "u", we need "x", so PRIx64...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Cc: Donald Sharp <sharpd@cumulusnetworks.com>
[cherry-picked from master eed831e065694b3746896b126f6ad47548ea9dc0]
David Lamparter [Fri, 13 Jan 2017 10:23:18 +0000 (11:23 +0100)]
tests: ignore stderr for expect
expect redirects both stdout and stderr to its input. This causes
serious problems when libzebra prints log messages to stderr, which are
then asynchronously inserted in the middle of lines of stdout test
output. Ultimately this makes testbgpmpattr fail on FreeBSD.
(The stdio buffering seems to be slightly different on FreeBSD,
triggering the bug.)
Just ignore stderr for expect.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Introduce internal and IANA defintions for AFI/SAFI and mapping
functions and modify code to use these. This refactoring will
facilitate adding support for other AFI/SAFI whose IANA values
won't be suitable for internal data structure definitions (e.g.,
they are not contiguous).
The commit adds some fixes related to afi/safi testing with 'make check
' command.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Ticket: CM-11416
Reviewed By: CCR-3594 (mpls branch)
Testing Done: Not tested now, tested earlier on mpls branch
Lou Berger [Fri, 6 Jan 2017 15:50:31 +0000 (10:50 -0500)]
bgpd: restore some missing afi/safi commands (Issue #14)
Added defines and parse utility functions
Fix vty code that treated vpn&encap as AFIs
and some other related vty printing/handline issues
Note: Includes branch specific changes (due to new parser)
Lou Berger [Fri, 6 Jan 2017 15:50:31 +0000 (10:50 -0500)]
bgpd: restore some missing afi/safi commands (Issue #14)
Added defines and parse utility functions
Fix vty code that treated vpn&encap as AFIs
and some other related vty printing/handline issues
Julien Courtat [Tue, 17 May 2016 14:26:22 +0000 (16:26 +0200)]
bgpd: configure preserve forwarding state from vty
Preserve forwarding state bit can be set in OPEN message with the use of
new vty commands
bgp graceful-restart preserve-fw-state
no bgp graceful-restart preserve-fw-state
This must be set before activating the connection to a peer, since it is
for forging graceful restart capability of OPEN messages.
Julien Courtat [Fri, 20 May 2016 10:10:07 +0000 (12:10 +0200)]
bgpd: enable send of Graceful Restart Preserve State F bit
Enhance struct bgp to add a new flag BGP_FLAG_GR_PRESERVE_FWD, which
allow to set the Preserve State F bit of Graceful Restart capability in
OPEN messages.
Donald Sharp [Thu, 5 Jan 2017 17:52:18 +0000 (12:52 -0500)]
ospfd: Stop attempt to read beyond end of argv
When unconfiguring certain commands in ospf, you can
run into situations where we attempt to read beyond
the end of a argv[] vector created. On certain platforms
this will crash it.
Ticket: CM-14090 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 5 Jan 2017 17:44:23 +0000 (12:44 -0500)]
lib: Stop potential uninitialized memory access
VRF_UNKNOWN = MAX_INT16_T
The vrf macros to determine where in the bitmap something belongs
assume that the valid values of a vrf are 0 - (MAX_INT16 - 1)
so when they attempt to determine where to look in the bitmap
for VRF_DEFAULT, we can get invalid reads of memory.
This happens because bgp can create vrf's with VRF_UNKNOWN
when we get configuration for a vrf before we've been actually
created in zebra.
Ticket: CM-14090 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Olivier Dugeon [Tue, 20 Dec 2016 14:02:34 +0000 (15:02 +0100)]
Rationalize Link Parameters flags
* lib/if.h: Remove LP_TE as Link Parameters is set if different from 0
See IS_LINK_PARAMS_SET macro and use LP_TE_METRIC to determine if TE metric
is set or not
* lib/if.c: replace LP_TE by LP_TE_METRIC in default LP status
* zebra/interface.c: replace LP_TE by LP_TE_METRIC and check if TE metric
is equal to standard metric or not
* ospfd/ospf_te.c: replace LP_TE by LP_TE_METRIC
* isisd/isis_te.c: replace LP_TE by LP_TE_METRIC