Commit Graph

6784 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
ea4aa1428f Merge pull request #316 from qlyoung/fix-logc
lib: fix proto_redistnum() oversight from #257
2017-04-03 14:43:50 -05:00
Donald Sharp
6f4c7f7476 zebra: Display new speed information in 'show int..' command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-03 14:49:35 -04:00
Donald Sharp
535fe877a9 zebra: Retrieve interface speed when creating interface
When we get notification from the kernel about the creation
of a new interface, retrieve the speed of it from the kernel

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-03 14:49:35 -04:00
Donald Sharp
2d7f0d76c6 lib, zebra: Add ability to pass interface speed up from zebra
This is a prepatory commit for future improvements.

Add a change to the zapi to pass the interface speed up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-03 14:49:35 -04:00
Donald Sharp
81b43075b7 Merge pull request #311 from opensourcerouting/ldpd-vty-simpl
ldpd: simplify CLI code + small fixes
2017-04-03 13:49:29 -04:00
Quentin Young
f257ff2cdb lib: fix proto_redistnum() oversight from #257
proto_redistnum() now accepts full protocol strings and not partial
names per #10

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-04-02 23:21:09 +00:00
Martin Winter
3e71b5d907 Release: FRR-2.0
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-04-01 22:22:47 -07:00
Donald Sharp
264f864625 isisd: Fix some various clang warnings
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-01 08:42:19 -04:00
Donald Sharp
2aaa554de9 Merge branch 'master' into pim_5549 2017-04-01 07:58:05 -04:00
Mike Tancsa
7e5b539722 lib: fix usage of getgrouplist() in *BSD
On BSD systems, the getgrouplist() function returns 0 if successful and
-1 on error.

Linux in the other hand returns *ngroups (the number of groups of which
user is a member) on success and -1 on error.

Given this difference, the most portable way to use getgrouplist()
is use its return value only for checking if it succeeded or not.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-04-01 00:50:40 -04:00
Donald Sharp
7f03a6f6d2 nhrpd: Fix value set but never used.
The nbma_addr value is set but never used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 17:00:26 -04:00
Donald Sharp
6ca7dd9045 pimd: Cleanup termination to avoid possible null ptr deref
When terminating pim, there existed( albeit small ) the chance
to cause a crash.  Cleanup the termination to not have
that chance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 16:56:26 -04:00
Donald Sharp
19f4e33afa pimd: Fix incorrect indentation
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 16:50:08 -04:00
Donald Sharp
ff3745c26a pimd: Remove impossible conditions from test
It is impossible for the list->cmp function to
ever be handed NULL values as the arguments.

Clean up this in the code.

Additionally consolidate the exact same two functions
into 1 function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 16:47:00 -04:00
Donald Sharp
8cb129e986 pimd: Cleanup api and stop crash
There is no need for a function that calls another function.

Additionally, nexthop_updates from zebra can be either
ZEBRA_NEXTHOP_UPDATE -or-
ZEBRA_IMPORT_CHECK_UPDATE

If we were to receive a IMPORT_CHECK_UPDATE the code
would cause a immediate crash.  Fix this

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 16:38:29 -04:00
Donald Sharp
e43223bcc3 pimd: Cleanup unused variable write
There exists a common pattern in pim where we were setting
a variable to a value in the error case when we would no
longer need it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-31 16:28:22 -04:00
Renato Westphal
1d75a89d85 ldpd: do not consume vty_conf when updating the configuration
David Lamparter gave the idea of keeping vty_conf as a permanent copy of
ldpd_conf in order to simplify the CLI code and facilitate the integration
with his cap'n proto framework in the future. Doing this demanded quite
some effort but it was worth it as the code looks much better now.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 13:51:53 -03:00
David Lamparter
b31fd74907 build: find & use threading library
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 17:59:48 +02:00
David Lamparter
fa7fe831aa lib: Linux indentation on memory.[ch]
The fact that I originally wrote this in Linux Kernel style and then
reindented it to GNU makes me want to gouge my eyes out every time I
look at it.  Restore original indentation.

