Commit Graph

1697 Commits

Author SHA1 Message Date
Mark Stapp
5047884528 *: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 12:16:52 -04:00
Mark Stapp
ee2bbf7ce2 pimd: replace inet_ntoa
Replace all use of inet_ntoa, using %pI4 or inet_ntoa instead

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22 10:13:56 -04:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Donald Sharp
c10e14e96d *: Create/Use accessor functions for lock count
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>
2020-10-17 13:39:10 -04:00
Donald Sharp
f000b7c144
Merge pull request #6016 from sarav511/ppend
pimd: Handling prune received during join state and join received during prune pending
2020-10-14 20:27:17 -04:00
Donald Sharp
a5ca0ef54f
Merge pull request #5895 from patrasar/2404618
pimd: Clear (s,g,rpt) ifchannel on (*, G) prune received
2020-10-14 20:13:31 -04:00
Donald Sharp
28ef0ee121 *: Use proper semantics for turning off thread
We have this pattern in the code base:

if (thread)
	THREAD_OFF(thread);

If we look at THREAD_OFF we check to see if thread
is non-null too.  So we have a double check.
This is unnecessary.  Convert to just using THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-12 08:35:18 -04:00
Renato Westphal
8b6b6b694d
Merge pull request #7222 from idryzhov/fix-debug
fix debug commands node inconsistencies
2020-10-09 21:58:24 -03:00
Adriano Marto Reis
9fbd9fc48f pimd: MSDP SA forwarding
* 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-10-06 08:11:24 -04:00
Igor Ryzhov
d7b86ae4fe vtysh: dynamically generate the list of daemons for commands
Some daemons were actually missing from the static definitions: nhrpd,
babeld, eigrpd and bfdd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:27 +03:00
Igor Ryzhov
dd73744d8c *: move "show debugging ..." commands to enable node
Use the same node for "show debugging" commands in all daemons.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 15:06:05 +03:00
Quentin Young
6c83ddedcf *: make failure to decode nht update an error
This should never happen; no need to debug guard it and it's not a
warning, if this isn't working then NHT is not working at all.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-09-30 18:37:15 -04:00
Donald Sharp
2c85fdd4c3 pimd: When bind fails we could leave an open socket
Clean up the rare situation when bind fails to not
close the fd that was just opened and have the socket
leaked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-24 08:12:49 -04:00
Donald Sharp
d12f46fa1a pimd: NULL not 0
When handling data pointers explicity use NULL not
0.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-24 08:10:26 -04:00
Donald Sharp
4fdd2942c5 pimd: Warn when we try to build MAXVIFS > 256
We use the pim mroute socket for kernel notifications of events.
Currently this is limited to 8 bits of data.  There are patches
coming down the pike in kernel land to allow this to expand.
Rather than fix this and all the other places we assume MAXVIFS < 256
in the pim code right now.  Leave a land mine for the developer
doing this work to point them in the right direction.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-11 20:06:06 -04:00
Nathan Bahr
bcdb04e68b pimd: fix IGMP querier election
Match by exact address rather than by prefix match to
determine if we generated the IGMPP query. Othwerwise
we will be ignoring IGMP queries coming from other
hosts on the same subnet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-08-26 10:47:04 -05:00
Nathan Bahr
d05d3f7a6f pimd: fix IGMP source address on transmit
IGMP queries should contain the source address of the IGMP socket
they are being sent from.
Added binding the IGMP sockets to their specific source, otherwise
interfaces with multiple addresses will send multiple queries using
the same source, which is determined by the kernel.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-08-26 10:47:04 -05:00
Nathan Bahr
efe6f18590 pimd: fix IGMP receive handling
IGMP packets received from a source that does not match the subnet
of any configured addresses on the receive interface should be
ignored.
Also, find and use the correct IGMP socket object for the received
IGMP packet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-08-26 10:46:42 -05:00
Donald Sharp
ddba0a04a9 pimd: Allow multiple secondary addresses to work
Suppose you have more than 2 addresses on a pim interface:
lo              up      default         10.255.0.1/32
                                        10.255.0.101/32
                                        10.255.0.254/32

A `show ip pim int lo` gives us this:

eva# show ip pim interface lo
Interface  : lo
State      : up
Address    : 10.255.0.1 (primary)
             10.255.0.101/32

When we go look at the code that pulls secondary addresses in
we are using a prefix_cmp to know if we know about a secondary already
but were expecting true values instead of -1/0/1 being returned.

