Commit Graph

375 Commits

Author SHA1 Message Date
Philippe Guibert
951745bdab bgpd: ability to export prefixes entries to a kernel table identifier
this table identifier can be used for policy routing. incoming entries
are locally exported to that local table identifier.
note that so that the user applies the new table identifier to all
entries, the user should flush local tables first.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-10 16:06:51 +02:00
Donald Sharp
3835984f1c bgpd: bgp pointer may be null
The bgp pointer may not be actually found.  The debug
message that was using it could get the same value
another way.  Convert over

Fixes Coverity Scan Issue:

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-03 08:57:55 -04:00
Donald Sharp
3c3c325203 *: Convert zapi->interface_delete to ifp callback
Convert the callback of the interface_delete to the new
ifp callback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
b0b69e59f4 *: Convert interface_down to interface down callback
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ddbf3e6060 *: Convert from ->interface_up to the interface callback
For all the places we have a zclient->interface_up convert
them to use the interface ifp_up callback instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ef7bd2a3d5 *: Switch all zclient->interface_add to interface create callback
Switch the zclient->interface_add functionality to have everyone
use the interface create callback in lib/if.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
138c5a7450 *: Add infrastructure to support zapi interface callbacks
Start the conversion to allow zapi interface callbacks to be
controlled like vrf creation/destruction/change callbacks.

This will allow us to consolidate control into the interface.c
instead of having each daemon read the stream and react accordingly.
This will hopefully reduce a bunch of cut-n-paste stuff

Create 4 new callback functions that will be controlled by
lib/if.c

create -> A upper level protocol receives an interface creation event
The ifp is brand spanking newly created in the system.
up -> A upper level protocol receives a interface up event
This means the interface is up and ready to go.
down -> A upper level protocol receives a interface down
destroy -> A upper level protocol receives a destroy event
This means to delete the pointers associated with it.

At this point this is just boilerplate setup for future commits.
There is no new functionality.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Philippe Guibert
f449d22396 bgp, zebra, lib: add protocol support for iptables
in addition to support for tcpflags, it is possible to filter on any
protocol. the filtering can then be based with iptables.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-07-08 08:36:45 +02: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
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
Philippe Guibert
da85f5e038 lib, bgpd, ospfd, pimd, zebra, rip, ripng, bfd: change if_update_to_new_vrf() api
vrf_id parameter is replaced with struct vrf * parameter. It is
needed to create vrf structure before entering in the fuction.
an error is generated in case the vrf parameter is missing.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:58 +02:00
Philippe Guibert
f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Faicker Mo
8f2b2139bf bgpd: Set bgp default nexthop value of IPv6
Set the bgp default nexthop value of IPv6 to the local ipv6 addr of the
tcp connection like IPv4. Fixed the problem of route with empty nexthop
advertised to the peer when zebra is not running.

* bgp_zebra.c: (bgp_zebra_nexthop_set) Set IPv6 bgp default nexthop value.

Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
2019-05-31 11:37:04 +08:00
Sri Mohana Singamsetty
979dd989c4
Merge pull request #4413 from donaldsharp/bgp_distance_comes_closer
Bgp distance comes closer
2019-05-30 09:45:43 -07:00
Donald Sharp
38a8c751a4 bgpd: Always send down correct admin distance
In all cases that we are sending routes down to zebra send the
correct admin distance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-29 08:56:03 -04:00
Chirag Shah
1ee069db0f bgpd: fix debug to have proper nhop display
Display nexthop based on route type.

Ticket:CM-25129
Testing Done:

evpn route:
*  [2]:[0]:[0]:[48]:[aa:aa:aa:aa:01:1a]:[32]:[45.0.2.111]
    36.0.0.25              0 64000 5560 i

old:
BGP: Tx route add VRF 46 45.0.2.111/32 metric 0 tag 0 flags 0x1409 nhnum 1
BGP:   nhop [1]: 2400:1d:: if 50 VRF 46

New:
BGP: import evpn prefix [2]:[aa:aa:aa:aa:01:1a]:[45.0.2.111]/224 as
ip prefix 45.0.2.111/32 in vrf vrf1