[This patch is whitespace-only.]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 17:59:48 +02:00
David Lamparter
a31446a88f lib: memtypes: restore atomicity
the original version of this code already used _Atomic and atomic_*().
Restore this functionality for future multithreading.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 17:59:48 +02:00
David Lamparter
899a4fd2a1 build: try to find some kind of atomic ops
Either one of:
- ISO C11
- gcc __atomic_*
- gcc/clang __sync_*

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 17:59:45 +02:00
Renato Westphal
7d0eeac1a1 ldpd: extend the ldp_config_normalize() function
* remove superfluous parts of the configuration when possible
  (e.g. interfaces that are disabled for both IPv4 and IPv6);
* move the check of whether the pseudowire is active or not from
  merge_l2vpns() to ldp_config_normalize() where it belongs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 12:57:37 -03:00
Renato Westphal
52b530fc64 ldpd: fix configuration of non-existing VPLS interfaces and pseudowires
If we don't know the ifindex, flags, etc of an interface at the time it's
configured, we should make sure that once this information is available
the appropriate structures are updated.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 12:57:37 -03:00
Renato Westphal
308252d06d ldpd: remove the interface vty node
ldpd uses a hierarchical configuration model where all commands are
defined inside the "mpls ldp" node and its subnodes. The idea is to keep
all LDP configuration in a single place to keep things simple. With that
said, we can remove the "config-if" node from ldpd because we already
have a separate node ("config-ldp-af-if") for LDP-related interface
specific commands.

Example:
vtysh(config)# mpls ldp
vtysh(config-ldp)# address-family ipv4
vtysh(config-ldp-af)# interface eth1
vtysh(config-ldp-af-if)# discovery hello ?
  holdtime  Hello holdtime
  interval  Hello interval

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 12:57:25 -03:00
David Lamparter
8aa42b826c build: bump to C11
Funnily enough, "gnu11" is gcc's default in 5.x if you don't specify
anything, yet there is no "AC_PROG_CC_C11" in autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 16:22:33 +02:00
David Lamparter
fbd0bae6d6 build: disable autoconf "-g -O2" default CFLAGS
We have AC_C_FLAG and try -Os before -O2.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 16:22:33 +02:00
David Lamparter
3f11a103a6 lib: make sure SEGV handler cannot lock up
Just adding -pthread to gcc options changes libc's behaviour, e.g.
making malloc() use proper locking.  This means a SEGV inside malloc()
(e.g. because malloc bookkeeping structures have been damaged by writing
to a broken pointer) can lead to a lockup by the following chain:

- random_function()
- malloc()
--- SEGV
- core_handler()
- zlog_backtrace_sigsafe()
- backtrace()
- malloc()

This will hang forever waiting for the malloc() lock to be released.

Another failure mode is dynamic linking with lazy binding (-z lazy,
default).  Since backtrace() is seldomly used, this means the call to
backtrace() in the core handler can in fact result in the dynamic linker
trying to resolve the "backtrace" symbol, which can also deadlock.

Add several safeguards to prevent any of this from happening.

