Commit Graph

6282 Commits

Author SHA1 Message Date
Donald Sharp
627ed2a3b7 pimd: Create register stop timer for DR
When a register stop is received, create the register stop
timer and associated state machine.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
b100a4f5b9 pimd: Add null_register bit to pim_register_send
When sending a pim register message to an RP, we need
the ability to set the null bit in the message.  This
adds the ability to do so.

Additionally we need to switch the ip_hdr to a const uint8_t *buf
because pim_register_send really shouldn't know or care about
the fact it's a 'struct ip'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
887fa0149f pimd: Add pim_channel_del_oif
For a given interface remove the interface from the list
of outgoing interfaces for a mroute and reinstall it
into the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
d7259eac8b pimd: create pim_upstream_state2str
Allow update of show command to understant all
pim upstream states.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
59ba0ac3e6 pimd: Fix use of 0 for NULL
pimd uses allot of 0's to represent NULL.  Not a good
programming practice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
2ddab28881 pimd: Add decision point to send register message
When we receive a register stop we will have created a
timer for this.  As such if the t_rs_timer pointer will
be non-NULL at this point.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
4dffc8807e pimd: Refactor pim message receive
We were using a variety of techniques to handle
incoming pim packets.  Refactor to use a switch
statement to handle the incoming packets.

Also add the ability to notice that we are getting
a register stop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
13c2408c1d pimd: Send Register-Stop from RP
The RP now has the ability to send a register stop message
to the originator of the packet in order to tell it to
stop encapsulating packets to the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
6352a6cf23 pimd: Set correct parameters to pim_register_stop_send
Setup the pim_register_stop_send function to
take the correct parameters.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
Donald Sharp
3d7765d741 pimd: Fixup some dead code
Remove some dead code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:01 -05:00
Donald Sharp
8f483f924e pimd: Create pim_encode_addr_group
Create the ability to encode the group address in a message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:01 -05:00
Renato Westphal
9c0b0e6753 ldpd: allow multiple link adjacencies with unnumbered interfaces
Now we can have two different adjacencies coming from the same source
address. Check for the adjacency's interface on adj_find() to disambiguate
them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-12-21 19:33:37 -02:00
Renato Westphal
2f49a5942b ldpd: fix segfault when configuring multiple pseudowires
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-12-21 19:33:37 -02:00
David Lamparter
ab0181eed3 build: rename (2 of ?): route_types macros
All of the autogenerated macros in lib/route_types.pl are now called
FRR_* instead of QUAGGA_*.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 18:34:29 +01:00
David Lamparter
ae435b1972 build: replace some hardcoding with ./configure
Several places have paths and names that can change hardcoded, e.g. the
package name and the /var/run path.  This fixes a few of them, there's
still some to do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 18:18:44 +01:00
David Lamparter
3bd82ffb70 build: remove INSTALL.quagga.txt
It's horribly outdated & wrong info is worse than none.
doc/install.texi should probably be updated instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 18:00:22 +01:00
David Lamparter
8e4da10b0a build: more renaming in configure.ac 2016-12-20 17:58:25 +01:00
David Lamparter
b2f361571b build: rename (1 of ?): configure.ac + preproc
This replaces Quagga -> FRR in most configure.ac settings as well as
a handful of preprocessor macros in the source code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:57:47 +01:00
David Lamparter
a07169b1f6 doc: use config values from configure in manpages
This makes the actual change to the manpages to get ./configure effects
applied into them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:56:25 +01:00
David Lamparter
461c7bee69 doc: rename manpages to ".in" for autoconf
The manpages contain references to installation paths and thus should be
preprocessed by ./configure to get the actual paths.