BGP: bgp_zebra_announce: p=45.0.2.111/32, bgp_is_valid_label: 2
BGP: Tx route add VRF 46 45.0.2.111/32 metric 0 tag 0 flags 0x1409 nhnum 1
BGP:   nhop [1]: 36.0.0.25 if 50 VRF 46

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-05-28 14:05:36 -07:00
Philippe Guibert
0945d5ed01 bgp, ospfd, ospf6d, pimd, lib, isisd: add bfd_client_sendmsg vrf_id
vrf_id parameter is added to the api of bfd_client_sendmsg().
this permits being registered to bfd from a separate vrf.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07 15:53:07 +02:00
Quentin Young
121f9dee7c *: use ZAPI_CALLBACK_ARGS macro for zapi handlers
This macro:
- Marks ZAPI callbacks for readability
- Standardizes argument names
- Makes it simple to add ZAPI arguments in the future
- Ensures proper types
- Looks better
- Shortens function declarations

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-03 20:57:35 +00:00
Anuradha Karuppiah
76d07c7aa1 bgpd: maintain flood mcast group per-l2-vni
If PIM-SM if used for BUM flooding the multicast group address can be
configured per-vxlan-device. BGP receives this config from zebra via
the L2 VNI add/update.

Sample output -
root@TORS1:~# vtysh -c "show bgp l2vpn evpn vni 1000" |grep Mcast
  Mcast group: 239.1.1.100
root@TORS1:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00
Lou Berger
817489896f
Merge pull request #3762 from pguibert6WIND/do_not_alloc_lists_fs_by_def
bgpd: do not allocate lists on fs entries of bgp entries.
2019-04-16 11:24:48 -04:00
Philippe Guibert
f592523460 bgpd: use listnode_add_force to force allocation of entries if needed
force allocation of entries in order to save memory and then save memory
for people that do not use flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-03-29 15:04:51 +01:00
Tuetuopay
d074383c62
Merge branch 'master' into evpn-session-vrf 2019-03-28 18:41:38 +01:00
Philippe Guibert
3e3708cbd3 bgpd: do not allocate lists on fs entries of bgp entries.
bgp entries in bgp_extra_path structure will be allocated as lists, only
when needed, that is to say when bgp fs entries will be received and
installed on the underlying system.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-03-28 16:57:59 +01:00
Tuetuopay
f920dd6dc9 bgpd, zebra: Redo checks to advertise_all_vni
This replaces manual checks of the flag with a wrapper macro to convey
the meaning "is evpn enabled on this vrf?"

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-22 13:37:06 +01:00
Tuetuopay
e2f3a930c5 bgpd: Allow non-default instance to be EVPN one
This makes the instance bearing the advertise-all-vni config option
register to zebra as the EVPN one, forwarding it the option.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:14 +01:00
Don Slice
401d56cc52 bgpd: fix redistribution into vrf when networking is restarted
Found that previous fix for this issue caused collatoral damage and
reverted that fix.  This fix clears the vrf_bitmaps when the vrf is
disabled/deleted and then re-applies the redist config when the vrf
is re-enabled.

Ticket: CM-24231
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-14 15:17:47 +00:00
Don Slice
fc2408ec18 bgpd: move bgp_update_redist_vrf_bitmaps to bgp_zebra.c for wider use beyond bgp_vty
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-14 15:05:38 +00:00
Don Slice
7e20406f03 Revert "bgpd: fix updating redist bitmask when vrf_id changes"
This reverts commit 48c74f8825.
2019-03-14 15:03:15 +00:00
David Lamparter
d3b05897ed
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
2019-03-06 15:54:44 +01:00
Sri Mohana Singamsetty
29da198289
Merge pull request #3882 from vivek-cumulus/refine_evpn_route_add
Refine install of EVPN-based routes to remove some special handling
2019-03-01 09:15:26 -08:00
vivek
2b83602b24 *: Explicitly mark nexthop of EVPN-sourced routes as onlink
In the case of EVPN symmetric routing, the tenant VRF is associated with
a VNI that is used for routing and commonly referred to as the L3 VNI or
VRF VNI. Corresponding to this VNI is a VLAN and its associated L3 (IP)
interface (SVI). Overlay next hops (i.e., next hops for routes in the
tenant VRF) are reachable over this interface. Howver, in the model that
is supported in the implementation and commonly deployed, there is no
explicit Overlay IP address associated with the next hop in the tenant
VRF; the underlay IP is used if (since) the forwarding plane requires
a next hop IP. Therefore, the next hop has to be explicit flagged as
onlink to cause any next hop reachability checks in the forwarding plane
to be skipped.

