Commit Graph

134 Commits

Author SHA1 Message Date
Quentin Young
ade6974def *: style for flog_warn conversions
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06 20:56:41 +00:00
Donald Sharp
0e411ce681 lib: Modify zlog_warn to vty_out
The vty_prefix_list_install function was modifying the prefix to match the
specified prefix length and warning in the log file.  Modify
code to use zlog_info as that a warn implies that something has
gone terribly wrong.  Additionally display to the terminal as
well so that user can get immediate feedback from something
that they can correct.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-06 20:50:58 +00:00
David Lamparter
1fbd4e382a
Merge pull request #2945 from dslicenc/bgp-ospf-json
bgpd/ospfd: make bgp and ospf json response a bit more consistent
2018-09-01 05:05:30 +02:00
Donatas Abraitis
fbc7ead79c plist: Add safety check to avoid going over 4294967295 for prefix-list 2018-08-31 16:38:56 +03:00
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
Mark Stapp
123214efb8 libs, daemons: use const in route-map apply
Use 'const prefix *' in route-map apply apis; led to some
corresponding changes in several daemons.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-07-23 10:34:35 -04:00
paco
e59294e2e4
ldpd lib: null check (Coverity 1452287 + 20 alike)
Coverity issues fixed with this commit:

1452287 1452291 1452307 1452310 1452317 1452321 1452327 1452330 1452331 1452336
1452337 1452340 1452352 1452354 1452358
(originated at ldpd/ldpd_vty_cmds_clippy.c)

1448388 1448390 1448392 1448397 1448404 1448408
(originated at lib/plist_clippy.c)

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-21 12:31:57 +02:00
paco
9eaec2ae4b
lib: out-of-bounds access (Coverity 1457145)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 17:08:38 +02:00
Donald Sharp
24512fbd1f lib: Convert internal sequence number to int64_t
With the usage of a 32 bit number as a integer, but storing
non-signed values in it, we have cases where numbers greater
than 2 billion are being read in and stored and used before
lower value numbers, which of course is awful and mean.

Fixes: #2126
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-29 12:45:20 -04:00
Donald Sharp
e11d84ad27 lib: convert plist data structures to using a bool
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-29 12:44:51 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Renato Westphal
2e4c229616 *: make clippy usage more consistent
Fixes #1511.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-12-04 19:46:38 -02:00
Donald Sharp
4015e91850 lib: Fix prefix-list where le is == prefixlen
This should be allowed:

robot(config)# ip prefix-list outbound_asp_routes seq 33 permit 1.1.1.0/24 le 24
% Invalid prefix range for 1.1.1.0/24, make sure: len < ge-value <= le-value

This commit fixes the issue:

robot(config)# ip prefix-list outbound_asp_routes seq 33 permit 1.1.1.0/24 le 23
% Invalid prefix range for 1.1.1.0/24, make sure: len < ge-value <= le-value
robot(config)# ip prefix-list outbound_asp_routes seq 33 permit 1.1.1.0/24 le 24
robot(config)# ip prefix-list outbound_asp_routes seq 33 permit 1.1.1.0/24 le 25
robot(config)#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-28 19:55:07 -05:00
Donald Sharp
4f3749854a lib: Only apply prefix's to the same family
When we have a v4 or v6 prefix list, only
apply it via a match when the address families
are the same.

Fixes: #1339
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-07 10:54:03 -05:00
Donald Sharp
ce94edc733 lib: Modify prefix_list_apply to allow retrieval of prefix
Create a new function prefix_list_apply_which_prefix which
will return a pointer to the matching prefix that caused
the acceptance/denial.

This change will be used in future commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
David Lamparter
427f8e61bb ospf6d: properly update prefix list references
Register add/delete hooks with the prefix list code to properly change
ospf6_area's prefix list in/out pointers.

There are 2 other uncached uses of prefix lists in the ASBR route-map
code and the interface code;  these should probably be cached too. (To
be fixed another day...)

