Commit Graph

214 Commits

Author SHA1 Message Date
Abhishek N R
bd2c824a21 pim6d: Impelmenting "ipv6 mld join"
Fixes: #12014

Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-04-03 04:05:17 -07:00
Sai Gomathi N
522ec0a924 pim6d: Do not use interfaces with ifindex as 0
After restarting pim6d, in some cases the ifindex is 0 for the interfaces,
so the vif index is also assigned as 0.
This causes the interface name to be pim6reg.

Fix:
If the ifindex is 0 and the interface name is not "pimreg" or "pim6reg",
the function will return without assigning vifindex with an error message.

Issue: #12744

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2023-03-19 22:58:55 -07:00
Donald Sharp
7ae7a3bfd6 pimd: Prevent crash when pimreg already exists.
If the pimreg device exists but it has not been set to the pim->pimreg pointer we can have
a crash.  Just prevent the crash since it's some sort of startup / re-org the network
issue.

(gdb) bt
0  0x00007f0485b035cb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007f0485c0fbec in core_handler (signo=6, siginfo=0x7ffdc0198030, context=<optimized out>) at lib/sigevent.c:264
2  <signal handler called>
3  0x00007f04859668eb in raise () from /lib/x86_64-linux-gnu/libc.so.6
4  0x00007f0485951535 in abort () from /lib/x86_64-linux-gnu/libc.so.6
5  0x00007f0485c3af76 in _zlog_assert_failed (xref=xref@entry=0x55692269b940 <_xref.23164>, extra=extra@entry=0x0) at lib/zlog.c:680
6  0x00005569226150d0 in pim_if_new (ifp=0x556922c82900, gm=gm@entry=false, pim=pim@entry=false, ispimreg=ispimreg@entry=true,
    is_vxlan_term=is_vxlan_term@entry=false) at pimd/pim_iface.c:124
7  0x0000556922615140 in pim_if_create_pimreg (pim=pim@entry=0x556922cc11e0) at pimd/pim_iface.c:1549
8  0x0000556922616bc8 in pim_if_create_pimreg (pim=0x556922cc11e0) at pimd/pim_iface.c:1613
9  pim_ifp_create (ifp=0x556922cc0e70) at pimd/pim_iface.c:1641
10 0x00007f0485c32cf9 in zclient_interface_add (cmd=<optimized out>, zclient=<optimized out>, length=<optimized out>, vrf_id=77) at lib/zclient.c:2214
11 0x00007f0485c3346a in zclient_read (thread=<optimized out>) at lib/zclient.c:4003
12 0x00007f0485c215ed in thread_call (thread=thread@entry=0x7ffdc0198880) at lib/thread.c:2008
13 0x00007f0485bdbbc8 in frr_run (master=0x556922a10470) at lib/libfrr.c:1223
14 0x000055692260312b in main (argc=<optimized out>, argv=0x7ffdc0198b98, envp=<optimized out>) at pimd/pim_main.c:176

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-01 14:56:05 -05:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Sarita Patra
78623256b6 pim6d: Handle IPV6 for "no ipv6 pim"
Issue: #11931

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-11-14 00:17:48 -08:00
Donatas Abraitis
e09ce4b894
Merge pull request #11872 from AbhishekNR/const_igmp_gm
pimd, pim6d: Changing IGMP to GM in few macro's.
2022-09-19 17:48:24 +03:00
Abhishek N R
de5dc09238 pimd, pim6d: Changing IGMP to GM in few macro's.
Changing
IGMP_DEFAULT_ROBUSTNESS_VARIABLE to GM_DEFAULT_ROBUSTNESS_VARIABLE,
IGMP_GENERAL_QUERY_INTERVAL to GM_GENERAL_QUERY_INTERVAL,
IGMP_QUERY_MAX_RESPONSE_TIME_DSEC to GM_QUERY_MAX_RESPONSE_TIME_DSEC and
IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC to GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC
to accomodate both igmp and mld. And moved it to common file.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-18 22:15:19 -07:00
Abhishek N R
b4460a6b33 pim6d: (*,G) mroutes not learnt after pim6d daemon restart
After restart pim dr address was zero due to which pim (*,G) join
could not get propagated towards RP.