https://tools.ietf.org/html/draft-ietf-bess-evpn-prefix-advertisement
section 4.4 provides additional description of the above constructs.

Use existing mechanism to specify the nexthops as onlink when installing
these routes from bgpd to zebra and get rid of a special flag that was
introduced for EVPN-sourced routes. Also, use the onlink flag during next
hop validation in zebra and eliminate other special checks.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-27 12:54:24 +00:00
vivek
e1e71450a0 zebra, bgpd: Use L3 interface for VRF's VNI in route install
In the case of EVPN symmetric routing, the tenant VRF is associated with
a VNI that is used for routing and commonly referred to as the L3 VNI or
VRF VNI. Corresponding to this VNI is a VLAN and its associated L3 (IP)
interface (SVI). Overlay next hops (i.e., next hops for routes in the
tenant VRF) are reachable over this interface.

https://tools.ietf.org/html/draft-ietf-bess-evpn-prefix-advertisement
section 4.4 provides additional description of the above constructs.

Use the L3 interface exchanged between zebra and bgp in route install.
This patch in conjunction with the earlier one helps to eliminate some
special code in zebra to derive the next hop's interface.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-27 12:25:53 +00:00
vivek
0483af6e4c zebra, bgpd: Exchange L3 interface for VRF's VNI
In the case of EVPN symmetric routing, the tenant VRF is associated with
a VNI that is used for routing and commonly referred to as the L3 VNI or
VRF VNI. Corresponding to this VNI is a VLAN and its associated L3 (IP)
interface (SVI). Overlay next hops (i.e., next hops for routes in the
tenant VRF) are reachable over this interface.

https://tools.ietf.org/html/draft-ietf-bess-evpn-prefix-advertisement
section 4.4 provides additional description of the above constructs.

The implementation currently derives this L3 interface for EVPN tenant
routes using special code that looks at route flags. This patch
exchanges the L3 interface between zebra and bgpd as part of the L3-VNI
exchange in order to eliminate some this special code.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-27 11:52:34 +00:00
Renato Westphal
dc94fe42a4 bgpd: add missing checks for vpnv6 nexthop lengths
A few code paths weren't handling the vpnv6 nexthop lenghts as
expected, which was leading to problems like imported vpnv6 routes
not being marked as valid when they should. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-26 19:02:24 -03:00
Quentin Young
9f5dc3192e *: remove casts of XMALLOC / XCALLOC
No cast necessary for void *

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Quentin Young
0a22ddfbb1 *: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Chirag Shah
a80161574c bgpd: advertise svi ip as macip zebra parse api
Ticket:CM-23782

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-02-06 19:57:40 -08:00
rgirada
b4897fa524 bgpd: Added changes to track route-map usage
Made changes and updated the routemap applied counter in the following flows.
1.Increment when route map attached to a list.
2.Decrement when route map removed / modified from a  list.
3.Increment/decrement when route map create/delete callback triggered.
4.Besides ,This counter need not be updated when a route map is got updated.
  i.e changing/adding a match value to the existing routemap.