Fixes: #453
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-24 00:18:53 +02:00
David Lamparter
b4e55fc5e8 lib: fix prefix list trie corruption
The specific code here needs to establish an absolute order of more
specific to less specific possible matches in a prefix list.  This is
indirectly checked by an assert on insertion, because the "next best"
entry is required to be consistent even when joining multiple chains
of candidates.

Unfortunately, trie_install_fn() would insert entries too far ahead in
the chain if another entry with higher sequence number was seen.  This
breaks the trie and (rightfully) triggers the assertion failure on
insert.

Fixes: #937
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-11 19:02:22 +02:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
2d8270596a Merge remote-tracking branch 'frr/master' into newline-redux
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 13:07:30 +02:00
David Lamparter
26a429fe8e *: remove VTYNL, part 2 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
6d3c2ed4ed *: remove VTYNL, part 1 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
Daniel Walton
f1a05de982 vtysh: return non-zero for configuration failures
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This allows frr-reload.py (or anything else that scripts via vtysh)
to know if the vtysh command worked or hit an error.
2017-07-13 19:56:08 +00:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
Quentin Young
7111c1a0cd
*: fix excess docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-05 15:33:00 -04:00
Quentin Young
e31b6333f4 *: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:56 +00:00
Quentin Young
1318e7c841 *: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:54 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
David Lamparter
6cdff32196 lib: use DEFPY() for plist.c
Shorten lib/plist.c by combining the various command variants...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-14 19:29:26 +02:00
David Lamparter
b85120bcb3 lib: detangle protocol name/instance from logging
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 14:07:28 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
David Lamparter
70d44c5cd4 lib: cli: autocomplete variables
Shows known values in the appropriate naming domain when the user hits
<?> or <Tab>.  This patch only works in the telnet CLI, the next patch
adds vtysh support.

Included completions:
- interface names
- route-map names
- prefix-list names

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 10:27:43 -04:00
David Lamparter
deaa50db47 lib: hide away logging internals
... no need to have struct zlog generally-exposed.

A few files get to include log_int.h because they use zlog/vzlog.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:40 +01:00
David Lamparter
bf1013e6c4 lib: simplify protocol/log naming
The protocols enum serves no purpose other than adding potential for
bugs and making it complicated to add a new protocol... nuke.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-08 00:15:40 +01:00
Quentin Young
fd995a99e4 lib: add stream.h, vty.h, zebra.h to plist.h
Since `afi_t` and `struct vty` are used in plist.h, the appropriate
headers for them should be included.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-03-02 02:09:00 +00:00
Philippe Guibert
42f621a6ea lib: replace AFI_ETHER reference with AFI_L2VPN
The introduction of AFI_L2VPN prefix makes usage of AFI_ETHER deprecated
and is of no usage currently. The latter define is linked to AFI_L2VPN.
For that, the prefix enumerate has the AFI_ETHER value removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-14 13:59:00 +01:00
David Lamparter
a31ff449a0 lib: fix some coverity NULL check warnings
Reported-by: Coverity Scan
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-08 16:34:59 +01:00
Donald Sharp
1a35e2e565 Merge remote-tracking branch 'origin/stable/2.0' 2017-02-02 10:42:51 -05:00
David Lamparter
98645ada19 lib: plug leak in prefix_list_delete()
prefix_list_delete wasn't releasing chained trie entries, only the main
one.  Just call the proper trie_del.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-01 13:24:37 +01:00
Donald Sharp
56c1f7d852 frr: Remove HAVE_IPV6 from code base
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-13 08:05:50 -05:00
Quentin Young
5435e6e88c lib: Fix ipv6 access-list... and ipv6 prefix-list...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-18 21:27:30 +00:00
Quentin Young
e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Donald Sharp
0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Donald Sharp
69b5e938fe Merge remote-tracking branch 'origin/cmaster' into cmaster-next 2016-09-29 20:24:49 -04:00
Daniel Walton
58749582a9 all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 00:16:31 +00:00
Daniel Walton
67656e9b65 all: added CHECK ME for DEFUNs that look at argc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 17:48:57 +00:00
Daniel Walton
2aac576795 use JSON_C_TO_STRING_PRETTY for json_object_to_json_string
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-28 04:52:36 +00:00
Daniel Walton
e961923c72 bgpd, etc: changed .LINE to LINE...
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-27 00:07:46 +00:00
Quentin Young
d862bffbda lib: lib compiles
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-09-23 21:34:33 +00:00
Daniel Walton
c349116d7c lib: add 'int idx_foo' argv index variables
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 20:17:29 +00:00
Daniel Walton
6147e2c694 convert <1-255> to (1-255), ()s to <>s, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 13:47:20 +00:00
Daniel Walton
f412b39a33 ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebra
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 03:55:26 +00:00
Daniel Walton
6f1ccc12de lib: argv update for filter.c, if_rmap.c keychain.c and plist.c
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-23 00:58:26 +00:00
Daniel Walton
86c42eff78 Revert "lib: Fixup plist.c"
This reverts commit c65a0fe1c6.
2016-09-22 18:22:59 +00:00
Donald Sharp
c65a0fe1c6 lib: Fixup plist.c 2016-09-20 21:58:16 -04:00
David Lamparter
4a1ab8e405 *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEs
This is a rather large mechanical commit that splits up the memory types
defined in lib/memtypes.c and distributes them into *_memory.[ch] files
in the individual daemons.

