]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_vxlan.c
Merge pull request #10593 from donaldsharp/rip_cleanup
[mirror_frr.git] / pimd / pim_vxlan.c
1 /* PIM support for VxLAN BUM flooding
2 *
3 * Copyright (C) 2019 Cumulus Networks, Inc.
4 *
5 * This file is part of FRR.
6 *
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 */
21
22 #include <zebra.h>
23
24 #include <hash.h>
25 #include <jhash.h>
26 #include <log.h>
27 #include <prefix.h>
28 #include <vrf.h>
29
30 #include "pimd.h"
31 #include "pim_iface.h"
32 #include "pim_memory.h"
33 #include "pim_oil.h"
34 #include "pim_register.h"
35 #include "pim_str.h"
36 #include "pim_upstream.h"
37 #include "pim_ifchannel.h"
38 #include "pim_nht.h"
39 #include "pim_zebra.h"
40 #include "pim_vxlan.h"
41 #include "pim_mlag.h"
42
43 /* pim-vxlan global info */
44 struct pim_vxlan vxlan_info, *pim_vxlan_p = &vxlan_info;
45
46 static void pim_vxlan_work_timer_setup(bool start);
47 static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
48 struct interface *ifp);
49
50 /*************************** vxlan work list **********************************
51 * A work list is maintained for staggered generation of pim null register
52 * messages for vxlan SG entries that are in a reg_join state.
53 *
54 * A max of 500 NULL registers are generated at one shot. If paused reg
55 * generation continues on the next second and so on till all register
56 * messages have been sent out. And the process is restarted every 60s.
57 *
58 * purpose of this null register generation is to setup the SPT and maintain
59 * independent of the presence of overlay BUM traffic.
60 ****************************************************************************/
61 static void pim_vxlan_do_reg_work(void)
62 {
63 struct listnode *listnode;
64 int work_cnt = 0;
65 struct pim_vxlan_sg *vxlan_sg;
66 static int sec_count;
67
68 ++sec_count;
69
70 if (sec_count > PIM_VXLAN_NULL_REG_INTERVAL) {
71 sec_count = 0;
72 listnode = vxlan_info.next_work ?
73 vxlan_info.next_work :
74 vxlan_info.work_list->head;
75 if (PIM_DEBUG_VXLAN && listnode)
76 zlog_debug("vxlan SG work %s",
77 vxlan_info.next_work ? "continues" : "starts");
78 } else {
79 listnode = vxlan_info.next_work;
80 }
81
82 for (; listnode; listnode = listnode->next) {
83 vxlan_sg = (struct pim_vxlan_sg *)listnode->data;
84 if (vxlan_sg->up && (vxlan_sg->up->reg_state == PIM_REG_JOIN)) {
85 if (PIM_DEBUG_VXLAN)
86 zlog_debug("vxlan SG %s periodic NULL register",
87 vxlan_sg->sg_str);
88
89 /*
90 * If we are on the work queue *and* the rpf
91 * has been lost on the vxlan_sg->up let's
92 * make sure that we don't send it.
93 */
94 if (vxlan_sg->up->rpf.source_nexthop.interface) {
95 pim_null_register_send(vxlan_sg->up);
96 ++work_cnt;
97 }
98 }
99
100 if (work_cnt > vxlan_info.max_work_cnt) {
101 vxlan_info.next_work = listnode->next;
102 if (PIM_DEBUG_VXLAN)
103 zlog_debug("vxlan SG %d work items proc and pause",
104 work_cnt);
105 return;
106 }
107 }
108
109 if (work_cnt) {
110 if (PIM_DEBUG_VXLAN)
111 zlog_debug("vxlan SG %d work items proc", work_cnt);
112 }
113 vxlan_info.next_work = NULL;
114 }
115
116 /* Staggered work related info is initialized when the first work comes
117 * along
118 */
119 static void pim_vxlan_init_work(void)
120 {
121 if (vxlan_info.flags & PIM_VXLANF_WORK_INITED)
122 return;
123
124 vxlan_info.max_work_cnt = PIM_VXLAN_WORK_MAX;
125 vxlan_info.flags |= PIM_VXLANF_WORK_INITED;
126 vxlan_info.work_list = list_new();
127 pim_vxlan_work_timer_setup(true/* start */);
128 }
129
130 static void pim_vxlan_add_work(struct pim_vxlan_sg *vxlan_sg)
131 {
132 if (vxlan_sg->flags & PIM_VXLAN_SGF_DEL_IN_PROG) {
133 if (PIM_DEBUG_VXLAN)
134 zlog_debug("vxlan SG %s skip work list; del-in-prog",
135 vxlan_sg->sg_str);
136 return;
137 }
138
139 pim_vxlan_init_work();
140
141 /* already a part of the work list */
142 if (vxlan_sg->work_node)
143 return;
144
145 if (PIM_DEBUG_VXLAN)
146 zlog_debug("vxlan SG %s work list add",
147 vxlan_sg->sg_str);
148 vxlan_sg->work_node = listnode_add(vxlan_info.work_list, vxlan_sg);
149 /* XXX: adjust max_work_cnt if needed */
150 }
151
152 static void pim_vxlan_del_work(struct pim_vxlan_sg *vxlan_sg)
153 {
154 if (!vxlan_sg->work_node)
155 return;
156
157 if (PIM_DEBUG_VXLAN)
158 zlog_debug("vxlan SG %s work list del",
159 vxlan_sg->sg_str);
160
161 if (vxlan_sg->work_node == vxlan_info.next_work)
162 vxlan_info.next_work = vxlan_sg->work_node->next;
163
164 list_delete_node(vxlan_info.work_list, vxlan_sg->work_node);
165 vxlan_sg->work_node = NULL;
166 }
167
168 void pim_vxlan_update_sg_reg_state(struct pim_instance *pim,
169 struct pim_upstream *up, bool reg_join)
170 {
171 struct pim_vxlan_sg *vxlan_sg;
172
173 vxlan_sg = pim_vxlan_sg_find(pim, &up->sg);
174 if (!vxlan_sg)
175 return;
176
177 /* add the vxlan sg entry to a work list for periodic reg joins.
178 * the entry will stay in the list as long as the register state is
179 * PIM_REG_JOIN
180 */
181 if (reg_join)
182 pim_vxlan_add_work(vxlan_sg);
183 else
184 pim_vxlan_del_work(vxlan_sg);
185 }
186
187 static int pim_vxlan_work_timer_cb(struct thread *t)
188 {
189 pim_vxlan_do_reg_work();
190 pim_vxlan_work_timer_setup(true /* start */);
191 return 0;
192 }
193
194 /* global 1second timer used for periodic processing */
195 static void pim_vxlan_work_timer_setup(bool start)
196 {
197 THREAD_OFF(vxlan_info.work_timer);
198 if (start)
199 thread_add_timer(router->master, pim_vxlan_work_timer_cb, NULL,
200 PIM_VXLAN_WORK_TIME, &vxlan_info.work_timer);
201 }
202
203 /**************************** vxlan origination mroutes ***********************
204 * For every (local-vtep-ip, bum-mcast-grp) registered by evpn an origination
205 * mroute is setup by pimd. The purpose of this mroute is to forward vxlan
206 * encapsulated BUM (broadcast, unknown-unicast and unknown-multicast packets
207 * over the underlay.)
208 *
209 * Sample mroute (single VTEP):
210 * (27.0.0.7, 239.1.1.100) Iif: lo Oifs: uplink-1
211 *
212 * Sample mroute (anycast VTEP):
213 * (36.0.0.9, 239.1.1.100) Iif: peerlink-3.4094\
214 * Oifs: peerlink-3.4094 uplink-1
215 ***************************************************************************/
216 static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
217 {
218 struct pim_upstream *up = vxlan_sg->up;
219
220 if (!up)
221 return;
222
223 if (PIM_DEBUG_VXLAN)
224 zlog_debug("vxlan SG %s orig mroute-up del",
225 vxlan_sg->sg_str);
226
227 vxlan_sg->up = NULL;
228
229 if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG) {
230 /* clear out all the vxlan properties */
231 up->flags &= ~(PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_ORIG |
232 PIM_UPSTREAM_FLAG_MASK_STATIC_IIF |
233 PIM_UPSTREAM_FLAG_MASK_DISABLE_KAT_EXPIRY |
234 PIM_UPSTREAM_FLAG_MASK_FORCE_PIMREG |
235 PIM_UPSTREAM_FLAG_MASK_NO_PIMREG_DATA |
236 PIM_UPSTREAM_FLAG_MASK_ALLOW_IIF_IN_OIL);
237
238 /* We bring things to a grinding halt by force expirying
239 * the kat. Doing this will also remove the reference we
240 * created as a "vxlan" source and delete the upstream entry
241 * if there are no other references.
242 */
243 if (PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) {
244 THREAD_OFF(up->t_ka_timer);
245 up = pim_upstream_keep_alive_timer_proc(up);
246 } else {
247 /* this is really unexpected as we force vxlan
248 * origination mroutes active sources but just in
249 * case
250 */
251 up = pim_upstream_del(vxlan_sg->pim, up, __func__);
252 }
253 /* if there are other references register the source
254 * for nht
255 */
256 if (up) {
257 enum pim_rpf_result r;
258
259 r = pim_rpf_update(vxlan_sg->pim, up, NULL, __func__);
260 if (r == PIM_RPF_FAILURE) {
261 if (PIM_DEBUG_VXLAN)
262 zlog_debug(
263 "vxlan SG %s rpf_update failure",
264 vxlan_sg->sg_str);
265 }
266 }
267 }
268 }
269
270 static void pim_vxlan_orig_mr_up_iif_update(struct pim_vxlan_sg *vxlan_sg)
271 {
272 /* update MFC with the new IIF */
273 pim_upstream_fill_static_iif(vxlan_sg->up, vxlan_sg->iif);
274 pim_upstream_mroute_iif_update(vxlan_sg->up->channel_oil, __func__);
275
276 if (PIM_DEBUG_VXLAN)
277 zlog_debug("vxlan SG %s orig mroute-up updated with iif %s",
278 vxlan_sg->sg_str,
279 vxlan_sg->iif?vxlan_sg->iif->name:"-");
280
281 }
282
283 /* For every VxLAN BUM multicast group we setup a SG-up that has the following
284 * "forced properties" -
285 * 1. Directly connected on a DR interface i.e. we must act as an FHR
286 * 2. We prime the pump i.e. no multicast data is needed to register this
287 * source with the FHR. To do that we send periodic null registers if
288 * the SG entry is in a register-join state. We also prevent expiry of
289 * KAT.
290 * 3. As this SG is setup without data there is no need to register encapsulate
291 * data traffic. This encapsulation is explicitly skipped for the following
292 * reasons -
293 * a) Many levels of encapsulation are needed creating MTU disc challenges.
294 * Overlay BUM is encapsulated in a vxlan/UDP/IP header and then
295 * encapsulated again in a pim-register header.
296 * b) On a vxlan-aa setup both switches rx a copy of each BUM packet. if
297 * they both reg encapsulated traffic the RP will accept the duplicates
298 * as there are no RPF checks for this encapsulated data.
299 * a), b) can be workarounded if needed, but there is really no need because
300 * of (2) i.e. the pump is primed without data.
301 */
302 static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
303 {
304 struct pim_upstream *up;
305 struct pim_interface *term_ifp;
306 int flags = 0;
307 struct prefix nht_p;
308 struct pim_instance *pim = vxlan_sg->pim;
309
310 if (vxlan_sg->up) {
311 /* nothing to do */
312 return;
313 }
314
315 if (PIM_DEBUG_VXLAN)
316 zlog_debug("vxlan SG %s orig mroute-up add with iif %s",
317 vxlan_sg->sg_str,
318 vxlan_sg->iif?vxlan_sg->iif->name:"-");
319
320 PIM_UPSTREAM_FLAG_SET_SRC_VXLAN_ORIG(flags);
321 /* pin the IIF to lo or peerlink-subinterface and disable NHT */
322 PIM_UPSTREAM_FLAG_SET_STATIC_IIF(flags);
323 /* Fake traffic by setting SRC_STREAM and starting KAT */
324 /* We intentionally skip updating ref count for SRC_STREAM/FHR.
325 * Setting SRC_VXLAN should have already created a reference
326 * preventing the entry from being deleted
327 */
328 PIM_UPSTREAM_FLAG_SET_FHR(flags);
329 PIM_UPSTREAM_FLAG_SET_SRC_STREAM(flags);
330 /* Force pimreg even if non-DR. This is needed on a MLAG setup for
331 * VxLAN AA
332 */
333 PIM_UPSTREAM_FLAG_SET_FORCE_PIMREG(flags);
334 /* prevent KAT expiry. we want the MDT setup even if there is no BUM
335 * traffic
336 */
337 PIM_UPSTREAM_FLAG_SET_DISABLE_KAT_EXPIRY(flags);
338 /* SPT for vxlan BUM groups is primed and maintained via NULL
339 * registers so there is no need to reg-encapsulate
340 * vxlan-encapsulated overlay data traffic
341 */
342 PIM_UPSTREAM_FLAG_SET_NO_PIMREG_DATA(flags);
343 /* On a MLAG setup we force a copy to the MLAG peer while also
344 * accepting traffic from the peer. To do this we set peerlink-rif as
345 * the IIF and also add it to the OIL
346 */
347 PIM_UPSTREAM_FLAG_SET_ALLOW_IIF_IN_OIL(flags);
348
349 /* XXX: todo: defer pim_upstream add if pim is not enabled on the iif */
350 up = pim_upstream_find(vxlan_sg->pim, &vxlan_sg->sg);
351 if (up) {
352 /* if the iif is set to something other than the vxlan_sg->iif
353 * we must dereg the old nexthop and force to new "static"
354 * iif
355 */
356 if (!PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags)) {
357 pim_addr_to_prefix(&nht_p, up->upstream_addr);
358 pim_delete_tracked_nexthop(vxlan_sg->pim, &nht_p, up,
359 NULL);
360 }
361 /* We are acting FHR; clear out use_rpt setting if any */
362 pim_upstream_update_use_rpt(up, false /*update_mroute*/);
363 pim_upstream_ref(up, flags, __func__);
364 vxlan_sg->up = up;
365 term_ifp = pim_vxlan_get_term_ifp(pim);
366 /* mute termination device on origination mroutes */
367 if (term_ifp)
368 pim_channel_update_oif_mute(up->channel_oil,
369 term_ifp);
370 pim_vxlan_orig_mr_up_iif_update(vxlan_sg);
371 /* mute pimreg on origination mroutes */
372 if (pim->regiface)
373 pim_channel_update_oif_mute(up->channel_oil,
374 pim->regiface->info);
375 } else {
376 up = pim_upstream_add(vxlan_sg->pim, &vxlan_sg->sg,
377 vxlan_sg->iif, flags, __func__, NULL);
378 vxlan_sg->up = up;
379 }
380
381 if (!up) {
382 if (PIM_DEBUG_VXLAN)
383 zlog_debug("vxlan SG %s orig mroute-up add failed",
384 vxlan_sg->sg_str);
385 return;
386 }
387
388 pim_upstream_keep_alive_timer_start(up, vxlan_sg->pim->keep_alive_time);
389
390 /* register the source with the RP */
391 switch (up->reg_state) {
392
393 case PIM_REG_NOINFO:
394 pim_register_join(up);
395 pim_null_register_send(up);
396 break;
397
398 case PIM_REG_JOIN:
399 /* if the pim upstream entry is already in reg-join state
400 * send null_register right away and add to the register
401 * worklist
402 */
403 pim_null_register_send(up);
404 pim_vxlan_update_sg_reg_state(pim, up, true);
405 break;
406
407 case PIM_REG_JOIN_PENDING:
408 case PIM_REG_PRUNE:
409 break;
410 }
411
412 /* update the inherited OIL */
413 pim_upstream_inherited_olist(vxlan_sg->pim, up);
414 if (!up->channel_oil->installed)
415 pim_upstream_mroute_add(up->channel_oil, __func__);
416 }
417
418 static void pim_vxlan_orig_mr_oif_add(struct pim_vxlan_sg *vxlan_sg)
419 {
420 if (!vxlan_sg->up || !vxlan_sg->orig_oif)
421 return;
422
423 if (PIM_DEBUG_VXLAN)
424 zlog_debug("vxlan SG %s oif %s add",
425 vxlan_sg->sg_str, vxlan_sg->orig_oif->name);
426
427 vxlan_sg->flags |= PIM_VXLAN_SGF_OIF_INSTALLED;
428 pim_channel_add_oif(vxlan_sg->up->channel_oil,
429 vxlan_sg->orig_oif, PIM_OIF_FLAG_PROTO_VXLAN,
430 __func__);
431 }
432
433 static void pim_vxlan_orig_mr_oif_del(struct pim_vxlan_sg *vxlan_sg)
434 {
435 struct interface *orig_oif;
436
437 orig_oif = vxlan_sg->orig_oif;
438 vxlan_sg->orig_oif = NULL;
439
440 if (!(vxlan_sg->flags & PIM_VXLAN_SGF_OIF_INSTALLED))
441 return;
442
443 if (PIM_DEBUG_VXLAN)
444 zlog_debug("vxlan SG %s oif %s del",
445 vxlan_sg->sg_str, orig_oif->name);
446
447 vxlan_sg->flags &= ~PIM_VXLAN_SGF_OIF_INSTALLED;
448 pim_channel_del_oif(vxlan_sg->up->channel_oil,
449 orig_oif, PIM_OIF_FLAG_PROTO_VXLAN, __func__);
450 }
451
452 static inline struct interface *pim_vxlan_orig_mr_oif_get(
453 struct pim_instance *pim)
454 {
455 return (vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED) ?
456 pim->vxlan.peerlink_rif : NULL;
457 }
458
459 /* Single VTEPs: IIF for the vxlan-origination-mroutes is lo or vrf-dev (if
460 * the mroute is in a non-default vrf).
461 * Anycast VTEPs: IIF is the MLAG ISL/peerlink.
462 */
463 static inline struct interface *pim_vxlan_orig_mr_iif_get(
464 struct pim_instance *pim)
465 {
466 return ((vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED) &&
467 pim->vxlan.peerlink_rif) ?
468 pim->vxlan.peerlink_rif : pim->vxlan.default_iif;
469 }
470
471 static bool pim_vxlan_orig_mr_add_is_ok(struct pim_vxlan_sg *vxlan_sg)
472 {
473 struct pim_interface *pim_ifp;
474
475 vxlan_sg->iif = pim_vxlan_orig_mr_iif_get(vxlan_sg->pim);
476 if (!vxlan_sg->iif)
477 return false;
478
479 pim_ifp = (struct pim_interface *)vxlan_sg->iif->info;
480 if (!pim_ifp || (pim_ifp->mroute_vif_index < 0))
481 return false;
482
483 return true;
484 }
485
486 static void pim_vxlan_orig_mr_install(struct pim_vxlan_sg *vxlan_sg)
487 {
488 pim_vxlan_orig_mr_up_add(vxlan_sg);
489
490 vxlan_sg->orig_oif = pim_vxlan_orig_mr_oif_get(vxlan_sg->pim);
491 pim_vxlan_orig_mr_oif_add(vxlan_sg);
492 }
493
494 static void pim_vxlan_orig_mr_add(struct pim_vxlan_sg *vxlan_sg)
495 {
496 if (!pim_vxlan_orig_mr_add_is_ok(vxlan_sg))
497 return;
498
499 if (PIM_DEBUG_VXLAN)
500 zlog_debug("vxlan SG %s orig-mr add", vxlan_sg->sg_str);
501
502 pim_vxlan_orig_mr_install(vxlan_sg);
503 }
504
505 static void pim_vxlan_orig_mr_del(struct pim_vxlan_sg *vxlan_sg)
506 {
507 if (PIM_DEBUG_VXLAN)
508 zlog_debug("vxlan SG %s orig-mr del", vxlan_sg->sg_str);
509
510 pim_vxlan_orig_mr_oif_del(vxlan_sg);
511 pim_vxlan_orig_mr_up_del(vxlan_sg);
512 }
513
514 static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *bucket, void *arg)
515 {
516 struct interface *ifp;
517 struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
518 struct interface *old_iif = vxlan_sg->iif;
519
520 if (!pim_vxlan_is_orig_mroute(vxlan_sg))
521 return;
522
523 ifp = pim_vxlan_orig_mr_iif_get(vxlan_sg->pim);
524 if (PIM_DEBUG_VXLAN)
525 zlog_debug("vxlan SG %s iif changed from %s to %s",
526 vxlan_sg->sg_str,
527 old_iif ? old_iif->name : "-",
528 ifp ? ifp->name : "-");
529
530 if (pim_vxlan_orig_mr_add_is_ok(vxlan_sg)) {
531 if (vxlan_sg->up) {
532 /* upstream exists but iif changed */
533 pim_vxlan_orig_mr_up_iif_update(vxlan_sg);
534 } else {
535 /* install mroute */
536 pim_vxlan_orig_mr_install(vxlan_sg);
537 }
538 } else {
539 pim_vxlan_orig_mr_del(vxlan_sg);
540 }
541 }
542
543 /**************************** vxlan termination mroutes ***********************
544 * For every bum-mcast-grp registered by evpn a *G termination
545 * mroute is setup by pimd. The purpose of this mroute is to pull down vxlan
546 * packets with the bum-mcast-grp dip from the underlay and terminate the
547 * tunnel. This is done by including the vxlan termination device (ipmr-lo) in
548 * its OIL. The vxlan de-capsulated packets are subject to subsequent overlay
549 * bridging.
550 *
551 * Sample mroute:
552 * (0.0.0.0, 239.1.1.100) Iif: uplink-1 Oifs: ipmr-lo, uplink-1
553 *****************************************************************************/
554 struct pim_interface *pim_vxlan_get_term_ifp(struct pim_instance *pim)
555 {
556 return pim->vxlan.term_if ?
557 (struct pim_interface *)pim->vxlan.term_if->info : NULL;
558 }
559
560 static void pim_vxlan_term_mr_oif_add(struct pim_vxlan_sg *vxlan_sg)
561 {
562 if (vxlan_sg->flags & PIM_VXLAN_SGF_OIF_INSTALLED)
563 return;
564
565 if (PIM_DEBUG_VXLAN)
566 zlog_debug("vxlan SG %s term-oif %s add",
567 vxlan_sg->sg_str, vxlan_sg->term_oif->name);
568
569 if (pim_ifchannel_local_membership_add(vxlan_sg->term_oif,
570 &vxlan_sg->sg, true /*is_vxlan */)) {
571 vxlan_sg->flags |= PIM_VXLAN_SGF_OIF_INSTALLED;
572 /* update the inherited OIL */
573 /* XXX - I don't see the inherited OIL updated when a local
574 * member is added. And that probably needs to be fixed. Till
575 * that happens we do a force update on the inherited OIL
576 * here.
577 */
578 pim_upstream_inherited_olist(vxlan_sg->pim, vxlan_sg->up);
579 } else {
580 zlog_warn("vxlan SG %s term-oif %s add failed",
581 vxlan_sg->sg_str, vxlan_sg->term_oif->name);
582 }
583 }
584
585 static void pim_vxlan_term_mr_oif_del(struct pim_vxlan_sg *vxlan_sg)
586 {
587 if (!(vxlan_sg->flags & PIM_VXLAN_SGF_OIF_INSTALLED))
588 return;
589
590 if (PIM_DEBUG_VXLAN)
591 zlog_debug("vxlan SG %s oif %s del",
592 vxlan_sg->sg_str, vxlan_sg->term_oif->name);
593
594 vxlan_sg->flags &= ~PIM_VXLAN_SGF_OIF_INSTALLED;
595 pim_ifchannel_local_membership_del(vxlan_sg->term_oif, &vxlan_sg->sg);
596 /* update the inherited OIL */
597 /* XXX - I don't see the inherited OIL updated when a local member
598 * is deleted. And that probably needs to be fixed. Till that happens
599 * we do a force update on the inherited OIL here.
600 */
601 pim_upstream_inherited_olist(vxlan_sg->pim, vxlan_sg->up);
602 }
603
604 static void pim_vxlan_update_sg_entry_mlag(struct pim_instance *pim,
605 struct pim_upstream *up, bool inherit)
606 {
607 bool is_df = true;
608
609 if (inherit && up->parent &&
610 PIM_UPSTREAM_FLAG_TEST_MLAG_VXLAN(up->parent->flags) &&
611 PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up->parent->flags))
612 is_df = false;
613
614 pim_mlag_up_df_role_update(pim, up, is_df, "inherit_xg_df");
615 }
616
617 /* We run MLAG DF election only on mroutes that have the termination
618 * device ipmr-lo in the immediate OIL. This is only (*, G) entries at the
619 * moment. For (S, G) entries that (with ipmr-lo in the inherited OIL) we
620 * inherit the DF role from the (*, G) entry.
621 */
622 void pim_vxlan_inherit_mlag_flags(struct pim_instance *pim,
623 struct pim_upstream *up, bool inherit)
624 {
625 struct listnode *listnode;
626 struct pim_upstream *child;
627
628 for (ALL_LIST_ELEMENTS_RO(up->sources, listnode,
629 child)) {
630 pim_vxlan_update_sg_entry_mlag(pim,
631 child, true /* inherit */);
632 }
633 }
634
635 static void pim_vxlan_term_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
636 {
637 struct pim_upstream *up;
638 int flags = 0;
639
640 if (vxlan_sg->up) {
641 /* nothing to do */
642 return;
643 }
644
645 if (PIM_DEBUG_VXLAN)
646 zlog_debug("vxlan SG %s term mroute-up add",
647 vxlan_sg->sg_str);
648
649 PIM_UPSTREAM_FLAG_SET_SRC_VXLAN_TERM(flags);
650 /* enable MLAG designated-forwarder election on termination mroutes */
651 PIM_UPSTREAM_FLAG_SET_MLAG_VXLAN(flags);
652
653 up = pim_upstream_add(vxlan_sg->pim, &vxlan_sg->sg, NULL /* iif */,
654 flags, __func__, NULL);
655 vxlan_sg->up = up;
656
657 if (!up) {
658 zlog_warn("vxlan SG %s term mroute-up add failed",
659 vxlan_sg->sg_str);
660 return;
661 }
662
663 /* update existing SG entries with the parent's MLAG flag */
664 pim_vxlan_inherit_mlag_flags(vxlan_sg->pim, up, true /*enable*/);
665 }
666
667 static void pim_vxlan_term_mr_up_del(struct pim_vxlan_sg *vxlan_sg)
668 {
669 struct pim_upstream *up = vxlan_sg->up;
670
671 if (!up)
672 return;
673
674 if (PIM_DEBUG_VXLAN)
675 zlog_debug("vxlan SG %s term mroute-up del",
676 vxlan_sg->sg_str);
677 vxlan_sg->up = NULL;
678 if (up->flags & PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM) {
679 /* update SG entries that are inheriting from this XG entry */
680 pim_vxlan_inherit_mlag_flags(vxlan_sg->pim, up,
681 false /*enable*/);
682 /* clear out all the vxlan related flags */
683 up->flags &= ~(PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM |
684 PIM_UPSTREAM_FLAG_MASK_MLAG_VXLAN);
685 pim_mlag_up_local_del(vxlan_sg->pim, up);
686 pim_upstream_del(vxlan_sg->pim, up, __func__);
687 }
688 }
689
690 static void pim_vxlan_term_mr_add(struct pim_vxlan_sg *vxlan_sg)
691 {
692 if (PIM_DEBUG_VXLAN)
693 zlog_debug("vxlan SG %s term mroute add", vxlan_sg->sg_str);
694
695 vxlan_sg->term_oif = vxlan_sg->pim->vxlan.term_if;
696 if (!vxlan_sg->term_oif)
697 /* defer termination mroute till we have a termination device */
698 return;
699
700 pim_vxlan_term_mr_up_add(vxlan_sg);
701 /* set up local membership for the term-oif */
702 pim_vxlan_term_mr_oif_add(vxlan_sg);
703 }
704
705 static void pim_vxlan_term_mr_del(struct pim_vxlan_sg *vxlan_sg)
706 {
707 if (PIM_DEBUG_VXLAN)
708 zlog_debug("vxlan SG %s term mroute del", vxlan_sg->sg_str);
709
710 /* remove local membership associated with the term oif */
711 pim_vxlan_term_mr_oif_del(vxlan_sg);
712 /* remove references to the upstream entry */
713 pim_vxlan_term_mr_up_del(vxlan_sg);
714 }
715
716 /************************** vxlan SG cache management ************************/
717 static unsigned int pim_vxlan_sg_hash_key_make(const void *p)
718 {
719 const struct pim_vxlan_sg *vxlan_sg = p;
720
721 return pim_sgaddr_hash(vxlan_sg->sg, 0);
722 }
723
724 static bool pim_vxlan_sg_hash_eq(const void *p1, const void *p2)
725 {
726 const struct pim_vxlan_sg *sg1 = p1;
727 const struct pim_vxlan_sg *sg2 = p2;
728
729 return !pim_sgaddr_cmp(sg1->sg, sg2->sg);
730 }
731
732 static struct pim_vxlan_sg *pim_vxlan_sg_new(struct pim_instance *pim,
733 pim_sgaddr *sg)
734 {
735 struct pim_vxlan_sg *vxlan_sg;
736
737 vxlan_sg = XCALLOC(MTYPE_PIM_VXLAN_SG, sizeof(*vxlan_sg));
738
739 vxlan_sg->pim = pim;
740 vxlan_sg->sg = *sg;
741 snprintfrr(vxlan_sg->sg_str, sizeof(vxlan_sg->sg_str), "%pSG", sg);
742
743 if (PIM_DEBUG_VXLAN)
744 zlog_debug("vxlan SG %s alloc", vxlan_sg->sg_str);
745
746 vxlan_sg = hash_get(pim->vxlan.sg_hash, vxlan_sg, hash_alloc_intern);
747
748 /* we register with the MLAG daemon in the first VxLAN SG and never
749 * de-register during that life of the pimd
750 */
751 if (pim->vxlan.sg_hash->count == 1) {
752 vxlan_mlag.flags |= PIM_VXLAN_MLAGF_DO_REG;
753 pim_mlag_register();
754 }
755
756 return vxlan_sg;
757 }
758
759 struct pim_vxlan_sg *pim_vxlan_sg_find(struct pim_instance *pim, pim_sgaddr *sg)
760 {
761 struct pim_vxlan_sg lookup;
762
763 lookup.sg = *sg;
764 return hash_lookup(pim->vxlan.sg_hash, &lookup);
765 }
766
767 struct pim_vxlan_sg *pim_vxlan_sg_add(struct pim_instance *pim, pim_sgaddr *sg)
768 {
769 struct pim_vxlan_sg *vxlan_sg;
770
771 vxlan_sg = pim_vxlan_sg_find(pim, sg);
772 if (vxlan_sg)
773 return vxlan_sg;
774
775 vxlan_sg = pim_vxlan_sg_new(pim, sg);
776
777 if (pim_vxlan_is_orig_mroute(vxlan_sg))
778 pim_vxlan_orig_mr_add(vxlan_sg);
779 else
780 pim_vxlan_term_mr_add(vxlan_sg);
781
782 return vxlan_sg;
783 }
784
785 static void pim_vxlan_sg_del_item(struct pim_vxlan_sg *vxlan_sg)
786 {
787 vxlan_sg->flags |= PIM_VXLAN_SGF_DEL_IN_PROG;
788
789 pim_vxlan_del_work(vxlan_sg);
790
791 if (pim_vxlan_is_orig_mroute(vxlan_sg))
792 pim_vxlan_orig_mr_del(vxlan_sg);
793 else
794 pim_vxlan_term_mr_del(vxlan_sg);
795
796 if (PIM_DEBUG_VXLAN)
797 zlog_debug("vxlan SG %s free", vxlan_sg->sg_str);
798
799 XFREE(MTYPE_PIM_VXLAN_SG, vxlan_sg);
800 }
801
802 void pim_vxlan_sg_del(struct pim_instance *pim, pim_sgaddr *sg)
803 {
804 struct pim_vxlan_sg *vxlan_sg;
805
806 vxlan_sg = pim_vxlan_sg_find(pim, sg);
807 if (!vxlan_sg)
808 return;
809
810 hash_release(pim->vxlan.sg_hash, vxlan_sg);
811 pim_vxlan_sg_del_item(vxlan_sg);
812 }
813
814 /******************************* MLAG handling *******************************/
815 bool pim_vxlan_do_mlag_reg(void)
816 {
817 return (vxlan_mlag.flags & PIM_VXLAN_MLAGF_DO_REG);
818 }
819
820 /* The peerlink sub-interface is added as an OIF to the origination-mroute.
821 * This is done to send a copy of the multicast-vxlan encapsulated traffic
822 * to the MLAG peer which may mroute it over the underlay if there are any
823 * interested receivers.
824 */
825 static void pim_vxlan_sg_peerlink_oif_update(struct hash_bucket *bucket,
826 void *arg)
827 {
828 struct interface *new_oif = (struct interface *)arg;
829 struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
830
831 if (!pim_vxlan_is_orig_mroute(vxlan_sg))
832 return;
833
834 if (vxlan_sg->orig_oif == new_oif)
835 return;
836
837 pim_vxlan_orig_mr_oif_del(vxlan_sg);
838
839 vxlan_sg->orig_oif = new_oif;
840 pim_vxlan_orig_mr_oif_add(vxlan_sg);
841 }
842
843 /* In the case of anycast VTEPs the VTEP-PIP must be used as the
844 * register source.
845 */
846 bool pim_vxlan_get_register_src(struct pim_instance *pim,
847 struct pim_upstream *up, struct in_addr *src_p)
848 {
849 if (!(vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED))
850 return true;
851
852 /* if address is not available suppress the pim-register */
853 if (vxlan_mlag.reg_addr.s_addr == INADDR_ANY)
854 return false;
855
856 *src_p = vxlan_mlag.reg_addr;
857 return true;
858 }
859
860 void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
861 struct interface *peerlink_rif,
862 struct in_addr *reg_addr)
863 {
864 struct pim_instance *pim;
865 char addr_buf[INET_ADDRSTRLEN];
866 struct pim_interface *pim_ifp = NULL;
867
868 if (PIM_DEBUG_VXLAN) {
869 inet_ntop(AF_INET, reg_addr,
870 addr_buf, INET_ADDRSTRLEN);
871 zlog_debug("vxlan MLAG update %s state %s role %d rif %s addr %s",
872 enable ? "enable" : "disable",
873 peer_state ? "up" : "down",
874 role,
875 peerlink_rif ? peerlink_rif->name : "-",
876 addr_buf);
877 }
878
879 /* XXX: for now vxlan termination is only possible in the default VRF
880 * when that changes this will need to change to iterate all VRFs
881 */
882 pim = pim_get_pim_instance(VRF_DEFAULT);
883
884 if (enable)
885 vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
886 else
887 vxlan_mlag.flags &= ~PIM_VXLAN_MLAGF_ENABLED;
888
889 if (vxlan_mlag.peerlink_rif != peerlink_rif)
890 vxlan_mlag.peerlink_rif = peerlink_rif;
891
892 vxlan_mlag.reg_addr = *reg_addr;
893 vxlan_mlag.peer_state = peer_state;
894 vxlan_mlag.role = role;
895
896 /* process changes */
897 if (vxlan_mlag.peerlink_rif)
898 pim_ifp = (struct pim_interface *)vxlan_mlag.peerlink_rif->info;
899 if ((vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED) &&
900 pim_ifp && (pim_ifp->mroute_vif_index > 0))
901 pim_vxlan_set_peerlink_rif(pim, peerlink_rif);
902 else
903 pim_vxlan_set_peerlink_rif(pim, NULL);
904 }
905
906 /****************************** misc callbacks *******************************/
907 static void pim_vxlan_set_default_iif(struct pim_instance *pim,
908 struct interface *ifp)
909 {
910 struct interface *old_iif;
911
912 if (pim->vxlan.default_iif == ifp)
913 return;
914
915 old_iif = pim->vxlan.default_iif;
916 if (PIM_DEBUG_VXLAN)
917 zlog_debug("%s: vxlan default iif changed from %s to %s",
918 __func__, old_iif ? old_iif->name : "-",
919 ifp ? ifp->name : "-");
920
921 old_iif = pim_vxlan_orig_mr_iif_get(pim);
922 pim->vxlan.default_iif = ifp;
923 ifp = pim_vxlan_orig_mr_iif_get(pim);
924 if (old_iif == ifp)
925 return;
926
927 if (PIM_DEBUG_VXLAN)
928 zlog_debug("%s: vxlan orig iif changed from %s to %s", __func__,
929 old_iif ? old_iif->name : "-",
930 ifp ? ifp->name : "-");
931
932 /* add/del upstream entries for the existing vxlan SG when the
933 * interface becomes available
934 */
935 if (pim->vxlan.sg_hash)
936 hash_iterate(pim->vxlan.sg_hash,
937 pim_vxlan_orig_mr_iif_update, NULL);
938 }
939
940 static void pim_vxlan_up_cost_update(struct pim_instance *pim,
941 struct pim_upstream *up,
942 struct interface *old_peerlink_rif)
943 {
944 if (!PIM_UPSTREAM_FLAG_TEST_MLAG_VXLAN(up->flags))
945 return;
946
947 if (up->rpf.source_nexthop.interface &&
948 ((up->rpf.source_nexthop.interface ==
949 pim->vxlan.peerlink_rif) ||
950 (up->rpf.source_nexthop.interface ==
951 old_peerlink_rif))) {
952 if (PIM_DEBUG_VXLAN)
953 zlog_debug("RPF cost adjust for %s on peerlink-rif (old: %s, new: %s) change",
954 up->sg_str,
955 old_peerlink_rif ?
956 old_peerlink_rif->name : "-",
957 pim->vxlan.peerlink_rif ?
958 pim->vxlan.peerlink_rif->name : "-");
959 pim_mlag_up_local_add(pim, up);
960 }
961 }
962
963 static void pim_vxlan_term_mr_cost_update(struct hash_bucket *bucket, void *arg)
964 {
965 struct interface *old_peerlink_rif = (struct interface *)arg;
966 struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
967 struct pim_upstream *up;
968 struct listnode *listnode;
969 struct pim_upstream *child;
970
971 if (pim_vxlan_is_orig_mroute(vxlan_sg))
972 return;
973
974 /* Lookup all XG and SG entries with RPF-interface peerlink_rif */
975 up = vxlan_sg->up;
976 if (!up)
977 return;
978
979 pim_vxlan_up_cost_update(vxlan_sg->pim, up,
980 old_peerlink_rif);
981
982 for (ALL_LIST_ELEMENTS_RO(up->sources, listnode,
983 child))
984 pim_vxlan_up_cost_update(vxlan_sg->pim, child,
985 old_peerlink_rif);
986 }
987
988 static void pim_vxlan_sg_peerlink_rif_update(struct hash_bucket *bucket,
989 void *arg)
990 {
991 pim_vxlan_orig_mr_iif_update(bucket, NULL);
992 pim_vxlan_term_mr_cost_update(bucket, arg);
993 }
994
995 static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
996 struct interface *ifp)
997 {
998 struct interface *old_iif;
999 struct interface *new_iif;
1000 struct interface *old_oif;
1001 struct interface *new_oif;
1002
1003 if (pim->vxlan.peerlink_rif == ifp)
1004 return;
1005
1006 old_iif = pim->vxlan.peerlink_rif;
1007 if (PIM_DEBUG_VXLAN)
1008 zlog_debug("%s: vxlan peerlink_rif changed from %s to %s",
1009 __func__, old_iif ? old_iif->name : "-",
1010 ifp ? ifp->name : "-");
1011
1012 old_iif = pim_vxlan_orig_mr_iif_get(pim);
1013 old_oif = pim_vxlan_orig_mr_oif_get(pim);
1014 pim->vxlan.peerlink_rif = ifp;
1015
1016 new_iif = pim_vxlan_orig_mr_iif_get(pim);
1017 if (old_iif != new_iif) {
1018 if (PIM_DEBUG_VXLAN)
1019 zlog_debug("%s: vxlan orig iif changed from %s to %s",
1020 __func__, old_iif ? old_iif->name : "-",
1021 new_iif ? new_iif->name : "-");
1022
1023 /* add/del upstream entries for the existing vxlan SG when the
1024 * interface becomes available
1025 */
1026 if (pim->vxlan.sg_hash)
1027 hash_iterate(pim->vxlan.sg_hash,
1028 pim_vxlan_sg_peerlink_rif_update,
1029 old_iif);
1030 }
1031
1032 new_oif = pim_vxlan_orig_mr_oif_get(pim);
1033 if (old_oif != new_oif) {
1034 if (PIM_DEBUG_VXLAN)
1035 zlog_debug("%s: vxlan orig oif changed from %s to %s",
1036 __func__, old_oif ? old_oif->name : "-",
1037 new_oif ? new_oif->name : "-");
1038 if (pim->vxlan.sg_hash)
1039 hash_iterate(pim->vxlan.sg_hash,
1040 pim_vxlan_sg_peerlink_oif_update,
1041 new_oif);
1042 }
1043 }
1044
1045 static void pim_vxlan_term_mr_oif_update(struct hash_bucket *bucket, void *arg)
1046 {
1047 struct interface *ifp = (struct interface *)arg;
1048 struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
1049
1050 if (pim_vxlan_is_orig_mroute(vxlan_sg))
1051 return;
1052
1053 if (vxlan_sg->term_oif == ifp)
1054 return;
1055
1056 if (PIM_DEBUG_VXLAN)
1057 zlog_debug("vxlan SG %s term oif changed from %s to %s",
1058 vxlan_sg->sg_str,
1059 vxlan_sg->term_oif ? vxlan_sg->term_oif->name : "-",
1060 ifp ? ifp->name : "-");
1061
1062 pim_vxlan_term_mr_del(vxlan_sg);
1063 vxlan_sg->term_oif = ifp;
1064 pim_vxlan_term_mr_add(vxlan_sg);
1065 }
1066
1067 static void pim_vxlan_term_oif_update(struct pim_instance *pim,
1068 struct interface *ifp)
1069 {
1070 if (pim->vxlan.term_if == ifp)
1071 return;
1072
1073 if (PIM_DEBUG_VXLAN)
1074 zlog_debug("vxlan term oif changed from %s to %s",
1075 pim->vxlan.term_if ? pim->vxlan.term_if->name : "-",
1076 ifp ? ifp->name : "-");
1077
1078 pim->vxlan.term_if = ifp;
1079 if (pim->vxlan.sg_hash)
1080 hash_iterate(pim->vxlan.sg_hash,
1081 pim_vxlan_term_mr_oif_update, ifp);
1082 }
1083
1084 void pim_vxlan_add_vif(struct interface *ifp)
1085 {
1086 struct pim_interface *pim_ifp = ifp->info;
1087 struct pim_instance *pim = pim_ifp->pim;
1088
1089 if (pim->vrf->vrf_id != VRF_DEFAULT)
1090 return;
1091
1092 if (if_is_loopback(ifp))
1093 pim_vxlan_set_default_iif(pim, ifp);
1094
1095 if (vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED &&
1096 (ifp == vxlan_mlag.peerlink_rif))
1097 pim_vxlan_set_peerlink_rif(pim, ifp);
1098
1099 if (pim->vxlan.term_if_cfg == ifp)
1100 pim_vxlan_term_oif_update(pim, ifp);
1101 }
1102
1103 void pim_vxlan_del_vif(struct interface *ifp)
1104 {
1105 struct pim_interface *pim_ifp = ifp->info;
1106 struct pim_instance *pim = pim_ifp->pim;
1107
1108 if (pim->vrf->vrf_id != VRF_DEFAULT)
1109 return;
1110
1111 if (pim->vxlan.default_iif == ifp)
1112 pim_vxlan_set_default_iif(pim, NULL);
1113
1114 if (pim->vxlan.peerlink_rif == ifp)
1115 pim_vxlan_set_peerlink_rif(pim, NULL);
1116
1117 if (pim->vxlan.term_if == ifp)
1118 pim_vxlan_term_oif_update(pim, NULL);
1119 }
1120
1121 /* enable pim implicitly on the termination device add */
1122 void pim_vxlan_add_term_dev(struct pim_instance *pim,
1123 struct interface *ifp)
1124 {
1125 struct pim_interface *pim_ifp;
1126
1127 if (pim->vxlan.term_if_cfg == ifp)
1128 return;
1129
1130 if (PIM_DEBUG_VXLAN)
1131 zlog_debug("vxlan term oif cfg changed from %s to %s",
1132 pim->vxlan.term_if_cfg ?
1133 pim->vxlan.term_if_cfg->name : "-",
1134 ifp->name);
1135
1136 pim->vxlan.term_if_cfg = ifp;
1137
1138 /* enable pim on the term ifp */
1139 pim_ifp = (struct pim_interface *)ifp->info;
1140 if (pim_ifp) {
1141 PIM_IF_DO_PIM(pim_ifp->options);
1142 /* ifp is already oper up; activate it as a term dev */
1143 if (pim_ifp->mroute_vif_index >= 0)
1144 pim_vxlan_term_oif_update(pim, ifp);
1145 } else {
1146 /* ensure that pimreg exists before using the newly created
1147 * vxlan termination device
1148 */
1149 pim_if_create_pimreg(pim);
1150 (void)pim_if_new(ifp, false /*igmp*/, true /*pim*/,
1151 false /*pimreg*/, true /*vxlan_term*/);
1152 }
1153 }
1154
1155 /* disable pim implicitly, if needed, on the termination device deletion */
1156 void pim_vxlan_del_term_dev(struct pim_instance *pim)
1157 {
1158 struct interface *ifp = pim->vxlan.term_if_cfg;
1159 struct pim_interface *pim_ifp;
1160
1161 if (PIM_DEBUG_VXLAN)
1162 zlog_debug("vxlan term oif cfg changed from %s to -",
1163 ifp->name);
1164
1165 pim->vxlan.term_if_cfg = NULL;
1166
1167 pim_ifp = (struct pim_interface *)ifp->info;
1168 if (pim_ifp) {
1169 PIM_IF_DONT_PIM(pim_ifp->options);
1170 if (!PIM_IF_TEST_IGMP(pim_ifp->options))
1171 pim_if_delete(ifp);
1172 }
1173 }
1174
1175 void pim_vxlan_init(struct pim_instance *pim)
1176 {
1177 char hash_name[64];
1178
1179 snprintf(hash_name, sizeof(hash_name),
1180 "PIM %s vxlan SG hash", pim->vrf->name);
1181 pim->vxlan.sg_hash = hash_create(pim_vxlan_sg_hash_key_make,
1182 pim_vxlan_sg_hash_eq, hash_name);
1183 }
1184
1185 void pim_vxlan_exit(struct pim_instance *pim)
1186 {
1187 if (pim->vxlan.sg_hash) {
1188 hash_clean(pim->vxlan.sg_hash,
1189 (void (*)(void *))pim_vxlan_sg_del_item);
1190 hash_free(pim->vxlan.sg_hash);
1191 pim->vxlan.sg_hash = NULL;
1192 }
1193 }
1194
1195 void pim_vxlan_terminate(void)
1196 {
1197 pim_vxlan_work_timer_setup(false);
1198 }