In BGP , same update api called for all three add/delete/update operation .
But this counter have to be updated only for routemap addition.
Addressed this specific change by identifying the routemap operation based
on routemap pointer.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
2019-02-04 05:27:56 -08:00
Donald Sharp
2b697c3d47
Merge pull request #3414 from pguibert6WIND/iprule_any_flowspec_handling_2
Iprule any flowspec handling
2019-01-29 14:01:38 -05:00
Philippe Guibert
ce3c06147c bgpd: display the list of iprules attached to a fs entry
the list of iprules is displayed in the 'show bgp ipv4 flowspec detail'
The list of iprules is displayed, only if it is installed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-29 14:15:10 +01:00
Philippe Guibert
8112a7a072 bgpd: change priority of fs pbr rules
two kind of rules are being set from bgp flowspec: ipset based rules,
and ip rule rules. default route rules may have a lower priority than
the other rules ( that do not support default rules). so, if an ipset
rule without fwmark is being requested, then priority is arbitrarily set
to 1. the other case, priority is set to 0.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-29 14:15:10 +01:00
Philippe Guibert
ffee150ec4 bgpd: notify callback when ip rule from/to rule has been configured
because ip rule creation is used to not only handle traffic marked by
fwmark; but also for conveying traffic with from/to rules, a check of
the creation must be done in the linked list of ip rules.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-29 14:15:10 +01:00
Philippe Guibert
6cfe5d1533 bgpd: ip rule zebra layer adapted to handle both cases
now, ip rule can be created from two differnt ways; however a single
zebra API has been defined. so make it consistent by adding a parameter
to the bgp zebra layer. the function will handle the rest.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-29 14:15:10 +01:00
Anuradha Karuppiah
ec0ab5443f bgpd: reinstate current bgp best route on an inactive neigh del
When an inactive-neigh delete is rxed bgp will not have a local path to
remove (and re-run path selection). Instead it simply re-installs the
current best remote path if any.

Ticket: CM-23018
Testing Done: evpn-min

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-01-25 14:19:26 -05:00
Donald Sharp
6a69ac5138 bgpd: Add code to track the addition/removal of mac addresses
When a mac address is added/changed/deleted track it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12 16:11:45 -05:00
Lou Berger
9bdb632c68
Merge pull request #3093 from donaldsharp/bgp_node_continued
Bgp node continued
2018-12-11 11:13:25 -05:00
Russ White
19e5a46591
Merge pull request #3176 from chiragshah6/evpn_dev
zebra: duplicate address detection and dampening
2018-11-25 22:17:33 -05:00
F. Aragon
d90b788e38
bgpd isisd lib: fix return on void functions
ISO C forbids ‘return’ with expression, in function returning void.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-11-20 16:32:25 +01:00
Chirag Shah
0b9d9cd013 bgpd: dup addr detect config cli
Duplicate address detection configuration clis
under bgp l2vpn evpn config mode.
- Enabled/Disable (global knob) for feature.
- Configure cli for duplicate detection action
freeze and freze until time (auto-recovery).

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:16 -08:00
Donald Sharp
6f94b685d0 bgpd: Abstract bgp_info retrieving/setting from info pointer
The bgp_info data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-16 09:43:35 -05:00
Donald Sharp
26f63a1ec6 *: Replace zclient_new with zclient_new_notify
It's been a year since we added the new optional parameters
to instantiation.  Let's switch over to the new name.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-12 09:16:23 -05:00
Donald Sharp
1ee0a2df0d bgpd: Allow registration of nexthops after zebra connection
If we attempt to register nexthops before we have the zebra
connection, they will not be installed.  After we have noticed
that we are up, re-install them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:31:41 -04:00
Donald Sharp
bb4ef1aec8 bgpd: Add some debugs to note when we are not talking to zebra
Allow some debug notification when we are unable to talk
to zebra due to the connection not being there yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:31:41 -04:00
Russ White
79e8a97c1a
Merge pull request #3024 from ton31337/fix/validate_route-map
bgpd: Check if route-map really exists before applying to the peer
2018-10-14 08:48:48 -04:00
Donald Sharp
fd06964433 bgpd: Add '[no] flood <disable|head-end-replication>'
Add the '[no] flood <disable|head-end-replication>' command
to the l2vpn evpn afi/safi sub commands for bgp.  This command
when entered as 'flood disable' will turn off type 3 route
generation for the transmittal of the type 3 route necessary
for BUM replication on the remote VTEP.  Additionally it will
turn off the BUM handling via the new zebra command,
ZEBRA_VXLAN_FLOOD_CONTROL.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:27:28 -04:00
Donald Sharp
fbac9605a7 lib, zebra: Allow the specification of BUM flooding
Allow the modification of whether or not we will allow
BUM flooding on the vxlan bridge.  To do this allow
the upper level protocol to specify via the ZEBRA_VXLAN_FLOOD_CONTROL
zapi message.

