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>
ospfd: trap on state change seems to send incorrect value for ospfNbrStateThe ospfNbrState in the ospf trap sent from ospfd shows an incorrect state.
For example, when the connection goes down, the ospfNbrState in the trap is
sent as '8' (full). When the connection is reestablished, the state is sent
as '7' (loading).
The reason seems to be that the trap is sent from nsm_notice_state_change()
before the state is actually updated by calling nsm_change_state().
Aft...
ospfd: Fix for 'no' + 'debug command' does not disable 'debug command'"no debug ospf packet all detail" does not cancel "debug ospf packet all detail"
due to the code inconsistency in setting/unsetting debug flags.
* ospf_dump.c: added missing flags.
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd: Fast OSPF convergenceWhen considering small networks that have extreme requirements on
availability and thus convergence delay, the timers given in the OSPF RFC
seem a little “conservative”, i.e., the delay between accepted LSAs and the
rate at which LSAs are sent. Cisco introduced two commands 'timers throttle
lsa all’ and 'timers lsa arrival’, which allow operators to tune these
parameters.
I have been writing ...
ospfd: Fix bug in 94266fa822ba, nbr_self rebuild didn't add valid nbr_self* 94266fa822ba "ospfd: Self nbrs needs to be rebuilt when router ID changes."
deleted the nbr_self, and added it back, but ospf_nbr_add_self doesn't
actually create the nbr_self - it assumes it's already there. Leading
to use after free and crashes after a router-id change.
* ospfd/ospf_neighbor.{c,h}: (ospf_nbr_self_reset) Little helper to reset the
nbr_self correctly.
* ospf_interface...
bgpd/pimd: fix zAPI parsingCommit c99f3481a598 has changed the API. Now, the vrfid has been added in
the header, thus we must read it before parsing the rest of the message.
To ease code maintenance, let's add a new function to read a zAPI header.
Fixes: c99f3481a598 ("*: add VRF ID in the API message header")
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wi...
build: Remove the old PIC/PIE patch, let libtool sort it out* Remove the old change from '08 to add in PIE arguments at automake level.
Versions of libtool since then know how to deal with -fpie and do the right
thing according to whether its building shared or executable objects.
So just pass '-fpie' as CFLAG and let libtool do its thing.
isisd: Attached-bit in LSP headerSet/reset attached-bit in LSP header:
This patch provides support for set/reset attached_bit in the LSP header.
In IS-IS networks, routing inter-area traffic from L1 areas is
accomplished by sending the traffic to the nearest L1/L2 router.
A L1/L2 router identifies itself by setting an attach-bit (ATT-bit) in its (LSP).
The ATT-bit in LSP can be changed using the set-attach...
isisd: Add new adjacency to LSP neighbor listisis_pdu.c :
New adjacency did not always get added to LSP neighbor list.
The adjacencies that were created once minimum time allowed before LSP
retransmission had surpassed, instantly got their LSP regenerated, but
the adjacency circuit type was not set to IIH PDU circuit type before
the LSP was regenerated , hence didn't pass the check for adjacency
circuit type in lsp_build(), and the adjac...
pimd: Create ability to modify hell and hold timers per interfaceCreate new per interface command:
'ip pim hello <1-180> {<1-180>}'
The first number is the Hello Timer for this interface
The second number is the Hold Timer to pass to neighbors on this interface.
The second number is optional.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd: Change ioctl call failure from vty_out to zlog_warnThe command 'show ip multicast' when run, iterates over all interfaces
on the router, if you do not have pim configured on that interface
it would generate an error message:
Interface Address ifi Vif PktsIn PktsOut BytesIn BytesOut
br1 20.0.15.1 7 7 0 0 0 0
swp1 169.254.0.10 3 3 0 0 0 0
swp2 ...
pimd: Ensure new generation_id is different from previousThe RFC states that an interfaces generation_id must be changed
if it experiences an if down. From 4.3.1:
The GenID option contains a randomly generated
32-bit value that is regenerated each time PIM forwarding is started
or restarted on the interface, including when the router itself
restarts.
Since we are only grabbing a new generation_id without comparing
it to the previous generation_id,...
pimd: Stop DR election on every helloThe DR election is occurring on every hello received.
This is because the hello receive packet returns a 0
for any successfully received packet. PIMD then looked
at the 0 returned and did a DR election.
Code was inspected for the cases where DR should happen:
(A) Interface ip address change
(B) DR priority in hello packet changes
(C) Received a new neighbor on an interface
(D) Neighbor timer ...
pimd: Fix first DR ElectionThe function pim_neighbor_new caused the dr election before
the addition of the neighbor to the pim_ifp->pim_neighbor_list,
in pim_neighbor_add, which is needed to properly elect the
correct DR.
Move the dr_election and hello trigger till after the addition
to the list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd: Add ability to set DR Priority for an interfaceFrom RFC 4601, Section 4.3.1:
The DR_Priority Option allows a network administrator to give
preference to a particular router in the DR election process by
giving it a numerically larger DR Priority. The DR_Priority Option
SHOULD be included in every Hello message, even if no DR Priority is
explicitly configured on that interface. This is necessary because
priority-based DR election is only ...
pimd: add support for configuring multicast static routesHi,
This patch adds the ability to configure multicast static routes
directly into pimd. Two source files are introduced to implement the new
feature in addition to changes to existing files.
Here is how it can be used the CLI:
interface <incoming interface>
ip mroute <outgoing interface> <group addr> #
for asm
or ip mroute <outgoing interface> <group addr> <source> ...
Removal of 'show ip mroute'The 'show ip mroute' in zebra_vty.c collided with the
'show ip mroute' command in pim_cmd.c. The 'show ip rpf'
command is functionally equivalent to the zebra_vty.c
'show ip mroute'. Therefore remove the 'show ip mroute' command
in zebra_vty.c.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pim: 'show debugging' collisionThe 'show debugging' cli as setup by pim collided with 'show debugging isis'.
Fix that and clean up cli help commands to actually display correctly.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd: Self nbrs needs to be rebuilt when router ID changes.Some self nbrs are identified by router_id, these needs
to be rebuilt instead of just resetting router ID.
Possibly one could optimize for !(virtual | ptop) links
by doing oi->nbr_self->router_id = router_id instead.
Router ID will change once after startup config has been
read and zebra reports router ID, unless router ID has
been configured in ospf.
pimd assert when no route to source from a new igmp joinWhen pim_upstream_new is called the code looks up the nexthop.
If there is no route to the source, the code silently ignored
the error returned. When the nexthop lookup fails don't create
the 'struct pim_stream *' to return.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add code to extract.pl.in to prevent further cli function overwritesCurrently extract.pl.in is used to build the vtysh cli. When two
different cli's collide with the same command name, the original
cli is never called, because it is dropped. This code notes the
silent drop and tracks the number of drops. If they change then
the code will fail the build. The current number of drops was
figured out by running extract.pl and counting up the drops
then adding c...
pim_mroute.h has a different version of code than linux/mroute.h provideslinux/mroutes.h and pim_mroute.h both have copies of the same structures.
This is causing failures in setsockopt(..., MRT_ADD_MFC,...) because
of data structure incompatibilities between the kernel and what
pim_mroute.h was providing. Modify the code to check for mroute.h
and include it if necessary. I did not modify the non linux/mroute.h
path because I do not have other systems to test on e...
Quagga: Fix code to use srandom/randomQuagga was using a mix of srand/rand and srandom/random.
Consolidate to use srandom/random which are the POSIX
versions of random number generators
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
PIMD: Fix code to use srandom/randompimd rolled it's own solution to random #'s, that was not
terribly random. Rely on the underlying system to generate
random #'s for us
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib, stream: fix stream sanity checksBecause operator "!" has higher priority than "&&",
So we put the "&&" expression in "()" to check both getp and endp.
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: peer_uptime overflows after 1 year* bgpd.c: (peer_uptime) Wraps after 1 year, and doesn't indicate years.
Fix. Assume a year is 365 days, for an easy life.
Fixes: Bug #836
Reported-by: Rolf Hanßen
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib, vtysh: support multiple VRFs by using linux netnsWe realize VRFs with linux netns by default. The main job is
to associate a VRF with a netns. Currently this is done by
the configuration:
[no] vrf N netns <netns-name>
This command is also available in vtysh and goes to only
zebra, because presently only zebra supports multiple VRF.
A file descriptor is added to "struct vrf". This is for the
associated netns file. Once the command "vrf N ...
*: add VRF ID in the API message headerThe API messages are used by zebra to exchange the interfaces, addresses,
routes and router-id information with its clients. To distinguish which
VRF the information belongs to, a new field "VRF ID" is added in the
message header. And hence the message version is increased to 3.
* The new field "VRF ID" in the message header:
Length (2 bytes)
Marker (1 byte)
Version (1 byt...
zebra, lib/memtypes.c: the netlink sockets work per VRFThis patch lets the netlink sockets work per VRF.
* The definition of "struct nlsock" is moved into zebra/rib.h.
* The previous global variables "netlink" and "netlink_cmd" now
become the members of "struct zebra_vrf", and are initialized
in zebra_vrf_alloc().
* All relative functions now work for a specific VRF, by adding
a new parameter which specifies the working VRF, except those
...
zebra: fix VRF code for *BSDThere seems to be no rtm_table in struct rt_msghdr, at least on the
systems I have access to...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra: maintain RTADV per VRFThis moves the global variable "rtadv" into the "struct zebra_vrf",
so that RTADV feature can work per VRF.
* rtadv.c/rtadv.h:
Add a proper parameter to the functions so that the entity of the
"struct zebra_vrf" and interfaces can be obtained from the specified
VRF.
The old rtadv_init() is splitted into:
- rtadv_cmd_init(): it installs the RTADV commands; is called from
...
zebra: add hooks upon enabling / disabling a VRFzebra_vrf_enable() is the callback for VRF_ENABLE_HOOK.
It presently needs do nothing.
zebra_vrf_disable() is the callback for VRF_DISABLE_HOOK.
It presently withdraws routes, shuts down interfaces, and
clears the router-id candidates in that VRF.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind...
lib/vrf: enable / disable a VRFA new API vrf_is_enabled() is defined to check whether a VRF is ready
to use, that is, to allocate resources in that VRF. Currently there's
only one type of resource: socket.
Two new hooks VRF_ENABLE_HOOK/VRF_DISABLE_HOOK are introduced to tell
the user when a VRF gets ready or to be unavailable.
The VRF_ENABLE_HOOK callback is called in the new function vrf_enable(),
which is used to let the...
zebra: maintain the router-id per VRFA router may need different identifier among the VRFs. So move the
maintenance of router-id per VRF.
* rib.h:
Move the previous global variables in router-id.c into the
"struct zebra_vrf":
- struct list _rid_all_sorted_list/*rid_all_sorted_list
- struct list _rid_lo_sorted_list/*rid_lo_sorted_list
- struct prefix rid_user_assigned
* router-id.c/router-id.h:
A new parameter "vrf_...
zebra: configure static routes in any VRFIntroduce new commands to configure static routes in any VRF, by
appending the old static route commands with a new parameter
"vrf N".
A new parameter "const char *vrf_id_str" is added to the functions
zebra_static_ipv4() and static_ipv6_func() to get the configured
VRF ID.
A new member "vrf_id" is added to the "struct static_ipv4" and
"struct static_ipv6", indicating which VRF this static ro...
zebra: lookup the address in all VRFs when set the route-map rule "set src"When configuring the route-map rule "set src A.B.C.D", it checked
whether the source address exists on some interface.
Now it checks the source address throughout all VRFs.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: Da...
zebra: let the route-map rule "match interface" work for VRFsIntroduce a new "struct nexthop_vrfid" to specify a nexthop together
with the VRF ID it belongs to.
Thus in route_match_interface(), we can lookup the interface from
the correct VRF.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-...