Commit Graph

290 Commits

Author SHA1 Message Date
Quentin Young
7fb29f49ab zebra: fix assert crash on corrupt vxlan msg
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15 14:20:22 -05:00
Chirag Shah
c1c292e777 zebra: fix debug in macvlan down event
fix a debug where display parent interface name
only if it exists.

Ticket:CM-27733

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-01-10 11:15:36 -08:00
Donald Sharp
0bd371c61e zebra: Refactor _add and _del to use a common function
The decoding of _add and _del functions is practically identical
do a bit of work and make them so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-06 20:25:51 -05:00
Donald Sharp
4824d144b6 zebra: Prevent zebra vxlan remote macip del buffer overflow
=================================================================
==13611==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe9e5c8694 at pc 0x0000004d18ac bp 0x7ffe9e5c8330 sp 0x7ffe9e5c7ae0
WRITE of size 17 at 0x7ffe9e5c8694 thread T0
    #0 0x4d18ab in __asan_memcpy (/usr/lib/frr/zebra+0x4d18ab)
    #1 0x7f16f04bd97f in stream_get2 /home/qlyoung/frr/lib/stream.c:277:2
    #2 0x6410ec in zebra_vxlan_remote_macip_del /home/qlyoung/frr/zebra/zebra_vxlan.c:7718:4
    #3 0x68fa98 in zserv_handle_commands /home/qlyoung/frr/zebra/zapi_msg.c:2611:3
    #4 0x556add in main /home/qlyoung/frr/zebra/main.c:309:2
    #5 0x7f16eea3bb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #6 0x431249 in _start (/usr/lib/frr/zebra+0x431249)

This decode is the result of a buffer overflow because we are
not checking ipa_len.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-06 20:22:56 -05:00
Philippe Guibert
dd90b4c86a
Merge pull request #4977 from chiragshah6/evpn_dev1
* evpn primary address advertisement
2019-11-26 17:56:59 +01:00
Chirag Shah
65e76a9bcf zebra: display proper field in debug statement
Ticket:CM-26622

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:39 -08:00
Chirag Shah
59260d4a07 zebra: handle macvlan down event
Macvlan down event have sentinel check of its parent
link presence.

Ticket:CM-26622
Reviewed By:CCR-9326
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:38 -08:00
Chirag Shah
28ad0501b9 zebra: print rmac and sys mac values
"show vrf vni" and "show evpn vni <l3vni>" commands
need to display correct router mac value.

"show evpn vni <l3vni>" detail l3vni needs to display
system mac as in PIP scenario value can be different.
Syste MAC would be derived from SVI interface MAC wherelse
Router MAC would be derived from macvlan interface MAC value.

Ticket:CM-26710
Reviewed By:CCR-9334
Testing Done:

TORC11# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  Local Vtep Ip: 36.0.0.11
  Vxlan-Intf: vx-4001
  SVI-If: vlan4001
  State: Up
  VNI Filter: none
  System MAC: 00:02:00:00:00:2e
  Router MAC: 44:38:39:ff:ff:01
  L2 VNIs: 1000
TORC11# show vrf vni
VRF     VNI    VxLAN IF   L3-SVI    State Rmac
vrf1    4001   vx-4001    vlan4001  Up    44:38:39:ff:ff:01

