summaryrefslogtreecommitdiff
path: root/pimd/pim_igmp_mtrace.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 igmp_mtrace codesarita patra
In this PR, we are handling the igmp_mtrace code after mrib_nexthop_addr modified from prefix to pim_addr. Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-13pimd: Add IGMP join sent/failed statisticsDonatas Abraitis
``` exit1-debian-11# sh ip igmp statistics IGMP statistics Interface : global V1 query : 0 V2 query : 0 V3 query : 0 V2 leave : 0 V1 report : 0 V2 report : 0 V3 report : 16 mtrace response : 0 mtrace request : 0 unsupported : 0 joins failed : 0 joins sent : 11 total groups : 4 total source groups : 0 exit1-debian-11# sh ip igmp statistics json { "global":{ "name":"global", "queryV1":0, "queryV2":0, "queryV3":0, "leaveV3":0, "reportV1":0, "reportV2":0, "reportV3":16, "mtraceResponse":0, "mtraceRequest":0, "unsupported":0, "totalGroups":4, "totalSourceGroups":0, "joinsFailed":0, "joinsSent":11 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-01-17pimd: add PIMADDR_ANY & tackle assignmentsDavid Lamparter
Need a separate constant that is IPv6 when needed. Also assign the whole struct rather than just s_addr. 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-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-12-03pimd: Modifying struct igmp_sock to gm_sock for IPv6Sai Gomathi
Modifying name of struct igmp_sock to struct gm_sock, which is to be used by both IPv4 and IPv6(for both MLD and IGMP). Co-authored-by: Mobashshera Rasool <mrasool@vmware.com> Co-authored-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2021-11-17*: clean up ifp-by-local-address function(s)David Lamparter
Most users of if_lookup_address_exact only cared about whether the address is any local address. Split that off into a separate function. For the users that actually need the ifp - which I'm about to add a few of - change it to prefer returning interfaces that are UP. (Function name changed due to slight change in behavior re. UP state, to avoid possible bugs from this change.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-12pimd: Remove pim->vrf_id and use pim->vrf->vrf_idDonald Sharp
VRF creation can happen from either cli or from knowledged about the vrf learned from zebra. In the case where we learn about the vrf from the cli, the vrf id is UNKNOWN. Upon actual creation of the vrf, lib/vrf.c touches up the vrf_id and calls pim_vrf_enable to turn it on properly. At this point in time we have a pim->vrf_id of UNKNOWN and the vrf->vrf_id of the right value. There is no point in duplicating this data. So just remove all pim->vrf_id and use the vrf->vrf_id instead since we keep a copy of the pim->vrf pointer. This will remove some crashes where we expect the pim->vrf_id to be usable and it's not. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-15pimd: Fix clang issue with -Waddress-of-packed-memberDonald Sharp
Recent change in commit: 6b73800ba27e7f69453a191dfb873c2e07194516 Caused this error to pop up in pim_igmp_mtrace.c: error: taking address of packed member 'rsp_addr' of class or structure 'igmp_mtrace' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] Follow the pattern used in the code to solve this problem for clang Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-14*: fix printf extension typesDavid Lamparter
Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-14pimd: Use builtin printf functionalityDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-23pimd: replace some zlog_warn with zlog_debugMark Stapp
A pim module had a number of warnings being used instead of debugs - use debugs. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23pimd: avoid possible unaligned pointerMark Stapp
Use inet_ntop instead of %pI4 in one place - clang doesn't like the struct's address being taken that way. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22pimd: replace inet_ntoaMark Stapp
Replace all use of inet_ntoa, using %pI4 or inet_ntoa instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-28pimd: don't split format string from zlog callDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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>
2019-12-21pimd: fix missing igmp mtrace length checkQuentin Young
We check that the IGMP message is sufficently sized for an mtrace query, but not a response, leading to uninitialized stack read. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-02pimd: pim_nexthop_lookup should return true/falseDonald Sharp
The current reverse logic led to this code construct if (!pim_nexthop_lookup(...)) { //Do something successfull } This is backwards and will cause logic errors when people use this code. Fix to use true/false for success/failure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-24pimd: Handling Null incoming interface of dummy upstreamSarita Patra
When FRR receives IGMP/PIM (*, G) join and RP is not configured or not reachable, then we are creating a dummy upstream with incoming interface as NULL and upstream address as INADDR_ANY. Added upstream address and incoming interface validation where it is necessary, before doing any operation on the upstream. Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-09-09*: fix some random warningsDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-06-26pimd: return check (Coverity 1465490)paco
Unless someone intentionally changes MCAST_ALL_ROUTERS ("224.0.0.2") with a wrong IP, this should never fail, so the fix is using "(void)" at the left of the function call, as an explicit way of indicating we discard the return value on purpose. Signed-off-by: F. Aragon <paco@voltanet.io>
2018-05-04pimd: show ip igmp statistics commandMladen Sablic
Command showing IGMP Rx statistics, useful for analyzing IGMP activity on interfaces. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-04-24pimd: adding querying of state to mtraceMladen Sablic
Adding to mtracebis querying with group address. Same change to vtysh mtrace command. Support for querying (S,G) and (*,G) state in mtrace router code. Further improvments to mtrace router code with closer complience to IETF draft. More references in comments to the draft. Man page has been updated accordingly. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-23Merge pull request #1957 from qlyoung/fix-mtrace-unaligned-pointer-accessRenato Westphal
pimd: fix unaligned pointer access
2018-03-22Merge pull request #1931 from msablic/pim_mtrace_routerDonald Sharp
pimd: mtrace router code improvments and fixes
2018-03-22pimd: mtrace router code improvments and fixesMladen Sablic
Mtrace router code has been fixed for the case where no PIM interface exists towards the source and next-hop is returned. fwd_ttl is set to one, for correct reporting of mcast ttl. Also, NO_MULTICAST error is returned when there is no PIM. And prev_hop is set to source, for case when connected to source, to help termination of hop-by-hop queries. Dependency of logging on PIM, when sending mtrace packet, has been removed. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-22pimd: fix unaligned pointer accessQuentin Young
Can't take the address of members of packed structures due to potential for alignment faults on some platforms. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-19pimd: Fix leaked fd and prevent null pointer derefDonald Sharp
When the pim_nexthop_lookup fails, close the opened fd as part of the failure condition. Additionally pim_nexthop_lookup assumes that we've actually already looked up a nexthop in the past. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-23pimd: Fix some compiler issuesDonald Sharp
Fix some compiler issues that were not picked up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-19pimd: Multicast traceroute client and routerMladen Sablic
This commit is the implementation of weak multicast traceroute. It consists of IGMP module dealing with mtrace type IGMP messages and client program mtrace/mtracebis for initiating mtrace queries. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>