The zebra change is slightly annoying because there is no nice place to
put the #include "zebra_memory.h" statement.

bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the
library for its own use.  This is bad practice and would break when the
memtype are made static.

Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[CF: rebased for cmaster-next]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-09-19 16:31:04 -04:00
Don Slice
ddb13fd374 lib: apply mask to prefix in prefix-list
A crash occurred if a prefix was defined in a prefix-list that
contained bits in the prefix but a /0 mask.  Resolving that crash
and improving usability by applying the mask to the supplied prefix
and notifying the user if the prefix was modified.

Ticket: CM-12744
Signed-off-by: Don Slice
Reviewed_By:
Testing Done: Manual testing attached to the ticket, bgp-min, bgp-smoke
ospf-min, and ospf-smoke all completed before commit
2016-09-12 06:32:11 -07:00
Lou Berger
32ac65d9fa lib: add AF_ETHERNET/AFI_ETHER 2016-09-03 11:05:51 -04:00
Donald Sharp
e978e1de98 lib, bgpd: Fixup afi_t to be an enum and cleanup zebra.h
This code change does two things:

1) Removes ZEBRA_AFI_XXX #defines since they were redundant information
2) Switches afi_t to an enumerated type so that the compiler
can do a bit more compile time checking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit f3cfc46450cccc5ac035a5a97c5a1a5484205705)

Conflicts:
	bgpd/bgp_open.c
	bgpd/bgp_open.h
	bgpd/bgp_routemap.c
2016-06-06 14:20:24 -07:00
Paul Jakma
63a2a35418 lib/plist: Add some required parentheses, according to clang-analyzer
(cherry picked from commit 18f420e9f99e7f6557cf5877673cd6e71ac32192)
2016-05-26 01:09:17 +00:00
Donald Sharp
77c489986e lib: plist should not CMD_WARNING when command has already been entered
When you startup zebra and apply a prefix list command, and then at a
later point in time start up additional daemons and then attempt to
apply the integrated-config, the prefix-list command will stop
processing after zebra.

This is because when zebra attempted to process the command, it would
notice that it already had that cli handled and print a vty warning and
then it would return CMD_WARNING. This caused the loop over all the
commands to stop and as such the command would not be sent to all the
individual daemons.

This behavior is exactly the same as it is in the 2.5.X( hell it's
upstream behavior to! ). Modify the plist command to return CMD_SUCCESS
in this case.

Ticket: CM-10248
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
2016-04-04 12:40:33 -04:00
Daniel Walton
c4f97df215 ip/ipv6 prefix-list seq number range needs to be fixed - wraps around to
negative value

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-8023
2016-03-02 20:42:01 +00:00
Donald Sharp
37b6ab6f00 lib: Fix crash when deleting multiple statements
When deciding if we should delete a table we were
only looking at the part of the data structures
associated with the table to see if it was empty.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-03-01 16:55:53 -05:00
Daniel Walton
301d65c0ba Quagga crash in prefix_list_apply
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-8130
2015-11-06 16:36:37 +00:00
David Lamparter
20b8a998aa lib: optimise prefix list setup
- duplicate prefix check can use the trie structure
- appending with a seq# beyond the end of the list can shortcut