Modify code so that pim sees all secondary addresses

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-10 10:32:17 -04:00
Mobashshera Rasool
4b67fe2df3 pimd: crash fix when RP is removed
pimd crash at pim_msg_build_jp_groups (
grp=grp@entry=0x7ffca55b5d1e, sgs=sgs@entry=0x17821a0, size=20)
 at pimd/pim_msg.c:198

Fix for https://github.com/FRRouting/frr/issues/6849

Root Cause:
===========
pimd has crashed because pim_upstream_rpf_clear function sets the
up->rpf.source_nexthop.interface pointer to NULL and has not removed
the upstream source node from the neighbor. When the upstream gets
deleted the source is not removed from neighbor
neigh->upstream_jp_agg->groups->sources list. This source node has
pointer to upstream freed memory. Hence when on_neighbor_jp_timer expires,
it tries to access the upstream pointer and crashed.

Fix:
====
Before setting the interface pointer to NULL, remove the node from
neigh->upstream_jp_agg->groups->sources list. Also the upstream state
has to be changed to Not joined.

Removed extra line changes.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-08-05 05:49:14 +00:00
Chirag Shah
b37e4b282d *: pim igmp yang registery to appropriate makefile
Move pim and igmp yang files registery to appropriate makefiles.

In yang directory makefile move under `PIMD`
Remove pimd yang files from library makefile instead move them
to pimd makefile.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-07-22 23:22:23 -07:00
Quentin Young
65b86778c1
Merge pull request #6711 from GalaxyGorilla/bfd_isis_profiles
Add BFD profiles for IS-IS
2020-07-21 14:45:31 -04:00
Donald Sharp
d76c38ade3 pimd: Prevent Null string %s issues
There are couple spots where group may be NULL and
when we output strings associated with it we should
ensure we are not doing something stupid.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-18 09:46:06 -04:00
Donald Sharp
e4e52805c9 pimd: Cleanup leaked memory from rp initialization
When creating a pim instance, we were allocating table information
but never freeing it.  Do so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-07-16 08:16:39 -04:00
Donald Sharp
892c2c4468 pimd: Cleanup some small memory leaks on exit
We were not properly cleaning up some memory in the pim mlag
subsystem.  Clean it up on exit.

Signed-off-by: Donald Sharp <sharpc@cumulusnetworks.com>
2020-07-16 08:13:21 -04:00
David Lamparter
6cde4b4552 *: remove PRI[udx](8|16|32)
These are completely pointless and break coccinelle string replacements.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:43:40 +02:00
David Lamparter
3efd0893d0 *: un-split strings across lines
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-07-14 10:37:25 +02:00
GalaxyGorilla
4affdba79e *: add BFD profile support for IS-IS
BFD profiles can now be used on the interface level like this:

	interface eth1
	  ip router isis 1
          isis bfd
          isis bfd profile default

Here the 'default' profile needs to be specified as usual in the
bfdd configuration.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-07-10 11:28:43 +00:00
Quentin Young
007c1dd490
Merge pull request #6114 from rgirada/frr-static
pimd: Providing json support for few pim commands
2020-07-06 13:04:43 -04:00
Donald Sharp
b0ee422ab1 pimd: Poorly ported code fix
This section of code was ported incorrectly and is causing
issues when running against some tests.  Fix the missed
code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-06-18 11:06:09 -04:00
Russ White
14dee36af1
Merge pull request #6509 from donaldsharp/mlag_missed_upstream
pimd: Allow mlag to create ifchannel
2020-06-11 06:15:31 -04:00
Donald Sharp
2d8c1bc235
Merge pull request #5323 from opensourcerouting/filter-nb
lib: migrate FRR filter to northbound
2020-06-10 06:59:32 -04:00
Rafael Zalamena
fb7f5aa8d6 *: integrate remaining daemons with filter
Don't crash when trying to `show running-config` because of missing
filter northbound integration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-06-05 14:36:54 -03:00
Sarita Patra
fa8c500f54 pimd: Clear (s,g,rpt) ifchannel on (*, G) prune received
Issue: After SPT switchover, do shut and no-shut the received connected
interface, traffic stops.
                 R2
            |         |
            +         +
 Client-----R1--------R3----Source
R2 is RP.

