| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Use new BFD API to integrate with OSPFv2.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
|
|
|
|
|
|
| |
Stop using inet_ntoa, use %pI4 etc or inet_ntop instead
Signed-off-by: Mark Stapp <mjs@voltanet.io>
|
|
|
|
|
|
|
|
| |
Create appropriate accessor functions for the rn->lock
data. We should be accessing this data through accessor
functions since it is private data to the data structure.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
|
|
|
|
|
|
|
| |
Description:
1. Graceful restart helper init/de-init.
2. Defining dedicated memory for helper.
Signed-off-by: Rajesh Girada <rgirada@vmware.com>
|
|
|
|
|
|
|
|
|
|
| |
We test nbr->oi in a couple of places for null, but
in the majority of places of the nbr->oi data is being
used we just access it. Touch up code to trust this
assertion and make the code more consistent in others.
Found in Coverity.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
Use a local variable to avoid trying to take the address
of a packed struct member - an address from the ip header
in these cases.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
|
|
|
|
| |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
If we detect we already have a neighbor, no need to
re-add so no need to warn since we do not do anything with
the data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Lou Berger <lberger@labn.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Remove assert in path of router_id_update:
Upon configuring same router-id as neighbor's
assert would cause a crash. Log a warning message
and neighborship would not come up.
Address memory leaks
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
| |
This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276.
clang 5 is not widely available enough for people to indent with. This
is particularly problematic when rebasing/adjusting branches.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
w/ clang 5
* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
|
|
|
|
|
|
| |
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header. (The style with * at the beginning won out with
580 to 141 in existing files.)
Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
| |
HAVE_OPAQUE_LSA is used by default and you have to actively turn it off
except that OPAQUE_LSA is an industry standard and used pretty much
everywhere. There is no need to have special #defines for this anymore.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 36fef5708d074a3ef41f34d324c309c45bae119b)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upon router-id change, one object that needs to be updated is the "nbr_self"
structure that is created to contain information about the local router and
is used during DR election, among other things. In the past, the code used to
just change the router-id field of this structure. This is actually not
sufficient - the neighbor has to be deleted and re-added into the tree. This
was fixed upstream and the fix is now available in our tree, but those changes
don't work well with prior Cumulus changes to defer updating the router-id
in the OSPF instance until other cleanup has happened.
Fixed code to update the "nbr_self" structure correctly while continuing to
defer the router_id update in the OSPF structure.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11861
Reviewed By: CCR-4980
Testing Done: Manual, failed test
|
|
|
|
|
|
|
|
|
|
| |
With commit 1b31375427008aaf980f68d95f50007f600c8ae1
we have a situation where it is possible that the
oi->nbr_self has not been properly set. When
calling the function that sets the nbr_self data
make sure that we have a pointer that works for it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ospfd keeps a list of neighbor routers for each configured interface. This
list is indexed using the neighbor router id in case of point-to-point and
virtual link types, otherwise the list is indexed using the neighbor's
source IP (RFC 2328, page 96). The router adds itself as a "pseudo" neighbor
on each link, and also keeps a pointer called (nbr_self) to the neighbor
structure. This takes place when the interface is first configured. Currently
ospfd adds this pseudo neighbor before the link parameters are fully configure,
including whether the link type is point-to-point or virtual link. This causes
the pseudo neighbor to be always indexed using the source IP address regardless
of th link type. For point-to-point and virtual links, this causes the lookup
for the pseudo neighbor to always fail because the lookup is done using the
router id whereas the neighbor was added using its source IP address.
This becomes really problematic if there is a state change that requires a
rebuild of nbr_self, changing the router id for example. When resetting
nbr_self, the router first tries to remove the pseudo neighbor form its
neighbor list on each link by looking it up and resetting any references to it
before freeing the neighbor structure. since the lookup fails to retrieve any
references in the case of point-to-point and virtual links the neighbor
structure is freed leaving dangling references to it. Any access to the
neighbor list after that is bound to stumble over this dangling pointer
causing ospfd to crash.
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Tested-by: NetDEF CI System <cisystem@netdef.org>
(cherry picked from commit bb01bdd740339b0c07d8ed0786811801b2a79192)
|
|
|
|
|
|
|
|
| |
According to RFC 2328, section 10.5 PointToPoint neighbors
should be identified by router ID instead of source IP address.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
(cherry picked from commit 5c1791f28e2e831e4e9b92c3c2f7d8ed832cb968)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.c: (ospf_if_cleanup) moved code to ospf_nbr_self_reset
* ospfd.c: (ospf_router_id_update) Use ospf_nbr_self_reset instead of doing
the reset badly, fixing 94266fa822ba.
(cherry picked from commit c920e510d09c6c4ab63a3da5375009442a950f82)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ticket:CM-6802, CM-6952
Reviewed By: Donald, Kanna
Testing Done:
Double commit of b76943235e09472ec174edcf7204fc82d27fe966 from br2.5. But, manually resolved all the compilation errors. Also, modified the shows to support the json format which was not supported in br2.5.
CM-6802 – Currently, BFD session status can be monitored only through ptmctl. There is no way to check the BFD status of a peer/neighbor through Quagga. Debugging becomes easier if BFD status is shown in Quagga too. BFD status is relevant when it is shown against the BGP peer/OSPF neighbor. For, this following code changes have been done:
- Only down messages from PTM were being propagated from Zebra daemon to clients (bgpd, ospfd and ospf6d). Now, both up and down messages are redistributed to the clients from zebra. BFD status field has been added to the messaging. Handling of BFD session up messages has been added to the client code. BGP/OSPF neighbor is brought down only if the old BFD session status is ‘Up’ to handle extra/initial down messages.
- BFD status and last update timestamp fields have been added to the common BFD info structure. Also, common show functions for showing BFD information have been added to BFD lib.
- Modified the BGP neighbor show functions to call common BFD lib functions.
- For ospf and ospf6, BFD information was maintained only at interface level. To show BFD status per neighbor, BFD information has been added at neighbor level too. “show ip ospf interface”, “show ip ospf neighbor detail”, “show ipv6 ospf6 interface” and “show ipv6 ospf6 neighbor detail” output have been modified to show BFD information.
CM-6952 - IBGP peers were always assumed to be multi-hop since there was no easy way to determine whether an IBGP peer was single hop or multihop unlike EBGP. But, this is causing problem with IBGP link local peers since BFD doesn't allow multihop BFD session with link local IP addresses. Link local peers were discovered when the interface peering was enabled. Interface peering is always singlehop. So, added checks to treat all interface based peers as single hop irrespective of whether the peer is IBGP or EBGP.
|
|
|
|
| |
Simple conversion of XMALLOC/memset to XCALLOC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2006-04-03 Paul Jakma <paul.jakma@sun.com>
* (general) Fix issues with handling of Vlinks and entries
in the nbrs route-table which were highlighted by the
nsm/nbr_self fixes from bug #234. Many thanks to Juergen
Kammer for his help and efforts in testing out debug patches to
pinpoint the issue.
* ospf_interface.c: (ospf_vl_new) Add nbr_self for Vlink.
* ospf_neighbor.c: (ospf_nbr_key) new static function, helper
to create key in nbrs table for a given nbr.
(ospf_nbr_delete) Use ospf_nbr_key. Add an assert() to
document an expected state.
(ospf_nbr_add_self) Ditto.
(ospf_nbr_lookup_by_addr) Add an assert.
* ospf_nsm.c: (nsm_kill_nbr) Can never kill the nbr_self
psuedo-neighbour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2006-01-10 Len Sorensen <lennartsorensen@ruggedcom.com>
* (general) Bug #234, see also [quagga-dev 3902].
Fix problem with nbr_self not being properly reinitialised
when an interface comes up, after having been down.
Some re-arrangement done by Paul Jakma, any bugs introduced
on top of Len's suggested changes are his.
* ospf_neighbor.c: (ospf_nbr_add_self) centralise
initialisation of nbr_self parameters here.
* ospf_interface.c: (ospf_if_new) deleting initialisation of
parameters of nbr_self, just rely on call to
ospf_nbr_add_self.
(ospf_if_cleanup) ditto.
* ospfd.c: (ospf_network_run) ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* (general) extern and static qualifiers added.
unspecified arguments in definitions fixed, typically they should
be 'void'.
function casts added for callbacks.
Guards added to headers which lacked them.
Proper headers included rather than relying on incomplete
definitions.
gcc noreturn function attribute where appropriate.
* ospf_opaque.c: remove the private definition of ospf_lsa's
ospf_lsa_refresh_delay.
* ospf_lsa.h: export ospf_lsa_refresh_delay
* ospf_packet.c: (ospf_make_md5_digest) make *auth_key const,
correct thing to do - removes need for the casts later.
* ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's
home-brewed versions, shuts up several warnings.
* ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and
VTY_GET_IPV4_PREFIX moved to lib/vty.h.
* ospf_zebra.c: (ospf_distribute_list_update_timer) hacky
overloading of the THREAD_ARG pointer should at least use
uintptr_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* (global): Fix up list loops to match changes in lib/linklist,
and some basic auditing of usage.
* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
* HACKING: Add notes about deprecating interfaces and commands.
* lib/linklist.h: Add usage comments.
Rename getdata macro to listgetdata.
Rename nextnode to listnextnode and fix its odd behaviour to be
less dangerous.
Make listgetdata macro assert node is not null, NULL list entries
should be bug condition.
ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
with for loop, Suggested by Jim Carlson of Sun.
Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
"safety" of previous macro.
LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
distinguish from the similarly named functions, and reflect their
effect better.
Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
with the old defines which were modified above,
for backwards compatibility - guarded to prevent Quagga using it..
* lib/linklist.c: fix up for linklist.h changes.
* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
scan of the area list, rather than scanning all areas first for
INTER_ROUTER and then again for INTER_NETWORK. According to
16.2, the scan should be area specific anyway, and further
ospf6d does not seem to implement 16.3 anyway.
|
|
|
|
| |
* *.c: Change level of debug messages to LOG_DEBUG.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ospf_packet.c: (ospf_associate_packet_vl) cleanup, move
some of the checks up to ospf_read, return either a
virtual link oi, or NULL.
(ospf_read) Cleanup, make it responsible for checks. Remove
the nbr lookup - moved to ospf_neighbor. Adjust all nbr
lookups to use new wrappers exported by ospf_neighbor.
* ospf_neighbor.h: Add ospf_neigbour_get and ospf_nbr_lookup.
* ospf_neighbor.c: (ospf_neigbour_get) Index ospf_interface
neighbour table by router-id for virtual-link ospf_interfaces,
not by peer_addr (which breaks for asymmetric vlinks)
(ospf_nbr_lookup) add a wrapper for nbr lookups to deal with
above.
|
|
|
|
|
|
|
|
| |
* sync to latest zebra CVS
* spec file: updated and added define for ospf-api/client
NB: OSPF-API has been broken by the zebra.org changes, which
has added struct ospf * as a new arg to many functions
|
|
Date: Fri, 20 Dec 2002 17:58:43 +0900
From: Masahiko Endo <endo@suri.co.jp>
Reply-To: zebra@zebra.org
To: zebra@zebra.org
Cc: kunihiro@zebra.org
Subject: [zebra 16824] [PATCH] nsm_kill_neighbor
[ The following text is in the "ISO-2022-JP" character set. ]
[ Your display is set for the "ISO-8859-1" character set. ]
[ Some characters may be displayed incorrectly. ]
Hi Ishiguro-san,
Here is my problem analysis against the case that the ospfd crashes
when an interface is brought down.
When the ospfd receives a ZEBRA message "ZEBRA_INTERFACE_DOWN" from
zebra daemon, the ospfd performs bunch of ospf-interface cleanup for
the notified zebra-interface.
There are cases that neighbor instance "nbr", which will be removed
afterward, may scheduled in the NSM thread event queue. And when the
NSM event thread is fired, dereference for this already freed "nbr"
pointer causes SIGSEGV.
Please take a look at following timeline of processing sequences.
|