Configuration load is now bottlenecked by cmd_element_match() and
strcmp().  For a real-world routeserver prefix list configuration
(38668 lines of config for multiple prefix lists):
  before: 4.73s
  after:  1.92s    x 2.46

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2015-11-03 05:54:27 -08:00
David Lamparter
7e111b6b0d lib: use trie structure for prefix list matching
Prefix lists were implemented with a simple linear list that is scanned
sequentially.  This is, of course, extremely inefficient as it scales by
O(n).  This patch adds a trie-ish data structure that allows quickly
descending based on the prefix.

Note that the trie structure used here is designed for real-world use,
hence it uses a relatively crude fixed-size bytewise table instead of
some fancy balancing scheme.  It is quite cacheline efficient.

Using real-world routeserver prefix lists, matching against a fulltable
dump:

entries   before     after    factor
   9103   63.8s      .0124s   5142x
    772    4.52s     .0101s    445.3x
     86     .445s    .0098s     45.51x
      7     .0379s   .0099s      3.834x
      2     .0136s   .0095s      1.440x
      1     .0084s   .0095s       .879x

This buys CPU with memory.  Memory usage on an IXP setup with 100k
prefix list entries is an additional 4 MB on top of the 9.5 MB that it
was before.
2015-11-03 05:54:14 -08:00
David Lamparter
c7da3d50b3 lib: straighten out ORF prefix list support
BGP ORF prefix lists are in a separate namespace; this was previously
hooked up with a special-purpose AFI value.  This is a little kludgy for
extension, hence this splits it off.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2015-11-03 05:49:39 -08:00
David Lamparter
a38401b6af lib: hide internal prefix list structures
These are about to be touched and there's no point in other code
touching into prefix list's internas.  Add some isolation.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2015-11-03 05:42:24 -08:00
Morgan Stewart
856ca177c4 Added json formating support to show-...-neighbors-... bgp commands.
Ticket: CM-6789
Reviewed By: CCR-3263
Testing Done: Manual Testing and smoke tests

Whenever some sort of output is encountered, added a json version with
proper logic as well.
2015-08-12 13:24:02 -07:00
Donald Sharp
3f9c7369f7 BGP: Add dynamic update group support
This patch implements the 'update-groups' functionality in BGP. This is a
function that can significantly improve BGP performance for Update generation
and resultant network convergence. BGP Updates are formed for "groups" of
peers and then replicated and sent out to each peer rather than being formed
for each peer. Thus major BGP operations related to outbound policy
application, adj-out maintenance and actual Update packet formation
are optimized.

BGP update-groups dynamically groups peers together based on configuration
as well as run-time criteria. Thus, it is more flexible than update-formation
based on peer-groups, which relies on operator configuration.

[Note that peer-group based update formation has been introduced into BGP by
Cumulus but is currently intended only for specific releases.]

From 11098af65b2b8f9535484703e7f40330a71cbae4 Mon Sep 17 00:00:00 2001
Subject: [PATCH] updgrp commits
2015-05-19 18:03:47 -07:00
Donald Sharp
518f0eb188 bgpd: bgpd-event-driven-route-map-updates.patch
BGP: Reprocess the trigger points when an attached route map changes

Currently, modifications to route maps do not affect already processed
routes; they only affect new route updates. This patch addresses this
limitation.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 17:40:45 -07:00
David Lamparter
6b0655a251 *: nuke ^L (page feed)
Quagga sources have inherited a slew of Page Feed (^L, \xC) characters
from ancient history.  Among other things, these break patchwork's
XML-RPC API because \xC is not a valid character in XML documents.

Nuke them from high orbit.

Patches can be adapted simply by:
	sed -e 's%^L%%' -i filename.patch