While trying to find primary address ll_highest will be zero initially,
since we have not received address from zebra yet.

So we can get the best address at this point and use it as primary address
whenever ll_highest is zero.

Fixes: #11925

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-16 00:42:39 -07:00
Mobashshera Rasool
2ce3c8ec58 pimd: Fix memleak in bfd profile
In function pim_if_delete, pim_ifp->bfd_config.profile needs to be
freed.
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-09-14 10:34:10 -07:00
Sai Gomathi N
95b13dc512 pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTS
Changing the macros to common so that it can be used for pimv6 debugs as well
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-04 22:46:09 -07:00
Donatas Abraitis
b32cf39d45
Merge pull request #11485 from AbhishekNR/ipv6_mld_todo
pim6d: Completing "ipv6 mld" config command.
2022-08-18 09:47:03 +03:00
Mobashshera Rasool
0c7f978ec9 pimd: Simply the code a bit, reduce code complexity
Combine all the if conditions in api pim_if_addr_add_all to
reduce nested loops.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-07-31 23:43:28 -07:00
Mobashshera Rasool
6fe9b9d600 pim6d: clear interface stats on interface shutdown
The clear was happening only for PIMv4. Removed the PIMv4
check.

Fixes: #11628

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-07-18 01:18:16 -07:00
Abhishek N R
5c1b3cd2d9 pim6d: Completing "ipv6 mld" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-07-07 04:36:33 -07:00
sarita patra
4a8336cfa8 pim6d: Handle rpf_addr in pim_if_addr_add()
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:41:47 -07:00
Abhishek N R
4fecac21cb pim6d: Changing igmp_enable to gm_enable.
Modified variable name so that it can be reused in mld.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-27 05:52:02 -07:00
Donald Sharp
9a18e71314
Merge pull request #11475 from patrasar/pim_if_delete
pimd: fix pim interface deletion flow
2022-06-24 14:49:55 -04:00
Sarita Patra
1925ca8f4e pimd: fix pim interface deletion flow
Deletion of pim interface(pim_if_delete) should
do the below things before cleanup.
1. Send a hello message with zero hold time.
2. Delete all the neighbors.
3. Close the pim socket.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-06-24 07:48:03 -07:00
Donald Sharp
668bbbce51
Merge pull request #11355 from patrasar/pim6reg
pim6d: creating pim6reg
2022-06-15 11:29:25 -04:00
Sarita Patra
ee1c4ba977 pim6d: creating pim6reg interface for pim6d
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-06-15 06:10:47 -07:00
sarita patra
2ea34a81df pim6d: Don't enable mld on pimreg interface
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-23 01:24:30 -07:00
Donald Sharp
8a8ad459af
Merge pull request #10775 from opensourcerouting/pim6-mld-pr
pim6d: MLD code
2022-05-17 07:20:08 -04:00
sarita patra
78039cb25d pimd: introduced flags for pim_passive_enable
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:21 -07:00
David Lamparter
5afe22f5bc pim6d: show MLD in running-config
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:02:02 +02:00
David Lamparter
5e5034b0a2 pim6d: add fresh MLD implementation
Fresh ground-up MLD implementation with subscriber-tracking for MLDv2.
Intended to be adapted for IPv4 and replace the IGMP implementation at a
later point.

Tested in ANVL, currently at 94/116.  Some issues/TODOs are left in the
code as CPP_NOTICE markers, but the code is very much good enough to
proceed since otherwise we're blocked on overall PIM v6 progress.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-06 16:01:59 +02:00
Donald Sharp
3819e4ced7 *: Fix spelling of inteface
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:21:31 -04:00
David Lamparter
4f977c8e77 pimd: remove pim_interface->options
I should've removed this in #10960.  It's a hazard in terms of
forgetting to adjust PRs/other changes that might accidentally still
reference the field.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-08 10:30:24 +02:00
David Lamparter
b6fcc0b7a6 pimd: remove useless PIM_IF_* macros
The only function these macros have is to make the code confusing.
"PIM_IF_DO_PIM" sounds like it triggers some action, but it doesn't.