If flooding is disabled then BUM traffic will not be forwarded
to other VTEP's.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:22:19 -04:00
Donatas Abraitis
1de2762153 bgpd: Check if route-map really exists before applying to the peer
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-11 10:56:12 +03:00
Donald Sharp
40381db785 bgpd: Rename various variable names to something more appropriate
ri -> pi
bi -> bpi
info -> path
info -> rmap_path ( for routemap applications )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:26:30 -04:00
Donald Sharp
9b6d8fcf29 bgpd: Convert binfo to path
Convert the binfo variable to path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:26:30 -04:00
Donald Sharp
18ee831031 bgpd: Convert all bgp_info_XXX functions to bgp_path_XXX functions
Rename all bgp_info_XXX functions to bgp_path_XXX functions

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
Donald Sharp
4b7e606625 bgpd: Convert struct bgp_info to struct bgp_path_info
Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`.
This commit will setup the rename of variables as well.

This is being done because `struct bgp_info` is not descriptive
of what this data actually is.  It is path information for routes
that we keep to build the actual routes nexthops plus some extra
information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
Donald Sharp
1defdda8e8 bgpd: Convert BGP_INFO_XXX to BGP_PATH_XXX
Search and replace all BGP_INFO_XXX to BGP_PATH_XXX

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Donald Sharp
85751d1d33 bgpd: Don't necessarily ignore interface callbacks
In bgp if we have not configured bgp we were ignoring
interface based callbacks.  Leading to states where
we may not be processing interface information.
Leading to states where we do not actually keep
ifp data.  As an example:

Suppose vrf A and vrf B.  A has interface swp1.
At the same time we only have a `router bgp 9 vrf B`
When we received the callback for moving swp1
from vrf A to vrf B we were not processing the
move at all and BGP would not consider the interface
part of vrf B at all.

This commit makes bgp pay attention to interface
events irrelevant if bgp is using that vrf.  This
is now consistent with how the lib/if* expects
to work and the rest of the daemons in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulsnetworks.com>
2018-09-25 15:30:23 -04:00
paco
f533be73f6
bgpd, doc, ldpd, lib, tests, zebra: LM fixes
Corrections so that the BGP daemon can work with the label manager properly
through a label-manager proxy. Details:

- Correction so the BGP daemon behind a proxy label manager gets the range
  correctly (-I added to the BGP daemon, to set the daemon instance id)
- For the BGP case, added an asynchronous label manager connect command so
  the labels get recycled in case of a BGP daemon reconnection. With this,
  BGPd and LDPd would behave similarly.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-18 17:39:16 +02:00
David Lamparter
8c59e16b12
Merge pull request #3015 from donaldsharp/no_fast_failover_and_vrf
bgpd: Using no bgp fast-external-failover prevents vrf intf moves
2018-09-18 12:47:54 +02:00
David Lamparter
2564f080da Merge branch 'pr/2986'
Conflicts:
	bgpd/bgp_network.c (BGP_ERR_* -> EC_BGP_*)

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-18 12:46:42 +02:00
Quentin Young
1c50c1c0d6 *: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:38:57 +00:00
Quentin Young
e50f7cfdbd bgpd: BGP_[WARN|ERR] -> EC_BGP
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 18:51:04 +00:00
Donald Sharp
c19fe3c7ab bgpd: Using no bgp fast-external-failover prevents vrf intf moves
When using `no bgp fast-external-failover` and a interface moves
from one vrf into another we would not fully process the change.
Fix this code path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-13 09:05:42 -04:00
Donald Sharp
17cdd31e00 bgpd: Prevent possible crash when parsing v6 attributes
The peer->nexthop.ifp pointer must be set when parsing the
attributes in bgp_mp_reach_parse, notice this
and fail gracefully.

Rework bgp_nexthop_set to remove the HAVE_CUMULUS and to
fail the nexthop_set when we have a zebra connection and
no ifp pointer, as that not havinga zebra connection and
no ifp pointer is legal.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-12 09:00:43 -04:00
vivek
f190902f52 Merge remote-tracking branch 'upstream/master' into evpn-extended-mobility
Conflicts:
	zebra/zebra_vxlan.c
2018-08-27 22:13:30 +00:00
Donald Sharp
529089b58e
Merge pull request #2804 from kssoman/bgp_fix
When redistribute options are changed, call bgp_redistribute_unreg()
2018-08-24 07:46:22 -04:00
kssoman
e923dd62ef bgpd : Change of options in redistribute command does not get applied
* Added parameter in bgp_redistribute_set() to indicate change
  in redistribute option
* If there is change, call bgp_redistribute_unreg() to withdraw routes

Signed-off-by: kssoman <somanks@vmware.com>
2018-08-22 05:00:15 -07:00
vivek
f07e1c99d6 bgpd, zebra: EVPN extended mobility support
Implement procedures similar to what is specified in
https://tools.ietf.org/html/draft-malhotra-bess-evpn-irb-extended-mobility
in order to support extended mobility scenarios in EVPN. These are scenarios
where a host/VM move results in a different (MAC,IP) binding from earlier.
For example, a host with an address assignment (IP1, MAC1) moves behind a
different PE (VTEP) and has an address assignment of (IP1, MAC2) or a host
with an address assignment (IP5, MAC5) has a different assignment of (IP6,
MAC5) after the move. Note that while these are described as "move" scenarios,
they also cover the situation when a VM is shut down and a new VM is spun up
at a different location that reuses the IP address or MAC address of the
earlier instance, but not both. Yet another scenario is a MAC change for an
attached host/VM i.e., when the MAC of an attached host changes from MAC1 to
MAC2. This is necessary because there may already be a non-zero sequence
number associated with MAC2. Also, even though (IP, MAC1) is withdrawn before
(IP, MAC2) is advertised, they may propagate through the network differently.

The procedures continue to rely on the MAC mobility extended community
specified in RFC 7432 and already supported by the implementation, but
augment it with a inheritance mechanism that understands the relationship
of the host MACIP (ARP/neighbor table entry) to the underlying MAC (MAC
forwarding database entry). In FRR, this relationship is understood by the
zebra component which doubles as the "host mobility manager", so the MAC
mobility sequence numbers are determined through interaction between bgpd
and zebra.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2018-08-20 19:20:06 +00:00
Russ White
91a4566c1c
Merge pull request #2852 from donaldsharp/bgp_clean
Bgp clean
2018-08-16 11:30:03 -04:00
Donald Sharp
b7cd3069c0 bgpd: Modify warn to info for deprecated commands
Modify zlog_warn to zlog_info commands for notification of
deprecated commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-16 08:24:09 -04:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Don Slice
14454c9fdd bgpd: implement zlog_ferr facility for enhance error messages in bgp
Signed-off-by: Don Slice <dslice@cumulusnetworks.com<
2018-08-14 20:02:05 +00:00
Philippe Guibert
8805512419 bgpd: add the pbr identifier in the log messages
for clarity sake, the identifier is inserted in the debug line.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-24 12:17:57 +02:00
Philippe Guibert
c26edcda4e bgpd: flowspec pbr entries listed on the bgp information entry
Because one flowspec entry can create 1-N bgp pbr entries, the list is
now updated and visible. Also, because the bgp_extra structure is used,
this list is flushed when the bgp_extra structure is deleted.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-24 12:17:57 +02:00
Pascal Mathis
3f54c705ec
bgpd: Cleanup of bgp daemon code
This commit removes various parts of the bgpd implementation code which
are unused/useless, e.g. unused functions, unused variable
initializations, unused structs, ...

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
2018-07-07 22:51:13 +02:00
Philippe Guibert
6f5617d877 bgpd: support for flowspec fragment list into policy routing
The flowspec fragment attribute is taken into account to be pushed in
BGP policy routing entries. Valid values are enumerate list of 1, 2, 4,
or 8 values. no combined value is supported yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 11:08:58 +02:00
Philippe Guibert
4977bd6c19 *: add flowspec dscp handling
Only one dscp value is accepted as filtering option.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 11:08:55 +02:00
Philippe Guibert
2da7d62e94 bgpd: support for flowspec tcp flags
Ability to handle flowspec tcp flags.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 08:52:15 +02:00
Philippe Guibert
83360720df bgpd: add support of bgp flowspec filtering per packet length
It is possible to do filtering based on packet length value or a range
of packet-length.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-28 08:52:15 +02:00
Russ White
ebb46153b0
Merge pull request #2245 from donaldsharp/type_4
Support EVPN Type 4 Routes
2018-06-01 16:00:14 -04:00
Donald Sharp
f220da9968 bgpd: Fix SA issue with uninited ifindex value
The rearrangement of where the decision point of
filling in the aggregate information, must have allowed
SA to find a path of code where we may use ifindex uninitialized.
While I don't think this is possible to happen, make this issue
go away.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-31 09:37:34 -04:00
mitesh
50f74cf131 *: support for evpn type-4 route
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-30 07:48:20 -04:00
Donald Sharp
5cc347c4b9 bgpd: Add null0 route back for aggregate-address route created.
The aggregate-address command is not creating the null0
route.  This got lost somewhere in the last year or so.
Add this ability back for BGP route installs into
zebra.

We need this aggregate route installed into the rib
because we are drawing this traffic to us irrelevant
of the number of routes we do have for that prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-29 20:04:17 -04:00
Philippe Guibert
6818e7e5c7 bgpd: do not install BGP FS entries, while table range not obtained
Sometimes at startup, BGP Flowspec may be allocated a routing table
identifier not in the range of the predefined table range.
This issue is due to the fact that BGP peering goes up, while the BGP
did not yet retrieve the Table Range allocator.
The fix is done so that BGP PBR entries are not installed while
routing table identifier range is not obtained. Once the routing table
identifier is obtained, parse the FS entries and check that all selected
entries are installed, and if not, install it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
f0936054e0 bgpd: brace zebra pbr traces
By default, some debug traces were displayed. Those pbr traces are
hidden with 'debug bgp zebra' command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
f18a08f518 bgpd: add ZAPI_XXX_FAIL_REMOVE flag in switch
The new enums for handling REMOVE failures are appended in the switch
case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
4762c2137d bgpd: add vty command to restrict FS policy routing to a defined interface
policy routing is configurable via address-family ipv4 flowspec
subfamily node. This is then possible to restrict flowspec operation
through the BGP instance, to a single or some interfaces, but not all.

Two commands available:
[no] local-install [IFNAME]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
b588b642ce bgpd: display if FS entry is installed in PBR or not
Once PBR rules installed, an information is printed in the main
show bgp ipv4 flowspec detail information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
f730e5667d bgpd: add 3 fields to ipset_entry : src,dst port, and proto
Those 3 fields are read and written between zebra and bgpd.
This permits extending the ipset_entry structure.
Combinatories will be possible:
- filtering with one of the src/dst port.
- filtering with one of the range src/ range dst port
usage of src or dst is exclusive in a FS entry.
- filtering a port or a port range based on either src or dst port.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
b5c4010508 bgpd: do not account twice references to rule context
When rule add transaction is sent from bgpd to zebra, the reference
context must not be incremented while the confirmation message of
install has not been sent back; unless if the transaction failed to be
sent.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
d887503c65 bgpd: improve flowspec update of route to NH/VRF
The debugging message in charge of showing if the route is added or
witdrawn is changed accordingly to reflect this status.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Philippe Guibert
82e194ed85 bgpd: add notify value in zlog notification message for pbr
notifications values from zebra related to pbr are dumped.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00