Root cause:
Client is sending join for G and Source is sending traffic for G.
Before SPT switchover, traffic flows R3-R2-R1, after SPT switchover,
traffic flows R3-R1. Now Check in R2, there will be 2 ifchannel gets
created. first is (*, G) ifchannel which gets created because of (*, G)
join received from R1, second is (S, G) ifchannel which gets created
because of (s,g,rpt) prune received from R1
Shut the receiver connected interface on R1, R1 will send a (*, G) prune
towards RP (R2). On receiving (*, G) prune, R2 deletes the (*, G) ifchannel.
(s,g) ifchannel with flag (s,g,rpt) set will be timeout after the prune timer
expires. Before this timer expires, do noshut the received connected inrterface
on R1. R1 will send a (*,G) join to R2(RP), So oil will be updated in (*, G),
but wont get updated in (s,g) since the flag (s,g,rpt) is set. So traffic flow
stops.

Fix: When (*, G) ifchannel is getting deleted because of (*, G) prune
received, as (*,G) prune indicates that the router no longer wishes
to receive shared tree traffic, so clear (S,G,RPT) flag on all the child (S,G)
ifchannel, which was created because of (S,G,RPT) prune received

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-06-04 21:49:07 -07:00
Donald Sharp
7594af0782 pimd: Provide some additional useful debug info
Actually display what S,G we are working on for
some mlag operations in their debugs

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-06-03 13:05:41 -04:00
Donald Sharp
df94b33a6e pimd: Fix missing code
Found some more missing code that got dropped during the
upstreaming process causing issues with things actually
working.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-06-03 13:05:41 -04:00
Donald Sharp
ac6ebcb0db pimd: Allow mlag to create ifchannel
When the mlag code was ported upstream the structure
of the calls in igmp_source_forward_start had been
reset and as a result we missed the call to check
that creating an ifchannel when we are DualActive
is allowed.

Ticket: CM-29941
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-06-02 21:57:41 -04:00
Donald Sharp
88b5958e31
Merge pull request #6054 from sarav511/dr2ndr
pimd: When DR becomes non DR, Still sends register packets to RP
2020-06-01 07:58:32 -04:00
Donald Sharp
75e43de7a6
Merge pull request #6048 from sarav511/joinsup
pimd: In join suppression period, join is being sent
2020-06-01 07:36:24 -04:00
rgirada
91c0fb4779 pimd: Modifying "show ip mroute json" o/p.
Description:
"show ip mroute" displays only installed(kernel) mroutes, where
as "show ip mroute json" diplays both installed and not installed
mroutes in the o/p.To make this consistant, diplaying only valid
routes in json o/p.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-05-30 05:15:43 -07:00
rgirada
922e754430 pimd: Providing json support for few pim commands.
Description:
Added json support for the following PIM commands.
1. show ip mroute [vrf NAME] count [json]
2. show ip mroute vrf all count [json]
3. show ip mroute [vrf NAME] summary [json]
4. show ip mroute vrf all summary [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-05-30 05:15:27 -07:00
Donald Sharp
c58a47ea2e pimd: Fix crash on restart from thread_cancel
We were using thread_cancel() directly instead of
THREAD_OFF which correctly ensures the pointer is not NULL.

Ticket:CM-29866
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-28 08:53:13 -04:00
Donald Sharp
310885bdd8
Merge pull request #5881 from patrasar/2386420
pimd: add show ip multicast count [json] command
2020-05-26 09:21:10 -04:00
Donald Sharp
737d73e519
Merge pull request #6056 from sarav511/jpexp
pimd: Prune->noinfo state has to put off join expiry timer and delete ifchannel
2020-05-21 08:08:29 -04:00
Sarita Patra
8c8d70319e pimd: add show ip multicast count [json] command
Added a new show command "show ip multicast", display the multicast data
packet in and out on interface level.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-05-05 00:27:47 -07:00
David Lamparter
ff57083b80
Merge pull request #6308 from donaldsharp/pim_ordering 2020-04-28 17:14:28 +02:00
Donald Sharp
5d06e8a60e pimd: Add a needed space for formatting
Display a space in the output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-28 07:59:18 -04:00
David Lamparter
e08fe91d4a pimd: don't split format string from zlog call
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-28 11:13:02 +02:00
David Lamparter
94cfb0692e build: make clippy Makefile rules nicer
These are easy to get subtly wrong, and doing so can cause
nondeterministic failures when racing in parallel builds.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
David Lamparter
2768748b88 build: use VPATH for vtysh_scan
No need to put $(top_srcdir) everywhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:30:01 +02:00