summaryrefslogtreecommitdiff
path: root/pimd/pim_msdp.c
AgeCommit message (Collapse)Author
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
This is causing build issues on BSD by including (transitively) `linux/mroute6.h` - try to address by disentangling the headers a bunch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-06pim6d: Adjust mrib_nexthop_addr msdp codesarita patra
In this PR, we are handling the msdp code after mrib_nexthop_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-08Merge pull request #10292 from opensourcerouting/pim6-addr-auxDonald Sharp
pimd: start tackling IPv6 address operations
2022-01-18pimd: remove redundant header includeMobashshera Rasool
Removing redundant header inclusion of pim_cmd.h Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-17pimd: remove PIM_INADDR_IS[NOT]_ANY macrosDavid Lamparter
These really don't serve much of a purpose, especially with how inconsistently they're used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: deploy pim_sgaddr_* helpersDavid Lamparter
Use _cmp/_hash/_match helpers for operations on pim_sgaddr to prepare IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move & deploy pim_addr_cmp() helperDavid Lamparter
Comparing `s_addr` isn't cutting it for IPv6 support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: move, rename and deploy pim_addr_is_any()David Lamparter
Replaces comparison against INADDR_ANY, so we can do IPv6 too. (Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and type fixed to bool.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_dump()David Lamparter
... and replace with `%pSG` printfrr specifier. This actually used a static buffer in the formatting function, so subsequent formatting would overwrite earlier uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17pimd: remove pim_str_sg_set()David Lamparter
... and replace with `%pSG` printfrr specifier. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-08pimd: fix msdp mesh grp with wildcard member addrChirag Shah
frr-reload fails to recognize wildcard "*" for member address in frr.conf/runing-config as cli syntax expects in v4 address format. Ticket: #2816923 Testing: Without fix: running config: ip msdp mesh-group foo1 member * Frr reoad failure log: 2021-11-02 11:05:04,317 INFO: Loading Config object from vtysh show running line 5: % Unknown command: ip msdp mesh-group foo1 member * Traceback (most recent call last): File "/usr/lib/frr/frr-reload.py", line 1950, in <module> With fix: -------- running config displays: ip msdp mesh-group foo1 member 0.0.0.0 Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-09-21pimd: Prevent uninited usage of nexthopDonald Sharp
pim_msdp_peer_rpf_check creates an nexthop to do a rpf search against and doesn't initialize it sucht that the pim_nexthop_lookup function is making decisions against the nexthop just created that was uninitialized. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28pimd: fix missing list remove when deleting mesh groupIgor Ryzhov
This leads to a crash when you use "show run" after deleting the group. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-01pimd: support MSDP global timers configurationRafael Zalamena
Users can now configure: * Hold time * Keep alive * Connection retry Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: make function names consistentRafael Zalamena
Rename functions (`pim_msdp_peer_new` => `pim_msdp_peer_add` and `pim_msdp_peer_do_del` => `pim_msdp_peer_del`) to keep consistency and update the `pim_msdp_peer_add` documentation to tell users that this is also used for non meshed group peers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: allow MSDP group name 'default'Rafael Zalamena
Don't assign a default group name for non meshed group peers, instead use a flag. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: rework MSDP northbound integrationRafael Zalamena
Simplify the MSDP handling functions and allow source changes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09pimd: rename some MSDP functionsRafael Zalamena
Rename and shorten function names to make them uniform. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09pimd: rework MSDP mesh-group codeRafael Zalamena
Fully utilize the northbound to hold pointers to our private data instead of searching for data structures every time we need to change a configuration. Highlights: * Support multiple mesh groups per PIM instance (instead of one) * Use DEFPY instead of DEFUN to reduce code complexity * Use northbound private pointers to store data structures * Reduce callback names size Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-03pimd: show MSDP configurationRafael Zalamena
Display the MSDP peer configuration in `show running-config` so it can be saved on configuration write. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-10-06pimd: MSDP SA forwardingAdriano Marto Reis
* If the MSDP peer receives the SA from a non-RPF peer towards the originating RP, it will drop the message. * SA messages are forwarded away from the RP address only. * SA messages are not forwarded within the mesh group. * Preventing the MSDP connection from being dropped due to RPF check failure (RFC3618, section 13 "MSDP Error Handling") Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com> Signed-off-by: Adriano Reis <areis@barrukka.local>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13pimd: added no ip msdp mesh-group <word>Sarita Patra
Issue: no ip msdp mesh-group <word> source command deleting the mesh group, which might be used by the member. Solution: no ip msdp mesh-group <word> source command, deletes the mesh-group source. Add a new cli command "no ip msdp mesh-group <word>" to delete the mesh group. Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-04*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-03pimd: Convert the upstream_list and hash to a rb treeDonald Sharp
Convert the upstream_list and hash to a rb tree, Significant time was being spent in the listnode_add_sort. This reduces this time greatly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-15pimd: fixup JD macro to use "peer-msdp-sa" check instead of I_am_RP checkAnuradha Karuppiah
JD macro is defined by the RFC as - bool JoinDesired(S,G) { return (immediate_olist(S,G) != NULL OR (KeepaliveTimer(S,G) is running AND inherited_olist(S,G) != NULL)) } However for MSDP synced SA the KAT will not be running so an exception is needed. Earlier I had done this by relaxing KAT_run requirements entirely on the RP. However as that prevents the source from being aged out in some cases I have made the check more narrow i.e. has to an MSDP peer added entry. Ticket: CM-24398 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15pimd: replace direct accesses to t_ka_timer with a kat_running macroAnuradha Karuppiah
No functional change, simple cleanup to improve readability Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-05-29pimd: strcpy -> strlcpyQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-01-04pimd: Remove pim_msdp_config_write as it was never usedDonald Sharp
This function was never used, additionally rename the _helper function to this name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-25*: spelchekDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-19*: Replace hash_cmp function return value to a boolDonald Sharp
The ->hash_cmp and linked list ->cmp functions were sometimes being used interchangeably and this really is not a good thing. So let's modify the hash_cmp function pointer to return a boolean and convert everything to use the new syntax. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-02*: list_delete_and_null() -> list_delete()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14pimd: Convert over to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, the zlog_err functions to zlog_ferr for the LIB_ERR_XXX enums Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-02pimd: Cleanup msdp.mg on shutdownDonald Sharp
When shutting down PIM, ensure that hte pim->msdp.mg is cleaned up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-02pim: Clean up some data on shutdown in msdpDonald Sharp
We were leaking some msdp hash backets and a msdp stream data pointer on shutdown. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-08pimd: Remove unnecessary alloc failuresDonald Sharp
Remove from pim unnecessary alloc failure testing as that alloc failure will cause an assert. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30pimd: hash_get w/ hash_alloc_intern cannot failDonald Sharp
The assignment of sa with the usage of hash_get and hash_alloc_intern can never fail. No need to look for a failure case. Found by Coverity SA. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-11pimd: Cleanup msdp shutdownDonald Sharp
Shutdown pim msdp code a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-01pimd: Fix some msdp crashes when some fundamentals changeDonald Sharp
When the underlying networking subsystem is fundamentally changed via some system controls. If we have msdp running there exists a possibility that we need to stop some running timers to prevent a crash. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05*: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp
Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02pimd: Squash some more memory leaksDonald Sharp
When a interface is flapped we were leaking some memory associated with link lists. Especially in the jp_agg code. If your network was/is stable and you are not running at any scale you probably would not see this as impactful at all. Ticket: CM-16392 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>