OpenBSD uses ioctl to fetch interface information on startup and the
SIOCGIFMEDIA command is just too cumbersome to use.
The best way to fix the problem for OpenBSD is probably to stop treating
it differently from the other BSDs for no apparent reason. There should
be nothing preventing us to make OpenBSD use the routing socket to fetch
interface information on startup (we already do it to detect runtime
changes). This is something that should be done in a separate commit
after a careful analysis.
Brian Rak [Mon, 7 Aug 2017 18:37:21 +0000 (14:37 -0400)]
rhel: Don't obsolete bird
The FRR RPM was obsoleting BIRD, which meant that as soon as you added a FRR RPM to a repository, you could no longer install BIRD. This patch switches it over to Conflicts instead, which should be much nicer behavior
David Lamparter [Mon, 7 Aug 2017 13:05:34 +0000 (15:05 +0200)]
lib: cli: don't run off graph "pre-end"
Behind END_TKN, there is another graph node whose data pointer is
actually struct cmd_element instead of struct cmd_token. Don't try to
interpret that as cmd_token. This causes very interesting crashes when
ASLR decides to give one of the strings of a command definition a lower
32-bit value that is a valid cmd_token_type (e.g. FORK_TKN).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Sun, 6 Aug 2017 03:14:39 +0000 (05:14 +0200)]
zebra: static: update on ifindex changes
Whenever an interface is created or deleted in the system, we need to
check whether we have static routes referencing that interface by name.
If so, we need to [un]install these routes.
This has the unfortunate side effect of making static routes with
non-existent interfaces disappear from "show ip route", but I think
that's acceptable (and I don't see a "good" fix for that).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Jorge Boncompte [Fri, 4 Aug 2017 17:33:15 +0000 (19:33 +0200)]
bgpd: remove bogus change in attrhash_key_make()
Commit c8e7b895 ("bgpd: use Jenkins hash for BGP transit, cluster and
attr hashes") changed attrhash_key_make() to use Jenkins hash, commit c8f3fe30 ("bgpd: Remove AS Path limit/TTL functionality") introduced
a bogus change with a snippet of code that was deleted in the first
one.
Chirag Shah [Thu, 3 Aug 2017 23:34:17 +0000 (16:34 -0700)]
ospfd: Fix MI-OSPF configuraton clis
Multi-Instance OSPF configuration CLI would fail because
first client return error upon seeing qobj_index being 0.
With new marco generate new error code to return from each
instance (vtysh client) and if the command is intended for given
instance, its qobj_index would be nonzero and process the command
and push correct ospf context. Other instance would return the error.
On vtysh end, check all instance return an error log a message to a
file.
Testing Done:
Verfied various MI-OSPF configuration CLI with multi instances.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
isisd: don't validate dict integrity for regular builds
This method is intended to be only used for debugging as per the author
and profiling shows we are spending a lot of cycles on it. Remove it for
regular builds by guarding it with a define.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Donald Sharp [Thu, 3 Aug 2017 12:42:29 +0000 (08:42 -0400)]
lib: Add ETH_ALEN to prefix.h and deprecate ETHER_ADDR_LEN
From discussion we decided that we should use ETH_ALEN instead
of ETHER_ADDR_LEN. Add ETH_ALEN to prefix.h and make
ETHER_ADDR_LEN generate a warning when used( but still work ).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 3 Aug 2017 11:43:47 +0000 (07:43 -0400)]
zebra: Fix crash when OOM happens.
The hash key function choosen for mac vni's would tend
to clump the key value to the same number. Use a better
hash key generator to spread the hash values out.
A bad hash key might lead to O(2^n) memory consumption
because the hash size is doubled, each time a backet
exceeds a predefined threshold. This quickly leads
to OOM. Fixing this issue by fixing the hash
key generation to actually spread the keys out.
Ticket: CM-17412 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra: do not treat kernel routes as implicit withdraws
Kernel does not send the best route after adding or deleting routes, if
we treat routes for an existing prefix as implicit withdraw the zebra RIB
goes out of sync with FIB and can announce wrong route to protocols.
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
C>* 192.168.1.0/24 is directly connected, eth0
host:~# ip route add 192.0.2.0/24 via 192.168.1.101 metric 100
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
K>* 192.0.2.0/24 via 192.168.1.101, eth0
C>* 192.168.1.0/24 is directly connected, eth0
host:~# ip route add 192.0.2.0/24 via 192.168.1.102 metric 50
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
K>* 192.0.2.0/24 via 192.168.1.102, eth0
C>* 192.168.1.0/24 is directly connected, eth0
host:~# ip route del 192.0.2.0/24 via 192.168.1.102 metric 50
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
C>* 192.168.1.0/24 is directly connected, eth0
host:~# ip route show 192.0.2.0/24
192.0.2.0/24 via 10.10.1.101 dev eth0 metric 100
RTA_PAYLOAD() return value depends on the platform bits.
make[5]: Nothing to be done for 'all-am'.
Making all in zebra
CC rt_netlink.o
../../zebra/rt_netlink.c: In function 'netlink_macfdb_change':
../../zebra/rt_netlink.c:1695:63: error: format '%ld' expects argument of type 'long int', but argument 7 has type 'unsigned int' [-Werror=format=]
"%s family %s IF %s(%u) brIF %u - LLADDR is not MAC, len %ld",
^
../../zebra/rt_netlink.c: In function 'netlink_ipneigh_change':
../../zebra/rt_netlink.c:2024:57: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Werror=format=]
"%s family %s IF %s(%u) - LLADDR is not MAC, len %ld",
^
Donald Sharp [Thu, 3 Aug 2017 22:05:47 +0000 (18:05 -0400)]
pimd: Fix crash on iface down due to secondary address list
The secondary address list was being added/removed as
we went. I see no reason to have special bookkeeping
for this list. Just add it on interface startup and
then remove it on deletion. Removes some
very specialized coding that was saving a very small
amount of space.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 3 Aug 2017 14:56:30 +0000 (10:56 -0400)]
pimd: Lookup S,G ifchannel after we create it
There are situations where we receive a *,G with
a S,G,RPT Prune embedded where we do not actually
have any S,G yet(MSDP with multiple RP's with the
same address). As such since we only need to
lookup the S,G ifchannel once, do it after
the recv_prune.
Ticket: CM-17230 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 2 Aug 2017 17:16:51 +0000 (13:16 -0400)]
pimd: Squash some more memory leaks
When a interface is flapped we were leaking some memory
associated with link lists. Especially in the jp_agg
code. If your network was/is stable and you are not
running at any scale you probably would not see this
as impactful at all.
Ticket: CM-16392 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 2 Aug 2017 16:10:50 +0000 (12:10 -0400)]
pimd: Clean back pointer upon deletion
The channel_oil has a back pointer(up) to the upstream data structure.
If we are planning on keeping the channel oil (due to ref count issues)
longer than keeping the upstream, when we delete the upstream we were
not clearing the back pointer to up. This would result in a situation
where if that memory has started to be used again it will cause a
crash and other fun things.
Ticket: CM-17092 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>