zebra/ioctl_solaris: Fix use of prefix2str in if_prefix_add/delete_ipv6First argument of prefix2str pointed to ifc->address->prefix, but
no prefix exists in address. Should have been ifc->address.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
build: make libraries self-reliantlibospf and libospfclient both need libzebra, so they should link
against it. The days of libtool propagating upwards such dependencies
are nearing their end...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
pimd: use IPPROTO_IP (not SOL_IP) for IP_PKTINFOSolaris uses the same socket API for IP_PKTINFO as Linux, but doesn't
have a SOL_IP define.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
build/solaris: drop duplicate __EXTENSION__ define__EXTENSION__ is already defined in config.h by autoconf; drop the
duplicate from zebra.h.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
*: make sure zebra.h is always included firstzebra.h pulls in config.h, which results in fiddling with things like
__FILE_OFFSET_BITS. It must always be included first, in order to set
flags that influence the compiler via <features.h>.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd: 'set comm-list delete' stops as soon as it hits a community-list entry with a deny'set comm-list delete' stops as soon as it hits a community-list entry with
a deny
Reviewed By: sharpd@cumulusnetworks.com
Testing Done:
'set comm-list FOO delete' stops evaluating the community-list as soon as
we hit
the first "delete" statement. This makes it impossible to use
community-lists
where you deny some subset of communities to delete and then permit all of
the
others.
This patch ...
bgpd: If route-map does not exist DENY for redistribute statementsUpon usage of a route-map statement in bgp, if the route-map does not exist
it turns into a implicit ALLOW, this causes issues in a wide variety
of scenarios.
Without this fix:
!
router bgp 100
bgp router-id 10.0.2.15
redistribute static route-map FOOEY
!
ip route 33.33.33.33/32 eth1
ip route 44.44.44.44/32 eth1
!
Now look at show ip bgp:
show ip bgp:
Network Next Hop ...
Fixed if_add_update possible null dereferenceCoverity Scan #1221454
In zebra/interface.c if_data could be null dereferenced without early
check.
Signed-off-by: Morgan Stewart <morgan@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd: Fix compile warning (error with Werror) on BSD* ioctl commands can vary in type between systems, cast to an unsigned long
before passing to format command.
pimd: Remove stdout zlog changesQuagga start has unnecessary pim messages to stdout. Causing some confusion.
Logging is already saving this information in pimd.log
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd: Fix leaked fdWhen caling pim_sock_open if the failure cause happens, however
unlikely, don't leak the fd on failure.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra: Fix leaked sockets in rtadv.cCoverity Scan #709790
In zebra/rtadv.c: rtadv_make_socket leaks socket for error cases.
Added lines to close the socket for each error case or return.
Signed-off-by: Morgan Stewart <morgan@cumulusnetworks.com>
zebra: rib->nexthop_num is double incrementedWhile reading linux kernel netlink messages, rib->nexthop_num is incremented
in the read loop as well as the underlying nexthop_add() function call. This
number should only be incremented in one spot. Removing the increment from
the read loop and allowing the underlying code to track this data as it is
already.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra: fix addr sent in ZEBRA_IPV6_NEXTHOP_LOOKUPI found that zebra doesn't set correct IPv6 address in its result because of
using *addr's address. Although I'm using 0.99.22, the latest version has
also use "&addr". Shouldn't it use "addr"?
Signed-off-by: Hiroshi Yokoi <hiroshi.yokoi.0313@gmail.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
vtysh: allow --with-libpam to build with --enable-werrorThe function vtysh_pam fails the build with --enable-werror enabled
because it is a static function not declared as such
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vtysh: Add missing show thread/work-queues commands'show thread cpu ..' and 'show work-queues' are missing
from vtysh, but are available from telnet.
This commit adds these commands to the vtysh interface.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vrf: add a runtime check before playing with netnsThis patch adds a runtime check to determine if netns are available. Some
systems like OpenWRT have the system call setns() but don't have the kernel
option CONFIG_NET_NS enabled.
Reported-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Christian Franke <chris@opensourcerouting.org>
build/arm: Arm compilation warning fixThe arm cross compiler is issuing warnings for signed/unsigned
comparisons for ntohs. ntohs returns a unsigned int, while
the counting variables are signed. Fixed to allow -Werror
to work properly
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib: Remove unused 'show memory XXX' functionalityThe 'show memory XXXX' functionality is not used at all.
This removes the unused code
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib: Fix Free Pointer dereference in lib/filter.cCoverity Scan ID 23056. access is accessed after free in access_list_delete
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
lib/zclient: Consolidate error reporting for zclient_read_headerAll functions that call zclient_read_header immediately turn around
and check to ensure that the version and marker fields are correct
Move this code into zclient_read_header
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/command: Fix optional arguments with description interactionsIf you have a cli like this:
"neighbor WORD interface {v6only}"
When in the cli you hit ? after entering v6only you get this:
tor-11(config-router)# neighbor swp1 interface v6only
% There is no matched command.
tor-11(config-router)# neighbor swp1 interface v6only
With this fix we now see:
tor-22(config-router)# neighbor swp1 interface v6only
<cr>
tor-22(config-router)# neighbor swp1 inter...
build: Enable vtysh and pimd as part of default buildThe default build needs vtysh and pimd as a default build so
that when a change is made we can catch build issues before they
become a problem.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Fix 'struct peer' memory leakspeer_delete has been written to handle the peer->group pointer and
to remove the peer from the peer group if it exists upon deletion being
called. Shutdown/deletion Code was intentionally setting the peer-group
to NULL prior to calling peer_delete. This leaked the memory associated
with the peer->group because of refcnt accounting.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Add some peer_lock/unlock debug codeFinding memory leaks associated with the peer data structure
is incredibly hard, add some code to allow you to find this
leaked code when needed.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Warn user that bgp is setting maximum-paths larger than MULTIPATH_NUMIn cases where a distribution has compiled zebra with a MULTIPATH_NUM
that is less than what the user is setting the maximum-paths in bgp,
warn them that some of the nexthops will not make it into zebra and
by extension the kernel for routing. The command is still accepted.
dell-s6000-02(config)# router bgp 100
dell-s6000-02(config-router)# maximum-paths 3
% Warning: maximum-paths set to 3 is...
bgpd: Fix small memory leak in str2prefix_rdstr2prefix_rd has a memory leak. This commit fixes that issue
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Remove unnecessary stream_dup callsBGP packet handling creates a stream to handle data for an outgoing packet.
In some cases the code would create a new stream, add data, then duplicate
the stream and then free the original stream. This change removes
the unnecessary duplication, which entails a malloc and memcpy.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Fix memory leak in bgpd/bgp_route.cIn function bgp_aggregate_add, variables 'aspath' and 'community'
are malloced but not guaranteed to be freed before the function
returns.
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
bgpd: Variable reuse in bgpd/bgpd.cIn bgp_delete(), variables 'node' and 'next' are overwritten in
the nested for loop.
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: Fix useless call in bgpd/bgp_mplsvpn.cCoverity scan ID : 1302528. Calling "decode_label(pnt)" is only useful for its return value, which is
ignored. Removed the call.
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
bgpd: Addition of "show ip bgp dampening" command treeThis patch addresses David's comments and contains:
1.Addition of show ip bgp dampening command tree
2.Addition of show ip bgp dampening parameters to display BGP dampening
parameters.
Signed-off-by: Balaji.G <balajig81@gmail.com>
bgpd: Make bgp_info_cmp robust to paths that do not have su_remote infoMy original su_remote == NULL check is not correct. It seems that
* bgp_route.c: (bgp_info_cmp) Some bgp_info is compared with su_remote=NULL
and it's supposed to be perfectly legal. E.g. configured subnet announces
("network a.b.c.d/n"). Ensure bgp_info_cmp is robust if such a path gets
as far as the neighbour address comparison step.
build/lib: Check for and include stdbool.h by default* stdbool.h should be widely supported by now, and the 'bool' type makes
more semantic sense than an integer type for boolean values.
bgpd: Fix race in clearing completionWhen a peer that is Established goes down, it is moved into the Clearing
state to facilitate clearing of the routes received from the peer - remove
from the RIB, reselect best path, update/delete from Zebra and to other
peers etc. At the end of this, a Clearing_Completed event is generated to
the FSM which will allow the peer to move out of Clearing to Idle.
The issue in the code is that there...
bgpd: Only use routes from Established peers for best path selectionEnsure that routes from a peer are not considered for best path
comparison if the peer is not in an Established state. There can
be a window between a peer being deleted and the background
thread that actually clears the routes (marks them as "removed")
runs during which best path may run. If this path selection
compared two prefixes all the way down to peer IP addresses and
one of these two pe...
bgpd: Ignore stale entry candidates during bestpath selection.During best path selection, if one of the candidates is a stale entry, do not
perform the neighbor address comparison as that information is invalid for
the stale entry. Attempting to perform the comparison results in a bgpd
exception.
Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>