Replace with "bool" fields in struct pim_interface.

(Note: PIM_IF_*_IGMP_LISTEN_ALLROUTERS was always set, without any way
to unset it.  It is completely removed now and always enabled.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-04 14:11:29 +02:00
David Lamparter
b6d9ad298d pim6d: reenable socket functions
pim_sock_*() functions are adapted for IPv6 now, reenable calling them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
da4d4d7b39
Merge pull request #10366 from AbhishekNR/mld_cli 2022-03-28 09:18:36 +02:00
Abhishek N R
fe2df4f7ba pim6d: Adding "ipv6 mld join" CLI
Adding the Interface level config command

ipv6 mld join
This command can be used to configure the static MLD join
for IPv6 group addresses on the interfaces.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-03-14 23:00:38 -07:00
Donatas Abraitis
f2058cb425 pimd: Add IGMP join sent/failed statistics
```
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-03-13 19:31:34 +02:00
David Lamparter
97feb13f0f pim6d: reenable address management code
A few more pieces that should now work reasonably well for IPv6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
cfef61553f pim6d: rework interface address tracking/selection
We only care about link-local addresses for IPv6 operation.  Also, MLD
needs the lowest while PIM needs the highest...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
8f26d9da67 pimd: fix unused variable
Fix `-Werror` build.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-26 15:32:48 +01:00
Donald Sharp
3bf65aa1ae
Merge pull request #10400 from opensourcerouting/pim6-compilefix
pim6d: get running with ipv6 types throughout
2022-02-26 08:03:06 -05:00
Donald Sharp
b5bf67e905
Merge pull request #10582 from anlancs/pimd-remove-redundant
pimd: remove redundant code
2022-02-17 08:06:14 -05:00
David Lamparter
94120cb227 pim6d: get into a kinda-working state wrt. zebra
Fix up just enough to make us not operate in complete darkness.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
David Lamparter
5a46a3dea9 pim6d: drop off IGMP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-16 16:40:56 +01:00
anlan_cs
c0d217c4e8 pimd: remove redundant code
`ifchannel_rb` is already cleaned by `pim_ifchannel_delete_all`, so
it should be removed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-15 22:49:37 +08:00
David Lamparter
034db86b72 pim6d: IPv6-adjust iface primary/DR addrs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
David Lamparter
9bb93fa04e pim6d: IPv6-adjust neigh->source_addr
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-14 06:45:03 +01:00
Donald Sharp
76802e5209
Merge pull request #10292 from opensourcerouting/pim6-addr-aux
pimd: start tackling IPv6 address operations
2022-02-08 13:09:08 -05:00
Igor Ryzhov
3c10fb92c1 pimd: fix interface info memory leak
When the interface is deleted from the system, its info must be freed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 20:14:18 +03:00
Igor Ryzhov
6b88faa7ff pimd: move iface lib initialization to a proper place
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 20:14:18 +03:00
David Lamparter
3ca68c9cf3 pimd: remove PIM_INADDR_IS[NOT]_ANY macros
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-17 14:11:08 +01:00
Sai Gomathi
18adcff1c0 pimd: Modifying members of pim_interface to accommodate IPv6 changes
Modifying the members of pim_interface which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).

Issues: #10023

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2022-01-11 03:18:06 -08:00
Stephen Worley
ad1229a077
Merge pull request #10215 from FRRouting/revert-10164-name_change
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes"
2021-12-15 17:40:53 -05:00
David Lamparter
62646e1350
Merge pull request #10167 from mobash-rasool/pim-upst-1 2021-12-14 17:54:22 +01:00
David Lamparter
29e5822590
Revert "pimd: Modifying members of pim_interface to accommodate IPv6 changes" 2021-12-14 17:33:24 +01:00