summaryrefslogtreecommitdiffstats
path: root/zebra/rt_socket.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* nhrp, lib, zebra: add/del neighbor entry possible from nhrpPhilippe Guibert2021-04-091-2/+2
| | | | | | | | | a zebra api is extended to offer ability to add or remove neighbor entry from daemon. Also this extension makes possible to add neigh entry, not only between IPs and macs, but also between IPs and NBMA IPs. This API supports configuring ipv6/ipv4 entries with ipv4/ipv6 lladdr. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: link layer config and notification, implementation in zebraPhilippe Guibert2021-04-091-0/+6
| | | | | | | | | | | | | zebra implements zebra api for configuring link layer information. that can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This can also be an ipv4/ipv6 entry associated to an underlay ipv4 address, as it is used in gre point to multipoint interfaces. this api will also be used as monitoring. an hash list is instantiated into zebra (this is the vrf bitmap). each client interested in those entries in a specific vrf, will listen for following messages: entries added, removed, or who-has messages. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* :* Convert prefix2str to %pFXDonatas Abraitis2020-10-221-13/+9
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* zebra: prepare dplane for batchingJakub Urbańczyk2020-08-101-14/+0
| | | | | | | Extend kernel interface to allow the data plane to send many kernel updates at once. Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
* zebra: Stub rt_socket functions for L2 NHG programmingAnuradha Karuppiah2020-08-051-0/+21
| | | | | | Stub functions to keep the BSD builds working. No new functionality. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
* *: un-split strings across linesDavid Lamparter2020-07-141-2/+1
| | | | | | | | | | | | | | | | | Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
* zebra: Add code to install v6 blackhole routes on *bsdDonald Sharp2020-05-071-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was just missing. Take the few minutes and get it done. ! ip route 4.5.6.7/32 Null0 ipv6 route 4::5/128 Null0 ! $ netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.122.1 UGS vtnet0 4.5.6.7/32 127.0.0.1 UG1B lo0 127.0.0.1 link#2 UH lo0 192.168.122.0/24 link#1 U vtnet0 192.168.122.40 link#1 UHS lo0 Internet6: Destination Gateway Flags Netif Expire ::/96 ::1 UGRS lo0 ::1 link#2 UH lo0 ::ffff:0.0.0.0/96 ::1 UGRS lo0 4::5/128 ::1 UG1B lo0 fe80::/10 ::1 UGRS lo0 fe80::%vtnet0/64 link#1 U vtnet0 fe80::5054:ff:fe5a:e705%vtnet0 link#1 UHS lo0 fe80::%lo0/64 link#2 U lo0 fe80::1%lo0 link#2 UHS lo0 ff02::/16 ::1 UGRS lo0 $ $ uname -a FreeBSD donna 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64 $ Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: BSD null routes were not being installedDonald Sharp2019-11-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On BSD systems null routes were not being installed into the kernel. This is because commit 08ea27d1121ef5989cdc54fb178c05a7efc4cd3e introduced a bug where we were attempting to use the wrong prefix afi types and as such we were going down the v6 code path. test27.lab.netdef.org# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued route, r - rejected route K>* 0.0.0.0/0 [0/0] via 192.168.122.1, 00:00:23 S>* 4.5.6.8/32 [1/0] unreachable (blackhole), 00:00:11 C>* 192.168.122.0/24 [0/1] is directly connected, vtnet0, 00:00:23 test27.lab.netdef.org# exit [ci@test27 ~/frr]$ netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.122.1 UGS vtnet0 4.5.6.8/32 127.0.0.1 UG1B lo0 127.0.0.1 link#2 UH lo0 192.168.122.0/24 link#1 U vtnet0 192.168.122.108 link#1 UHS lo0 Fixes: #4843 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Add bsd nexthop install boilerplateStephen Worley2019-10-251-0/+5
| | | | | | | Add some boilerplate for nexthop installation for bsd kernels. They do not support nexthop objects for now so its just boilerplate. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* zebra: inform upper layer error when reading correct speed interfaceJulien Floret2019-09-171-1/+1
| | | | | | | | | | | speed interface is done 15 seconds after interface creation. during that time, the vrf or the interface may have disappeared. to protect this, return an error in case it is not possible to create a vrf socket or it is not possible to get speed of an interface because of a missing device. Signed-off-by: Julien Floret <julien.floret@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: move EVPN VTEP programming to dataplaneMark Stapp2019-09-041-10/+0
| | | | | | | Move VTEP install/uninstall to the zebra dataplane. Remove synch kernel-facing apis and helper functions. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #4877 from mjstapp/dplane_neighsDonald Sharp2019-09-041-11/+6
|\ | | | | zebra: move evpn neighbors to dataplane
| * zebra: Use dataplane for evpn neighbor changesMark Stapp2019-08-231-11/+6
| | | | | | | | | | | | | | | | | | 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>
* | *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-1/+1
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: use dataplane for vxlan remote mac programmingMark Stapp2019-08-021-9/+5
| | | | | | | Move vxlan remote MAC install and uninstall to the async dataplane. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: Modify code so that dplane is responsible for indicating success/fail ↵Donald Sharp2019-03-271-16/+38
| | | | | | | | | | | | | | | | | of install We have several route types KERNEL and CONNECT that are handled via special case in the code. This was causing a lot of work keeping the two different classes of route types as special(SYSTEM OR NOT). Put the dplane in charge of the code that sets the bits for signalling route install/failure. This greatly simplifies the code calling path and makes all route types be handled exactly the same. Additionaly code that we want to run post data plane install can just work as per normal then, instead of having to know we need to run it when we have a special type of route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
* zebra: Fix use before initializedDonald Sharp2019-01-261-3/+2
| | | | | | | | | When we discover that a command given to the route add/delete function in rt_socket.c is bogus, print out a debug message but don't attempt to actually use a nexthop that we have not figured out yet as part of the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Having one goto in a function to just return is sillyDonald Sharp2019-01-261-4/+1
| | | | | | | | Just return right there, goto's are useful if you have common code that needs to be cleaned up before exiting this function, of which this function has none and there is only one goto. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: fix routing socket logic for labelled nexthopsMark Stapp2019-01-221-4/+6
| | | | | | | Clarify and fix the logic used for labelled nexthops during route updates on routing socket platforms. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: fix debug test in routing-socket update pathMark Stapp2019-01-221-2/+1
| | | | | | | Fix the test used to pre-populate a string used in debugs in the routing-socket route-update code path. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: remove unused functionsRafael Zalamena2019-01-221-48/+0
| | | | | | | Remove two unused functions in `zebra/rt_socket.c`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org> (cherry picked from commit 914fea09d9e1a5379b7ed9fa43b0505a091395af)
* zebra: use proper sockaddr size in kernel_rtmRafael Zalamena2019-01-221-18/+24
| | | | | | | `sockaddr` `len` field is the address type size and not the mask length. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org> (cherry picked from commit a6c000318226b9c3e5c3010ea31c6941ac1dff43)
* zebra: fix debug prefix string sizeRafael Zalamena2019-01-211-8/+25
| | | | | | | `gate_buf` should be big enough to hold IPv6 addresses and `inet_ntop` should be run in the correct `sockaddr` struct member. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* zebra: fix debug messages with prefixesRafael Zalamena2019-01-211-10/+9
| | | | | | | Debug messages should use `prefix_buf` and `prefix2str` should only be called once in `kernel_rtm`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* zebra: Fixup spaces/tabs issue found by CI in rt_socket.cDonald Sharp2018-12-191-4/+4
| | | | | | | Cleanup the space/tabs issues found by CI in rt_socket.c so it stops complaining at us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Make label processing guaranteed to be uniqueDonald Sharp2018-12-191-0/+1
| | | | | | | | The label processing for socket installs was not ensuring that each nexthop would not accidently use the last nexthops value. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Convert gate in kernel_rtm to a boolDonald Sharp2018-12-191-5/+5
| | | | | | Convert the gate test int to a bool as that we use it this way. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: The mask and sin_mask are a bit redundant for kernel_rtmDonald Sharp2018-12-191-22/+9
| | | | | | | The test we were using to ensure that a mask was sent in is a bit redundant, let's just always send it in. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Refactor kernel_rtm to be a bit smarter about how it handles optionsDonald Sharp2018-12-191-131/+127
| | | | | | | | | | The ADD/DELETE messages are the only ones we support, so leave early from the function, in other words don't check it every nexthop loop. Additionally nexthops only care about non recursive active flags. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Refactor kernel_socket kernel_rtm_ipv4 and ipv6 functionsDonald Sharp2018-12-191-165/+108
| | | | | | Refactor both v4 and v6 functions down to 1 install function. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Move sin6_masklen to earlier in the fileDonald Sharp2018-12-191-24/+24
| | | | | | | I'm going to rearrage the kernel_rtm_ipv4 and v6 functions so the sin6_masklen needs to be moved a bit earlier. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Convert socket interface to use `union sockunion`Donald Sharp2018-12-191-41/+41
| | | | | | | The write function converted to v4 and v6 functions to a union sockunion via casting. Just use `union sockunion` instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Fix privs elevationDonald Sharp2018-11-161-1/+1
| | | | | | | This Commit: f183e380fae61b7c1f89fed6e32ed5a9d1ede8a8 broke priviledge escalation on *bsd. This puts it back. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: revise struct names to resolve review commentsMark Stapp2018-10-251-1/+1
| | | | | | | Use standard type naming and remove use of typedef to resolve some review comments. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: remove old apis after new dplane workMark Stapp2018-10-251-37/+0
| | | | | | | Replaced or out-grew a few zebra internal apis during async dataplane work; removing them. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: add handy res2str utilityMark Stapp2018-10-251-38/+41
| | | | | | | Add a 2str utility for dplane result codes; use it in a debug or two. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: update routing socket pathMark Stapp2018-10-251-26/+66
| | | | | | | Update route-socket path for route updates using the async dplane module. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: start dataplane layer workMark Stapp2018-10-251-0/+5
| | | | | | | | | | | | | | | | | | | Reduce or eliminate use of global zebra_ns structs in a couple of netlink/kernel code paths, so that those paths can potentially be made asynch eventually. Slide netlink_talk_info into place to remove dependency on core zebra structs; add accessors for dplane context block Start init of route context from zebra core re and rn structs; start queueing and event handling for incoming route updates. Expose netlink apis that don't rely on zebra core structs; add parallel route-update code path using the dplane ctx; simplest possible event loop to process queued route' updates. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: Notice when a route fails to install on *bsdDonald Sharp2018-10-241-4/+7
| | | | | | | | When we fail to install a route into bsd, note the case where we have no viable nexthops installed for it, so that we can know in zebra if the route is good or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #3052 from donaldsharp/dplane_2Russ White2018-09-241-11/+11
|\ | | | | Dplane 2
| * zebra: Create zebra_dplane.c and .hMark Stapp2018-09-201-11/+11
| | | | | | | | | | | | | | Add first sketchy 'dplane' files. Signed-off-by: Mark Stapp <mjs@voltanet.io> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | zebra: Use boolean for certain VxLAN-EVPN flagsvivek2018-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use boolean variables instead of unsigned int for certain VxLAN-EVPN flags which are really used as boolean. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com> Ticket: CM-22288 Reviewed By: CCR-7832 Testing Done: Along with a subsequent, related commit
* | zebra: Remove unused parameter in MAC deletevivek2018-09-181-1/+1
|/ | | | | | | | | | When a MAC moves from local to remote, a replace is allowed, EVPN no longer has to delete the local MAC before installing the remote MAC. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young2018-09-131-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: fix includesQuentin Young2018-09-061-0/+1
| | | | | | Add and remove error related includes as necessary. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: flog_warn conversionQuentin Young2018-09-061-5/+6
| | | | | | Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use frr_elevate_privs() (1/2: coccinelle)David Lamparter2018-08-141-8/+6
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-4/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra, lib: error references for zebraQuentin Young2018-08-141-3/+5
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>