(you can type page feeds in some environments with Ctrl-V Ctrl-L)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-06-04 06:58:02 +02:00
Stephen Hemminger
7fc626de5f [cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
2009-06-12 17:10:29 +01:00
Paul Jakma
30a2231a48 [warnings] Fix various SOS warnings
2008-08-15 Paul Jakma <paul.jakma@sun.com>

	* */*: Fix various problems flagged by Sun Studio compiler.
	  - '<qualifier> <storage>' obsolescent in declarations
	  - empty statements (';' after ALIAS definitions)
	  - implicit declarations (e.g printstack in lib/log.c)
	  - "\%" in printf string instead of "%%"
	  - loops that return on the first iteration (legitimately, but
 	    compiler can't really know), e.g. bgp_routemap.c
 	  - internal declarations which mask prototypes.
2008-08-22 19:52:59 +01:00
Paul Jakma
9376c3421a [lib] CID #3, fix forward-null errors in vty_prefix_list_uninstall
2006-05-12 Paul Jakma <paul.jakma@sun.com>

	* plist.c: (vty_prefix_list_uninstall) Fix potential NULL deref
	  of prefix and typestr strings, Coverity CID #3.
2006-05-12 23:17:38 +00:00
vincent
fbf5d03304 2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* lib/filer.c: show protocol name in filter_show()
    * lib/plist.c: show protocol name in vty_show_prefix_entry()
    * routemap.c: show protocol name in vty_show_route_map_entry()
    * lib/vty.c: in vty_command(), show protocol name if command unknown

    * zebra/zserv.c: Always provide distance fo route add

    * ripd/rip_snmp.c: rip2IfConfReceive() sends values in conformance
      with RFC. Also PeerDomain is now set to a STRING type.
    * ripd/ripd.h: rip_redistribute_add() API includes metric and distance
    * ripd/ripd.c: rip_redistribute_add() API i.e. stores metric and distance
      Now allows a RIP-route to overcome a redistributed route coming
      from a protocol with worse (higher) administrative distance
      Metrics from redistribution are shown in show ip rip
    * ripd/rip_zebra.c: adapt to the rip_redistribute_add() API, i.e.
      provide distance and metric
    * ripd/rip_interface.c: adapt to the rip_redistribute_add() API
    * ripd/rip_routemap.c: no RMAP_COMPILE_ERROR on (metric > 16) usage
      rather a CMD_WARNING, because set metric ius shared with other
      protocols using larger values (such as OSPF)
      The match metric action takes first external metric if present
      (from redistribution) then RIP metric.
2005-09-29 11:25:50 +00:00
paul
8cc4198f9f 2005-05-06 Paul Jakma <paul@dishone.st>
* (general) extern and static'ification of functions in code and
	  header.
	  Cleanup any definitions with unspecified arguments.
	  Add casts for callback assignments where the callback is defined,
	  typically, as passing void *, but the function being assigned has
	  some other pointer type defined as its argument, as gcc complains
	  about casts from void * to X* via function arguments.
	  Fix some old K&R style function argument definitions.
	  Add noreturn gcc attribute to some functions, as appropriate.
	  Add unused gcc attribute to some functions (eg ones meant to help
	  while debugging)
	  Add guard defines to headers which were missing them.
	* command.c: (install_node) add const qualifier, still doesnt shut
	  up the warning though, because of the double pointer.
	  (cmp_node) ditto
	* keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived
	  fromn vty.h ones to fix some of the (long) < 0 warnings.
	* thread.c: (various) use thread_empty
	  (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type
	* vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they
	  removed from ospfd/ospf_vty.h
	* zebra.h: Move definition of ZEBRA_PORT to here, to remove
	  dependence of lib on zebra/zserv.h
2005-05-06 21:25:49 +00:00
ajs
3b8b185503 2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* buffer.h: Fix comment on buffer_getstr to reflect that it now
	  uses XMALLOC.
	* buffer.c: (buffer_getstr) Use XMALLOC(MTYPE_TMP) instead of malloc.
	* filter.c: (access_list_remark,ipv6_access_list_remark) Use
	  argv_concat instead of buffer_getstr.
	* if.c: (interface_desc) Use argv_concat instead of buffer_getstr.
	* plist.c: (ip_prefix_list_description,ipv6_prefix_list_description)
	  Use argv_concat instead of buffer_getstr.
	* bgp_filter.c: (ip_as_path,no_ip_as_path) Use argv_concat instead
	  of buffer_getstr.
	* bgp_route.c: (bgp_show_regexp) Fix memory leak: need to free string
	  returned by buffer_getstr.
	  (bgp_show_community) Must use XFREE instead of free on string
	  returned by buffer_getstr.
	* bgp_routemap.c: (set_community) Must use XFREE instead of free
	  on string returned by buffer_getstr.
	* bgp_vty.c: (neighbor_description) Use argv_concat instead of
	  buffer_getstr.
2005-01-29 18:19:13 +00:00
paul
9035efaa92 2004-10-10 Paul Jakma <paul@dishone.st>
* version.h.in: (pid_output*) add const qualifier.
	* command.h: Change DEFUN func to take const char *[] rather
          than char **, to begin process of fixing compile warnings in lib/.
          Nearly all other changes in this commit follow from this change.
        * buffer.{c,h}: (buffer_write) pointer-arithmetic is gccism, take
          const void * and cast an automatic const char *p to it.
          (buffer_putstr) add const
        * command.c: (zencrypt) const qualifier
          (cmd_execute_command_real) ditto
          (cmd_execute_command_strict) ditto
          (config_log_file) ditto.
          Fix leak of getcwd() returned string.
        * memory.{c,h}: Add MTYPE_DISTRIBUTE_IFNAME for struct dist ifname.
        * distribute.{c,h}: Update with const qualifier.
          (distribute_free) use MTYPE_DISTRIBUTE_IFNAME
          (distribute_lookup) Cast to char *, note that it's ok.
          (distribute_hash_alloc) use MTYPE_DISTRIBUTE_IFNAME.
          (distribute_get)  Cast to char *, note that it's ok.
        * filter.c: Update with const qualifier.
        * if.{c,h}: ditto.
        * if_rmap.{c,h}: ditto.
          (if_rmap_lookup) Cast to char *, note that it's ok.
          (if_rmap_get) ditto.
        * log.{c,h}: Update with const qualifier.
        * plist.{c,h}: ditto.
        * routemap.{c,h}: ditto.
        * smux.{c,h}: ditto. Fix some signed/unsigned comparisons.
        * sockopt.c: (getsockopt_cmsg_data) add return for error case.
        * vty.c: Update with const qualifier.
2004-10-10 11:56:56 +00:00
hasso
8c328f1106 Number of warnings is down to 3 again in lib directory. A lot of const's
added to strings and a lot of int -> unsigned int changes.
2004-10-05 21:01:23 +00:00
paul
02ff83c525 2004-06-11 Sowmini Varadhan <sowmini.varadhan@sun.com>
* filter.c: (access_list_remark_cmd) buffer_putstr doesnt need cast
          to u_char. (ipv6_access_list_remark_cmd) ditto.
          if.c: ditto
        * network.c: (readn/writen) pointer arg should be type u_char.
        * plist.c: needs to include stream.h, not declare stream functions
          internally.
          (various) Add static qualifier to internal functions.
          (prefix_list_type_str) extraneous breaks in switch statement.
          (ip_prefix_list_description_cmd) buffer_putstr doesnt need cast
        * stream.h: depends on plist.h and export stream_put_prefix
        * vty.c: (vty_<telnet option build functions>) should use
          unsigned char, telnet options are 0 -> 255.
        * zclient.c: various u_char<->char type cleanups.
        * zebra.h: Having to define CMSG_* can apply to more than just
          BSDI_NRL.
        * ripd.c: (rip_distribute_update_all) distribute list hook
          function pointer prototype requires struct prefix_list * arg.
          (rip_distribute_update_all_wrapper) update to pass required arg,
          NULL.
2004-06-11 11:27:03 +00:00
paul
718e374419 Initial revision 2002-12-13 20:15:29 +00:00