This commit is an exact-rename so the changes for the preprocessing are
easier to review (diffs in renames are hard to read...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:54:22 +01:00
David Lamparter
8ef0791cb6 build: remove $Format tags
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-20 17:54:03 +01:00
David Lamparter
2504fdc95d Merge pull request #8 from donaldsharp/summary
bgpd: Fix 'show ip bgp summary' variable output being wrong
2016-12-20 15:31:56 +01:00
David Lamparter
e179b7bfa7 Merge pull request #7 from donaldsharp/community
frr: Modify doc to talk about cli
2016-12-20 15:29:43 +01:00
Quentin Young
487be854a5 lib: add grammar_sandbox to .gitignore
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-20 06:39:37 +00:00
Quentin Young
c01d03a658 bgpd, lib: fix a few scan-build catches
Fixes a couple null pointer derefs and uninit'd values.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-20 03:26:47 +00:00
Quentin Young
96133092e0 Merge pull request #22 from qlyoung/fix-do-tab
lib: fix crash when tab-completing `do ...` commands
2016-12-19 17:35:03 -05:00
Quentin Young
a8e4ddd408 lib: Initialize ->allowrepeat
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-18 05:39:21 +00:00
Quentin Young
55d403c9b2 lib: fix crash when tab-completing do ... commands
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-18 05:14:55 +00:00
Donald Sharp
6cc1ba027f Merge pull request #6 from opensourcerouting/dev/osr/vty_pending
parser: accept non-words as first tokens & numbers as word tokens
2016-12-16 15:52:47 -05:00
Donald Sharp
4f4354b872 bgpd: Fix 'show ip bgp summary' variable output being wrong
The first time through calling 'show ip bgp summary'
we were always calculating the variable hostname field
size incorrectly.

Ticket: CM-13900
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-16 15:49:40 -05:00
Donald Sharp
19c7f43feb frr: Modify doc to talk about cli
Add some verbiage to the COMMUNITY.md to talk
about the philosophy of what cli should do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-16 15:35:14 -05:00
Donald Sharp
bcfb39acd7 Merge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords
Merge branch 'dev/osr/fixes_plus_vty_keywords'
2016-12-16 15:12:34 -05:00
David Lamparter
fd19e7a2c0 lib: parser: remove startnode & sentence_root
This removes an artificial restriction for the first token in a
command's graph to be a WORD_TKN.  The intention seems to be to prohibit
empty paths through a command, and to restrict "explosion" of choices in
the root node.

The better approach to the former is to check for an empty path after
the definition is parsed.  The latter will happen anyway, by duplication
of the command, which just makes it worse...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:48:31 +01:00
David Lamparter
bca1a301ba lib: parser: accept number-only word tokens
There seems to be no reason why numbers don't work as plain word tokens;
this is useful to have "number choices" or constants, e.g. <128|192|256>
for bit encryption lengths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:48:31 +01:00
David Lamparter
a6cf5da4fd build: automake 1.12 to deal with flex & bison
bison conditionally writes its output to different files based on the
filenames specified in the source code.  This could be disabled,
however...  flex changes its output filenames when "prefix" is
specified.  And ylwrap from <1.11 doesn't understand how to handle the
header file...

...so this requires automake 1.12 which can deal with this properly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
4d94b29296 lib: parser: move allowrepeat to cmd_token
struct graph_node isn't quite the right place to control matcher
behaviour.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
0e64d123fd bgpd: shuffle qobj_init()
bgp_master_init is called first thing in main(), so we need to wedge a
qobj_init() call in there...  this needs some improvement...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
afc3a6ceb6 lib: parser: reorder bison incarnations
This shuffles the code blocks in command_parser.y to match file output
order, then adjusts things to make the include handling less messy.

(also dropped unused DECIMAL_STRLEN_MAX define.)

This should hopefully fix the build on NetBSD 6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
4a06690fca build: check flex >= 2.5.20 is available
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
0d37f9f325 build: fix bison < 3.0 compatibility
bison-2.7.x really wants "foo" for api.prefix while bison-3.0.x really
wants {foo} ... great.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
eed831e065 tests: fix mis-fixed format string
PRIu64 is "u", we need "x", so PRIx64...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-16 20:42:01 +01:00
David Lamparter
e988dfd35b tests: fix exit <> return mix-up in dejagnu
exit 0 exits the entire testrunner... Oops.
Also, "unresolved" breaks too many things, so make this a pass.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
46715ff034 tests: add missing qobj_init() call
This was SEGV'ing the test in bgp_master_init() since QOBJ_REG was used
without qobj_init() being called first.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
7ef290efa3 tests: adjust testcli ref output to new argv rules
Now that we have keyword argument support in the matcher again, this
needs to be updated because argv[] will be 1:1 user input without
mangling or reordering.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-16 20:42:01 +01:00
David Lamparter
53d5ec3678 lib: parser: fix SEGV when Tab hits non-WORD_TKN
If <Tab> processing finds that there is only 1 candidate, but that
candidate is not a WORD_TKN that we can tab-complete on, the status
would remain at CMD_COMPLETE_FULL_MATCH, but the resulting list of
possible completions is empty.

This then SEGVs in lib/vty.c where it tries to access the first element
of the list, assuming FULL_MATCH always has 1 element there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-16 20:42:01 +01:00
Quentin Young
6d681bd874 all: use ->text when parsing protocol argument
and match on full protocol name in proto_redistnum()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-12-16 05:39:44 +00:00
David Lamparter
d5444d27c1 Merge pull request #1 from donaldsharp/stable_patches
A small collection of patches that fix issues found by valgrind
2016-12-16 04:51:12 +01:00
Donald Sharp
c9d5bd27c1 bgpd: Fix 'show ip bgp summary' variable output being wrong
The first time through calling 'show ip bgp summary'
we were always calculating the variable hostname field
size incorrectly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-15 21:28:51 -05:00
Donald Sharp
26acb92b84 bgpd: Cleanup double read of free'd data
Valgrind found this issue.  This cleans it
up from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-15 21:00:03 -05:00
Donald Sharp
8eefe200e0 lib: Ensure ptrs are NULL on free
There exists a possibility that when we cleanup
for shutdown that we may attempt to access
them again.

Found via valgrind, stopped showing up in there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-15 21:00:03 -05:00