| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
These are easy to get subtly wrong, and doing so can cause
nondeterministic failures when racing in parallel builds.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
| |
No need to put $(top_srcdir) everywhere.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
|
|
|
| |
And again for the name. Why on earth would we centralize this, just so
people can forget to update it?
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
| |
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
|
|
|
| |
There is really no reason to not put this in the cmd_node.
And while we're add it, rename from pointless ".func" to ".config_write".
[v2: fix forgotten ldpd config_write]
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
| |
The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
| |
... and use named assignments everywhere (so I can change the struct.)
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
| |
Fix some bad wording in a comment when deciding whether
to send a pbr map sequence to zebra.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Separate out the `set *` and `no set *` commands into
different DEFPYs to make the logic of the code easier to
read.
Further, allow non-exlpicit no commands.
So `no set nexthop`, `no set nexthop-group`, and
`no set vrf` will now work without having to specify
anymore data. Before you had to match what was already
there explicitly.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the ability to replace any existing `set *` or
`match` with another one or adding more config without having
to first delete the original config already there.
Before, we needed to constantly execute a `no` command for everything
to remove the rule before making changes to it. With this
patch, you can replace configs on individual sequences much
easier.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Properly free the string pointed to by `pbrms->nhgrp_name`
when we are removiing the config for a nexthop group
on a pbr map sequence.
Found via memleak:
==3152214== 4 bytes in 1 blocks are definitely lost in loss record 308 of 8,814
==3152214== at 0x483980B: malloc (vg_replace_malloc.c:309)
==3152214== by 0x4DC9F7E: strdup (in /usr/lib64/libc-2.30.so)
==3152214== by 0x48E373E: qstrdup (memory.c:122)
==3152214== by 0x408FE7: pbr_map_nexthop_group_magic (pbr_vty.c:264)
==3152214== by 0x408E04: pbr_map_nexthop_group (pbr_vty_clippy.c:347)
==3152214== by 0x48ACF72: cmd_execute_command_real (command.c:1073)
==3152214== by 0x48ACB3B: cmd_execute_command (command.c:1133)
==3152214== by 0x48AD063: cmd_execute (command.c:1288)
==3152214== by 0x493D8EE: vty_command (vty.c:526)
==3152214== by 0x493D397: vty_execute (vty.c:1293)
==3152214== by 0x493C4EC: vtysh_read (vty.c:2126)
==3152214== by 0x49319DC: thread_call (thread.c:1548)
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Actually delete the allocated pbr_nhg_cache object we just
released.
Found via memory leak:
==3078405== 136 bytes in 1 blocks are definitely lost in loss record 8,282 of 8,802
==3078405== at 0x483BB1A: calloc (vg_replace_malloc.c:762)
==3078405== by 0x48E35E8: qcalloc (memory.c:110)
==3078405== by 0x40EBA7: pbr_nhgc_alloc (pbr_nht.c:194)
==3078405== by 0x48CC0EB: hash_get (hash.c:148)
==3078405== by 0x40F825: pbr_nht_add_individual_nexthop (pbr_nht.c:534)
==3078405== by 0x409853: pbr_map_nexthop_magic (pbr_vty.c:400)
==3078405== by 0x4093F1: pbr_map_nexthop (pbr_vty_clippy.c:417)
==3078405== by 0x48ACF72: cmd_execute_command_real (command.c:1073)
==3078405== by 0x48ACB3B: cmd_execute_command (command.c:1133)
==3078405== by 0x48AD063: cmd_execute (command.c:1288)
==3078405== by 0x493D8EE: vty_command (vty.c:526)
==3078405== by 0x493D397: vty_execute (vty.c:1293)
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
| |
Add some more debug info for the sequence number we are
sending to zebra in pbr_send_pbr_map().
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
| |
We were doing a bunch of gotos in the set vrf configcode.
The code got complex enough that just returning is easier to read.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Properly handle the case where we are sent the same `set vrf`
configs for a pbr map repeatedly. If we are sent the same
config, we return successfully without doing anyting.
If the config is different and its not a [no], then return failure
as we did before since we don't support atomic replace yet.
Before, we would fail anytime even if the config sent was the same
as is already there. This would cause frr-reload to mark as a
failure when it tried to re-apply the same config.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
| |
FINISH IT
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
| |
Just keep the code cool.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
|
|
|
|
| |
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
|
|
|
|
|
|
|
| |
It's been a year search and destroy.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
| |
Implement the [no] version of `pbr table range`. We had the command
but were doing nothing with it.
This just calls the set_table_range API again using the defaults.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
The vrrpd one conflicts with the standalone vrrpd package; also we're
installing daemons to /usr/lib/frr on some systems so they're not on
PATH.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
| |
Add code to encode/decode the nexthop weight when we pass it down
into zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|\
| |
| | |
pbrd: make the show pbr map output better
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Change the pbr map validity state to indicate yes/no
rather than 1/0 in the `show pbr map` command.
Humans aren't robots, so don't use binary.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We were using a mix of spaces and tabsin show pbr map vty output.
Tabs can be inconsistent depending on the system settings.
Using spaces is a safer option for more consistent output.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The vty output for pbr maps with a nexthop-group was not
consistent with those configured with an individual nexthop.
Fix that so its easier for users to read.
alfred# show pbr map
pbr-map TEST1 valid: 1
Seq: 222 rule: 521
Installed: yes Reason: Valid
SRC Match: 2.2.2.2/32
Nexthop-Group: blue
Installed: yes Tableid: 10000
Seq: 333 rule: 632
Installed: yes Reason: Valid
SRC Match: 3.3.3.3/32
Nexthop-Group: blue
Installed: yes Tableid: 10000
Seq: 444 rule: 743
Installed: yes Reason: Valid
SRC Match: 4.4.4.4/32
Nexthop-Group: blue
Installed: yes Tableid: 10000
Seq: 555 rule: 854
Installed: yes Reason: Valid
SRC Match: 5.5.5.5/32
Nexthop-Group: red
Installed: yes Tableid: 10001
Seq: 666 rule: 965
Installed: yes Reason: Valid
SRC Match: 6.6.6.6/32
nexthop 1.1.1.1
Installed: yes Tableid: 10002
alfred#
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `detail` keyword was doing literally nothing. Changed the
default show to be a bit more user friendly and detail
to give the information you might would need for
debugging.
alfred# show pbr map
pbr-map TEST1 valid: 1
Seq: 222 rule: 521
Installed: yes Reason: Valid
SRC Match: 2.2.2.2/32
Nexthop-Group: blue(10000) Installed: yes
Seq: 333 rule: 632
Installed: yes Reason: Valid
SRC Match: 3.3.3.3/32
Nexthop-Group: blue(10000) Installed: yes
Seq: 444 rule: 743
Installed: yes Reason: Valid
SRC Match: 4.4.4.4/32
Nexthop-Group: blue(10000) Installed: yes
Seq: 555 rule: 854
Installed: yes Reason: Valid
SRC Match: 5.5.5.5/32
Nexthop-Group: red(10001) Installed: yes
Seq: 666 rule: 965
Installed: yes Reason: Valid
SRC Match: 6.6.6.6/32
nexthop 1.1.1.1
Installed: yes Tableid: 10002
alfred# show pbr map detail
pbr-map TEST1 valid: 1
Seq: 222 rule: 521
Installed: 1(1) Reason: Valid
SRC Match: 2.2.2.2/32
Nexthop-Group: blue(10000) Installed: 1(1)
Seq: 333 rule: 632
Installed: 1(2) Reason: Valid
SRC Match: 3.3.3.3/32
Nexthop-Group: blue(10000) Installed: 1(1)
Seq: 444 rule: 743
Installed: 1(3) Reason: Valid
SRC Match: 4.4.4.4/32
Nexthop-Group: blue(10000) Installed: 1(1)
Seq: 555 rule: 854
Installed: 1(4) Reason: Valid
SRC Match: 5.5.5.5/32
Nexthop-Group: red(10001) Installed: 1(1)
Seq: 666 rule: 965
Installed: 1(5) Reason: Valid
SRC Match: 6.6.6.6/32
nexthop 1.1.1.1
Installed: 1(1) Tableid: 10002
alfred#
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
Refactor the pbr_map and pbr_map_sequence vty output
into some functions to make the code a bit easier to read.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|\ \
| |/
|/| |
pbrd: only remove interface after all seq uninstalled
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Only remove the interface from the pbr_map after we get
a callback from zapi that every sequence using that interface
has been removed.
Before, if we created a map with multiple sequences and put that on an interface,
then removed it from that interface, it would fail to mark the sequences after
the first one as uninstalled.
This was because we failed to lookup the other ones after we removed
the interface from the pbr_map.
This patch adds a conditional to only delete the interface from the pbr
map if all its sequneces using that interface have been uninstalled.
This patch extends the work done in 38e9ccde2f8edd6946d48c80967027d05e64d73f
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
Make the vty match src|dst|mark code a bit more readable
in its conditonal logic.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Consolidate the rule_notify_owner() debugs based on type
into one call, making use of zapi_rule_notify_owner2str()
to do so.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
We were missing some newlines in handling vty outputs
for the `set nexthop*` commands. Add them in there.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
The vty description for the `set match dst-ip` command was
using "src ip" in its description. Change it to use "dst ip".
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also don't silently fail when we attempt to atomically change
a match MARK to a new one.
We would overwrite the frist one but never actually install it.
Change it to explicitly fail if a config is already present for
now.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently pbrd does not support the abilitity to make atomic
changes to a config.
ex)
`match src-ip 1.1.1.1/32`
`match src-ip 1.1.1.0/24`
We would overwrite the first one but never actually install it.
In the `set nexthop commands` we explicitly fail if there is
already a `set nexthop` config present. This patch extends the
match src/dest-ip configs to do the same.
In the future we should make all these commands atomic but for
now its better to not fail silently at the very least.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|/
|
|
|
|
|
|
|
|
| |
Don't treat a remove failure as a successful remove.
This can cause us to get out of sync with the kernel.
Pbrd makes decisions on rule handling based on its installed
state so this needs to be as close to accurate as possible.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
| |
const const const your boat, merrily down the stream...
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
| |
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`set vrf NAME` allows the pbr map to point to an arbitrary vrf table.
`set vrf unchanged` will use the interface's vrf for table lookup.
Further, add functionality for pbr to respond to interface events
such as interface vrf changes & interface creation/deletion.
Ex)
ubuntu_nh# show pbr map
pbr-map TEST valid: 1
Seq: 1 rule: 300 Installed: 3(1) Reason: Valid
SRC Match: 3.3.3.3/32
VRF Unchanged (use interface vrf)
pbr-map TEST2 valid: 1
Seq: 2 rule: 301 Installed: 3(2) Reason: Valid
SRC Match: 4.4.4.4/32
VRF Lookup: vrf-red
root@ubuntu_nh:/home# ip rule show
0: from all lookup local
300: from 3.3.3.3 iif dummy2 lookup main
300: from 3.3.3.3 iif dummyVRF lookup 1111
301: from 4.4.4.4 iif dummy1 lookup 1111
301: from 4.4.4.4 iif dummy3 lookup 1111
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com-
|
|
|
|
|
|
| |
Set the connected pointer to set the pointer to NULL.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
| |
Have the prefix_free code take a double pointer to free the data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
Reduce the api for deleting nexthops and the containing
group to just one call rather than having a special case
and handling it separately.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
| |
The pbr->nhg callback is used exclusively for individual nexthops
set through `set nexthop`. If an actuall "tracked" nexthop_group is
used, only the `pbrms->nhgrp_name` is set. Thus this delete does
nothing.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Don't bother tracking ipv6 link locals to determine if a map
should be installed. Every interface has a route of `fe80::/64`
so its just going to return the arbitrarily first one it finds
when it resolves it and hands it back to us.
Instead, just track the interface we specify along with it.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
|
|\
| |
| | |
lib, zebra: Allow for interface deletion when kernel event happens
|
| |
| |
| |
| |
| |
| |
| | |
Convert the callback of the interface_delete to the new
ifp callback.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
| |
| |
| |
| | |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|