TORC11# show evpn vni 4001 json
{
  "vni":4001,
  "type":"L3",
  "localVtepIp":"36.0.0.11",
  "vxlanIntf":"vx-4001",
  "sviIntf":"vlan4001",
  "state":"Up",
  "vrf":"vrf1",
  "sysMac":"00:02:00:00:00:2e",
  "routerMac":"44:38:39:ff:ff:01",
  "vniFilter":"none",
  "l2Vnis":[
    1000,
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:35 -08:00
Chirag Shah
0056f687d7 zebra: evpn pip mac vlan up-down event
macvlan interface up/down event triggers
bgp to send updates for evpn routes
with changed RMAC and nexthop IP values.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:33 -08:00
Chirag Shah
0ca1058096 bgpd: evpn pip handle svi ip route
By default announct Self Type-2 routes with
system IP as nexthop and system MAC as
nexthop.

An API to check type-2 is self route via
checking ipv4/ipv6 address from connected interfaces list.

An API to extract RMAC and nexthop for type-2
routes based on advertise-svi-ip knob is enabled.

When advertise-pip is enabled/disabled, trigger type-2
route update. For self type-2 routes to use
anycast or individual (rmac, nexthop) addresses.

Ticket:CM-26190
Reviewed By:
Testing Done:

Enable 'advertise-svi-ip' knob in bgp default instance.
the vrf instance svi ip is advertised with nexthop
as default instance router-id and RMAC as system MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:32 -08:00
Chirag Shah
06d9cde5c7 zebra: evpn pip extract vrr mac
Extract mac-vlan interface mac when a l3vni add is sent to bgp

Per L3VNI maintain vrr interface.
An api to extract vrr mac address from a vlan id, associated
master svi device.

When a l3vni operational up event is sent to bgpd,
extract vrr rmac along with svi rmac.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:29 -08:00
Lakshman Krishnamoorthy
06931fdb12 zebra: "show evpn vni details json" prints incorrect JSON format
edge-2> show evpn vni detail json
{
  "vni":79031,
  "type":"L3",
  ...,
  ...
}                                       <<<<<< no comma

{
  "vni":79021,
  "type":"L3",
  ...,
  ...
}                                       <<<<<< no comma

{
}                                       <<<<<< blank
edge-2>

The fix is to pack json info into json_array before printing it.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-11-21 16:18:04 -08:00
Chirag Shah
651fa9053d zebra: evpn update remote rmac and nexhop
In symmetric routing case for evpn (type-2/type-5)
routes, nexthop and Router mac fields can change from
the originating VTEP.

At the receiving VTEP, bgp path info may points to different
nexthop IP (nh1->nh2) and Remote MAC remain the same.
When the bgp sync the route with nexthop and RMAC fields.
For the exisitng rmac entry update/replace with the new
nexthop (VTEP) IP in remote rmac db in Zebra.

Similarly, bgp path info may points different Router-mac
(RMAC1->RMAC2) and the nexthop value remains the same.
In this case, update to the new RMAC value for the
existing remote nexthop in the Zebra' nexthop cache db.

Ticket:CM-26917
Reviewed By:CCR-9435
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-07 10:49:18 -08:00
Donald Sharp
d1accb2e19 zebra: zvni_map_to_svi may return NULL act accordingly
The zvni_map_to_svi function may return NULL as such prevent
a deref and crash.  Found via coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-28 20:52:40 -04:00
Chirag Shah
3dacbb9d24 bgpd: fix advertise-svi-ip upon vni-svi up-down
When a VxLAN interface comes up new vni up event is sent
to bgpd, which triggers bgpd to sync advertise-svi-macip
to zebra. At this point, vni is present but the associated
SVI may not be present.
When SVI comes up, vni add event sent to bgpd (with associated
vrf update). Bgpd already has vni present so
advertise-svi-macip is not synced to Zebra.

To fix,
When advertise-svi-macip flag is synced first time, cache it in
zebra context even though vni associated SVI is not present.
when SVI comes up, interface address add event triggers
new MAC-IP route add to bgpd.

Ticket:CM-26038
Reviewed By:CCR-9254
Testing Done:

Validated via running a sequence of steps in symmetric
routing topology.
- Enable advertise-svi-macip at l2vni level under bgp default
instance (afi/safi, l2vpn/evpn)
- Flap l2vni associated SVI interface.
- Check the output of 'show bgp l2vpn evpn route' command for
MAC-IP route of the SVI's (MAC and IP address).

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-09-23 21:14:04 -07:00
Mark Stapp
478566d68b zebra: avoid using zebra datastructs in evpn dataplane path
Some netlink-facing code used for evpn/vxlan programming was
being run in the dataplane pthread, but accessing zebra core
datastructs. Move some additional data into the dataplane
context, and use it in the netlink path instead.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-09-05 12:58:58 -04:00
Mark Stapp
e0e140a745 zebra: protect some vxlan debugs
Some VXLAN debugs weren't covered by 'if debug...' tests.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-09-05 11:12:00 -04:00
Mark Stapp
0bbd4ff442 zebra: move EVPN VTEP programming to dataplane
Move VTEP install/uninstall to the zebra dataplane. Remove
synch kernel-facing apis and helper functions.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-09-04 10:30:17 -04:00
Mark Stapp
931fa60c09 zebra: Use dataplane for evpn neighbor changes
Move neighbor programming to the dataplane; remove
old apis; remove some ifdef'd use of direct netlink
code points, using neutral values outside of the netlink-
specific files.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-08-23 14:10:41 -04:00
Donald Sharp
ad4c7e8d4e
Merge pull request #4778 from mjstapp/dplane_macs
zebra: use dataplane for evpn macs
2019-08-21 20:26:29 -04:00
Donald Sharp
f79f7a7bb2 *: Fix spelling errors pointed out by debian packaging
Debian packaging when run finds a bunch of spelling errors:

I: frr: spelling-error-in-binary usr/bin/vtysh occurences occurrences
I: frr: spelling-error-in-binary usr/lib/frr/bfdd Amount of times Number of times
I: frr: spelling-error-in-binary usr/lib/frr/bgpd occurences occurrences
I: frr: spelling-error-in-binary usr/lib/frr/bgpd recieved received
I: frr: spelling-error-in-binary usr/lib/frr/isisd betweeen between
I: frr: spelling-error-in-binary usr/lib/frr/ospf6d Infomation Information
I: frr: spelling-error-in-binary usr/lib/frr/ospfd missmatch mismatch
I: frr: spelling-error-in-binary usr/lib/frr/pimd bootsrap bootstrap
I: frr: spelling-error-in-binary usr/lib/frr/pimd Unknwon Unknown
I: frr: spelling-error-in-binary usr/lib/frr/zebra Requsted Requested
I: frr: spelling-error-in-binary usr/lib/frr/zebra uknown unknown
I: frr: spelling-error-in-binary usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0 overriden overridden

This commit fixes all of them except the bgp `recieved` issue due to
it being part of json output.  That one will need to go through
a deprecation cycle.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-19 10:36:53 -04:00
Chirag Shah
838cef6d7e zebra: fix advertise svi ip as macip route
PR #3745 added EVPN feature to advertise individual
SVI-IPs as MAC-IP routes.
Fix a condition in zebra to send MAC and IP pair
to bgpd when the feature is enabled.

Testing Done:

Originator VTEP:
TORC11:~# ip -br addr show VxU-1002
VxU-1002         UP             45.0.2.2/24 2001:fee1:0:2::2/64

show bgp l2vpn evpn vni 1004
VNI: 1004 (known to the kernel)
  Type: L2
  Tenant-Vrf: default
  RD: 27.0.0.11:3
  Advertise-svi-macip : Yes
  Import Route Target:
    10:1004
  Export Route Target:
    10:1004

Remote vtep evpn route output for 45.0.4.2:

BGP routing table entry for 27.0.0.11:3:[2]:[0]:[48]:[00:02:00:00:00:2f]:[32]:[45.0.4.2]
Paths: (2 available, best #1)
  Advertised to non peer-group peers:
  MSP1(uplink-1) MSP2(uplink-2)
  Route [2]:[0]:[48]:[00:02:00:00:00:2f]:[32]:[45.0.4.2] VNI 1004
  64435 65546
    36.0.0.11 from MSP1(uplink-1) (27.0.0.9)
      Origin IGP, valid, external, bestpath-from-AS 64435, best (First path received)
      Extended Community: RT:10:1004 ET:8
      Last update: Thu Aug  8 18:09:13 2019

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-08-08 12:01:19 -07:00
Mark Stapp
036d93c047 zebra: use dataplane for vxlan remote mac programming
Move vxlan remote MAC install and uninstall to the async
dataplane.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-08-02 14:54:16 -04:00
Chirag Shah
6041b6864d zebra: del auto mac when vni is down
Delete an auto MAC with no neighbor associated,
when its VNI is down.

In Following sequence stale MAC entry retained in
FRR (zebra).
- Local MAC-IP pair
- MAC is deleted in bridge fdb table
- VNI is down, triggers IP (neigh) entries removed
from FRR DB.
- MAC retained as AUTO MAC with neigh list count 0.
- When VNI is UP again, stale MAC entry retained in FRR
DB.
When the MAC-IP pair moves behind remote VTEP, local VTEP
fails to add remote entry as its MAC is in auto state.

Ticket:CM-25504
Reviewed By:
Testing Done:

Validated the sequence with fix and auto MAC is deleted
when VNI is down.
When VNI comes up, the remote MAC-IP is added to FRR (Zebra)
and kernel.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-08-01 13:21:01 -07:00
Chirag Shah
27547880d4 zebra: add info evpn to debugs
Add info info in local mac del debug,
the local sequence and assoicated neigh count.

remote_mac_ip_add modify debug to display
flags value to cover local, remote and auto flags
for the MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-08-01 13:21:00 -07:00
Donald Sharp
8f86bb067e zebra: Guard debug messages
A bunch of debug code has snuck in that is unguarded.
Fix this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-16 20:30:55 -04:00
Jafar Al-Gharaibeh
5f7faeb041
Merge pull request #4635 from AnuradhaKaruppiah/evpn-pim-replay
pimd, zebra: request for replay of VxLAN SG entries on pimd startup
2019-07-15 15:40:12 -05:00
Mark Stapp
c9049b920f lib,zebra: avoid use of ctime in monotime api
Replace a call to ctime with ctime_r in the monotime module;
update the callers of the monotime api.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-07-10 10:16:59 -04:00
Anuradha Karuppiah
ecbbc3a750 pimd, zebra: request for replay of SG entries on startup
zvni setup in zebra is controlled via bgpd i.e. advertise_all_vni
from bgpd triggers this setup. As a part of zvni creation we may need
to setup BUM mcast SG entries which are propagated to pimd for MDT setup.

Now pimd may not be present at the time of zvni creation or may restart
post zvni creation so we need a mechanism to replay (on pimd startup) and
to cleanup (on pimd stop). This is addressed via zebra_vxlan_sg_replay and
zebra_evpn_pim_cfg_clean_up.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-07-03 10:11:53 -07:00
Chirag Shah
b6587fc2af zebra: evpn entries are not cleaned upon frr stop
As part of PR 4458, when a client (bgpd) goes down,
zebra cleans up any evpn state including remotely learned
neighs, macs and vteps are suppose to be cleaned up,
uninstall from kernel tables.

Neighs (arps), macs and vteps (HREP entries) were not
removed from kernel tables as the uninstall flag as not set.

Clean up l3vni associated remote neighs, macs and vteps.

Ticket:CM-25468
Reviewed By:CCR-8889
Testing Done:

Validated in evpn symmetric routing topology where
remotely learned l2/l3 vnis neigh, macs and remote
vtep (hrep) entries are installed in kernel table,
perform systemctl stop frr.service and validated
all remotely learned entries cleaned up from kernel
tables.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-07-02 07:55:05 -07:00
Sri Mohana Singamsetty
f3afd0a4e1
Merge pull request #4575 from nitinsoniism/show_mac_arp_cache_vni_json_fix
zebra: show evpn mac vni xx json output is broken
2019-06-25 17:03:14 -07:00
Donald Sharp
5bc97e1b54
Merge pull request #4458 from karamalla0406/frr4123
zebra: Clean up BGP EVPN configuration when the client, BGPD, goes down
2019-06-25 11:30:14 -04:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Donald Sharp
a12bb225a6
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
2019-06-22 13:35:45 -04:00
Donald Sharp
efe42c51c4
Merge pull request #4294 from adharkar/frr-master-fpm_rmac
Zebra: EVPN remote RMAC download via FPM channel using netlink msg format
2019-06-22 13:28:49 -04:00
Nitin Soni
40e0224a9e zebra: show evpn mac vni xx json output is broken
Also fixes some issues related to -
show evpn arp-cache vni xx vtep yy

Ticket: CM-25380
Signed-off-by: Nitin Soni<nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8858
Testing-Done: Evpn scale test with 30K neighs
2019-06-21 06:30:46 -07:00
Kishore Aramalla
27627f9a11 zebra: Clean up BGP EVPN configuration when the client, BGPD, goes down
When BGP daemon is down, Clean up its configuration state from zebra.
When the BGP daemon is up again, it will push its configuration to zebra

Delete the MAC and neighbor information received on the BGP session,
while retaining the local MAC and local ARP entries.

Signed-off-by: Kishore Aramalla karamalla@vmware.com
2019-06-19 14:45:21 -07:00
Nitin Soni
503cf3feb3 zebra: When displaying show evpn mac vni XX add local and remote seq
Add the local and remote sequence number to the `show evpn mac vni XX`
command.

VNI 1000213 #MACs (local and remote) 2

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
00:02:00:00:00:21 local  swp5                  213   0/0
00:02:00:00:00:43 local  vlan213               213   0/0

VNI 1000214 #MACs (local and remote) 2

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
00:02:00:00:00:22 local  swp6                  214   0/0
00:02:00:00:00:43 local  vlan214               214   0/0

VNI 1000112 #MACs (local and remote) 5

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
00:02:00:00:00:1b remote 6.0.0.2                     0/0
00:02:00:00:00:24 remote 6.0.0.31                    0/0
00:02:00:00:00:17 remote 6.0.0.1                     0/0
00:02:00:00:00:20 local  swp4                  112   0/0
00:02:00:00:00:43 local  vlan112               112   0/0

VNI 1000111 #MACs (local and remote) 5

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
00:02:00:00:00:1f local  swp3                  111   0/0
00:02:00:00:00:23 remote 6.0.0.31                    0/0
00:02:00:00:00:16 remote 6.0.0.1                     0/0
00:02:00:00:00:1a remote 6.0.0.2                     0/0
00:02:00:00:00:43 local  vlan111               111   0/0

Ticket: CM-25120
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8836
Testing-Done:
2019-06-18 02:11:40 -07:00
Ameya Dharkar
a780a73896 Zebra: Handle RMAC add/delete operation and add fpm_mac_info_t
- Define a hook "zebra_mac_update" which can be registered by multiple
  data plane components (e.g. FPM, dplane).

DEFINE_HOOK(zebra_rmac_update, (zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, bool
	    delete, const char *reason), (rmac, zl3vni, delete, reason))

- While performing RMAC add/delete for an L3VNI, call "zebra_mac_update" hook.

- This hook call triggers "zfpm_trigger_rmac_update". In this function, we do a
  lookup for the RMAC in fpm_mac_info_table. If already present, this node is
  updated with the latest RMAC info. Else, a new fpm_mac_info_t node is created
  and inserted in the queue and hash data structures.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-06-17 12:05:38 -07:00
Philippe Guibert
a41c4e1b1f *: change interface structure, from vrf_id to vrf
Field vrf_id is replaced by the pointer of the struct vrf *.
For that all other code referencing to (interface)->vrf_id is replaced.
This work should not change the behaviour.
It is just a continuation work toward having an interface API handling
vrf pointer only.

some new generic functions are created in vrf:
vrf_to_id, vrf_to_name,

a zebra function is also created:
zvrf_info_lookup

an ospf function is also created:
ospf_lookup_by_vrf

it is to be noted that now that interface has a vrf pointer, some more
optimisations could be thought through all the rest of the code. as
example, many structure store the vrf_id. those structures could get
the exact vrf structure if inherited from an interface vrf context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 14:10:28 +02:00
Donald Sharp
93b35b87fe zebra: When displaying show evpn arp-cache vni XX add local and remote seq
Add the local and remote sequence number to the `show evpn arp-cache vni XX` command.

VNI 1000111 #ARP (IPv4 and IPv6, local and remote) 15

IP                       Type   State    MAC               Remote VTEP           Seq #'s
fe80::202:ff:fe00:15     remote active   00:02:00:00:00:15 6.0.0.31              0/0
fe80::202:ff:fe00:8      local  active   00:02:00:00:00:08                       0/0
60.1.1.111               local  active   00:02:00:00:00:08                       0/0
2060:1:1:1::11           local  active   00:e0:ec:38:49:a1                       0/0
fe80::202:ff:fe00:11     remote active   00:02:00:00:00:11 6.0.0.30              0/0
2060:1:1:1::211          remote active   00:02:00:00:00:11 6.0.0.30              0/0
2060:1:1:1::121          remote active   00:02:00:00:00:0c 6.0.0.29              0/0
60.1.1.211               remote active   00:02:00:00:00:11 6.0.0.30              0/0
fe80::202:ff:fe00:c      remote active   00:02:00:00:00:0c 6.0.0.29              0/0
60.1.1.11                local  active   00:e0:ec:38:49:a1                       0/0
fe80::2e0:ecff:fe38:49a1 local  active   00:e0:ec:38:49:a1                       0/0
60.1.1.221               remote active   00:02:00:00:00:15 6.0.0.31              0/0
2060:1:1:1::111          local  active   00:02:00:00:00:08                       0/0
2060:1:1:1::221          remote active   00:02:00:00:00:15 6.0.0.31              0/0
60.1.1.121               remote active   00:02:00:00:00:0c 6.0.0.29              0/0

The seq numbers are at 0/0 because we have had no mobility events.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 15:11:17 -04:00
Ameya Dharkar
9d21b7c6f0 Zebra: Handle VxLAN encap in netlink rtmsg for FPM
- For data plane processing of VxLAN routes, add encap type and L3VNI info to
  rtmsg message for FPM.
- Add "RTA_ENCAP_TYPE" attribute for VxLAN encap with value 100.
  This value is not currently used for RTA_ENCAP_TYPE for any encap.
- If "RTA_ENCAP_TYPE" is 100, add "RTA_ENCAP" attribute with "RTA_VNI" as a
  nested attribute of RTA_ENCAP

Format of RTA_VNI attribute:
Len(2 bytes)       type (2 bytes)      Value(4 bytes)(VNI)
   00    08     :     00    00     :      1000

RTA_VNI attribute is a custom attribute.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2019-05-17 10:50:21 -07:00
Quentin Young
d8b87afe7c lib: hashing functions should take const arguments
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-05-14 21:23:08 +00:00
Chirag Shah
5756dd1d07 zebra: unset sticky mac upon local deletion
if the local sticky mac delete request is received,
if there are associated neighbor entries present, mac's
only local flag is removed and marked as auto mac.

this results in next local mac learning automatically assumes
mac is sticky.

There is a case when bridge learning off is configured, user
configures sticky mac via bridge fdb add.
This MAC learns associated neighbor entry.
Later user deletes stick mac via bridge fdb del, this triggers
frr to delete mac but if there are neighbors present, frr marks
MAC as AUTO but does not remove sticky flag.
User enables bridge learning on which triggers
The mac to learn as dynamic entry and in absence of this
fix, the mac is marked as sticky.

Ticket:CM-24968
Reviewed By:CCR-8683
Testing Done:

Validated broken condition with internally reproduction
with fix and without.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-05-10 11:10:42 -07:00
Quentin Young
694bd4ce20 zebra: suppress unused variable warning
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-01 19:30:31 +00:00
Donald Sharp
8a64de72ff zebra: Fix incorrect reading of REMOTE_VTEP_[ADD|DEL]
With flooding control added recently we were not properly handling
the new flood control parameter in zebra_vxlan.c handler functions.
The error message that was being repeatedly seen:

2019/05/01 00:47:32 ZEBRA: [EC 100663311] stream_get2: Attempt to get out of bounds
2019/05/01 00:47:32 ZEBRA: [EC 100663311] &(struct stream): 0x7f0f04001740, size: 22, getp: 22, endp: 22

The fix was to ensure that both the _add and _del functions kept proper
sizing of amount of data read *and* the _del function was not
reading the flood_control data from the stream.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-30 21:29:03 -04:00
Lou Berger
31e944a8a7
Merge pull request #3045 from opensourcerouting/atoms
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-30 10:26:35 -04:00
Russ White
50dd75dd1f
Merge pull request #4126 from karamalla0406/4113
zebra: L3VNI's are allowed to unconfigure from any VRF
2019-04-25 18:40:52 -04:00
Anuradha Karuppiah
aa0677b4b6 zebra: use "mcast group" instead of just mcast in show and logs
Fixup done in response to Jafar's review comments.

root@act-7726-03:~# vtysh -c  "show interface vxlan1000111"
Interface vxlan1000111 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: default
  index 95 metric 0 mtu 1500 speed 0
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 7e:1d:c1:d5:d1:cc
  Interface Type Vxlan
  VxLAN Id 1000111 VTEP IP: 6.0.0.28 Access VLAN Id 111
  Mcast Group 239.1.1.111 >>>>>>>>>>
  Master (bridge) ifindex 99
root@act-7726-03:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-21 07:24:20 -07:00
Anuradha Karuppiah
4ab3321f29 lib, zebra: changes to propagate vxlan mcast SG entries to pimd
These updates act as triggers to pimd to -
1. join the MDT for rxing VxLAN encapsulated BUM traffic
2. register the local-vtep-ip as a source for the MDT

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00