(Unfortunately, these are not theoretical issues - I found them by
running into them headfirst.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-31 16:22:33 +02:00
Renato Westphal
726329191d ldpd: no need to synchronize pseudowires with LSPs anymore
Since commit 595b4be, the l2vpn_pw_ok() function doesn't check if there's
a working LSP to the remote end of the pseudowire (we assume that zebra
will do that for us). With that said, the l2vpn_sync_pws() function is
not necessary anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 11:12:39 -03:00
Renato Westphal
f790d62ad1 ldpd: fix harmless maybe-uninitialized warning
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-31 11:10:33 -03:00
Jafar Al-Gharaibeh
2b5c7fa46d Merge pull request #291 from AnuradhaKaruppiah/pim-ssm
Pim ssm
2017-03-31 00:15:23 -05:00
Donald Sharp
31edf0b509 Merge branch 'master' into pim-ssm 2017-03-30 16:20:34 -05:00
Jafar Al-Gharaibeh
d77005377f Merge pull request #301 from qlyoung/nhrpd-gitignore
nhrpd: add .gitignore
2017-03-30 16:15:18 -05:00
Donald Sharp
98b506c210 Merge pull request #307 from LabNConsulting/working/2.0/patch/rename2
Rename: FreeRangeRouting --> FRRouting
2017-03-30 14:23:55 -05:00
Donald Sharp
023dd1ad91 Merge pull request #305 from opensourcerouting/build-doc-updates
doc: Update for the Building_FRR docs to include new requirements
2017-03-30 14:23:15 -05:00
Lou Berger
d6180888fc Rename: freerangerouting --> frrouting
Signed-off-by: Lou Berger <lberger@labn.net>
2017-03-30 14:24:05 -04:00
Lou Berger
447a8fe92e Rename: FreeRangeRouting FRRouting
Signed-off-by: Lou Berger <lberger@labn.net>
2017-03-30 14:22:35 -04:00
Donald Sharp
2e725ad140 pimd: Fix header to be more descriptive of what it is doing
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 10:23:14 -04:00
Donald Sharp
294b6d7243 pimd: Receive incoming v6 addresses and place in pim_ifp list
Add code to properly receive v6 addresses up from zebra and to
properly place them into our interface secondary address list.

Additionally cleanup some code in pim_cmd.c that was broken
by these changes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
eeff6d3f99 pimd: Use better 5549 resolution
When we receive a v6 nexthop in v4, lookup the nbr by
it's secondary address.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
dba7860904 pimd: Send v6 secondary addresses to neighbors in hello
Send v6 secondary addresses to our neighbor in hello's.

Additionally allow the disabling it via the cli introduced
earlier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
0f4b1d2d95 pimd: Add ability to encode/decode v6 secondary addresses
Add ability to encode/decode the v6 secondary addresses
if they are passed to us.

This also fixes the issue where if we are passed
a v6 secondary address list we will not refuse
to form neighbors.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
07b17d5927 pimd: Add code to find neighbor by secondary
With RFC 5549 we need a methodology to find
a neighbor based upon a nexthop that is
v6 based.  This commit sets us up for that
by allowing you to find the neigbor by
the secondary list.  In a future commit
we will add code to pass the v6 secondary
addresses.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
7399328a6f pimd: Fix RP determination to handle secondary addresses better
When we are checking RP addresses and looking at the secondary
address.  With the addition of the ability to handle v6 addresses
in the secondary list.  Assuming that the secondary address
is a v4 address is a no go.

Convert to prefix_same.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
71bbe73dc4 pimd: Add code to allow backwards compatibility
This code change adds the ability to specify that
we should be able to work with older versions
of PIM.

In future commits we will actually use this data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
34687162ce pimd: Convert pim address family from #define -> enum
Convert the pim address family from a #define into
an enum.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-30 09:34:03 -04:00
Donald Sharp
821260f642 Merge pull request #297 from opensourcerouting/ldpd-openbsd
Add support for MPLSv6 in OpenBSD + minor fixes
2017-03-30 06:23:59 -05:00
Donald Sharp
7c7148e6c3 Merge pull request #296 from opensourcerouting/ldpd-sighup
ldpd: do a full configuration reload upon receiving a SIGHUP
2017-03-30 06:18:25 -05:00
Donald Sharp
fdbfd655c1 Merge pull request #299 from opensourcerouting/test-ref-out
tests: format TestRefMismatch more readable
2017-03-30 06:14:21 -05:00
Donald Sharp
aba41ec40c Merge pull request #298 from opensourcerouting/defaults
track version & "defaults" in configs
2017-03-30 06:13:19 -05:00
Quentin Young
a27a10b0cc nhrpd: add .gitignore
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-03-29 23:40:55 +00:00