]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
12 years agobabeld: justify "running-config" meaning in CLI
Denis Ovsienko [Sat, 11 Feb 2012 17:06:16 +0000 (21:06 +0400)]
babeld: justify "running-config" meaning in CLI

The primary focus of this commit is to make "show running-config"
command display more current configuration, including some of the bits
previously seen in the output of "show babel running-config". Besides
that, the following commands were renamed for consistency with the
syntax of other components:

"debug *" to "debug babel *" (and moved to top level)
"show babel running-config" to "show babel parameters"

* babel_interface.c
  * show_babel_running_config(): rename to show_babel_parameters(),
    update syntax pattern, don't call show_babeld_configuration()
  * babel_if_init(): update respectively
  * babel_enable_if_config_write(): new VTY helper for static
    babel_enable_if
* babel_interface.h: add extern declaration
* babel_main.c: unset all debug options by default
  * show_babel_main_configuration(): remove debug options decoder
* babel_zebra.c
  * babel_debug(): rename to debug_babel(), update syntax pattern
  * no_babel_debug(): rename to no_debug_babel(), update syntax pattern
  * babelz_zebra_init(): update respectively
  * debug_babel_config_write() new VTY helper for static debug_type
* babel_zebra.h: add extern declaration
* babeld.c
  * babel_config_write(): add the code to output "debug babel *",
    "router babel", "redistribute *" and "network *" statements
  * show_babeld_configuration(): dismiss
* babeld.h: remove extern declaration
* babeld.texi: update for renamed commands
* babeld.conf.sample: idem, add debug statements block

12 years agoRemove dead variable reboot_time.
Juliusz Chroboczek [Sat, 11 Feb 2012 16:48:05 +0000 (17:48 +0100)]
Remove dead variable reboot_time.

Thanks to Denis Ovsienko.

12 years agodoc: fix typo.
Matthieu Boutier [Sat, 11 Feb 2012 14:09:33 +0000 (15:09 +0100)]
doc: fix typo.

12 years agodoc: update babeld documentation.
Juliusz Chroboczek [Sat, 11 Feb 2012 13:28:17 +0000 (14:28 +0100)]
doc: update babeld documentation.

12 years agodoc: fix Makefile dependencies for babeld.
Juliusz Chroboczek [Sat, 11 Feb 2012 13:27:16 +0000 (14:27 +0100)]
doc: fix Makefile dependencies for babeld.

12 years agobabeld: display update-interval and resend-delay in show commands"
Juliusz Chroboczek [Sat, 11 Feb 2012 13:06:24 +0000 (14:06 +0100)]
babeld: display update-interval and resend-delay in show commands"

12 years agobabeld: vty commands (hello-interval, update-interval, resend-delay).
Juliusz Chroboczek [Sat, 11 Feb 2012 13:02:10 +0000 (14:02 +0100)]
babeld: vty commands (hello-interval, update-interval, resend-delay).

12 years agobabeld: remove port and group setting commands.
Juliusz Chroboczek [Sat, 11 Feb 2012 12:34:30 +0000 (13:34 +0100)]
babeld: remove port and group setting commands.

They didn't work anyway, since they're called too late.

12 years agoResynchronise with babeld-1.3.1.
Juliusz Chroboczek [Sat, 11 Feb 2012 12:08:00 +0000 (13:08 +0100)]
Resynchronise with babeld-1.3.1.

12 years agobabeld: dismiss babel_redistribute_unset()
Denis Ovsienko [Sat, 11 Feb 2012 11:25:01 +0000 (15:25 +0400)]
babeld: dismiss babel_redistribute_unset()

The function was effectively duplicating existing
zclient_redistribute(). This makes no_babel_redistribute_type()
consistent with babel_redistribute_type()

12 years agobabeld: fix wire{d,less} commands name.
Matthieu Boutier [Wed, 8 Feb 2012 22:30:46 +0000 (23:30 +0100)]
babeld: fix wire{d,less} commands name.

12 years agoripd: add babel for redistribution.
Matthieu Boutier [Thu, 9 Feb 2012 20:51:17 +0000 (21:51 +0100)]
ripd: add babel for redistribution.

12 years agoripngd: Replace redistribution strings with route_types.h defines.
Matthieu Boutier [Thu, 9 Feb 2012 19:58:07 +0000 (20:58 +0100)]
ripngd: Replace redistribution strings with route_types.h defines.

12 years agobabeld: Add support for blackhole routes.
Juliusz Chroboczek [Thu, 9 Feb 2012 16:23:09 +0000 (17:23 +0100)]
babeld: Add support for blackhole routes.

Babel makes use of blackhole routes to prevent routing loops between
overlapping prefixes shortly after a route is retracted (see RFC 6126
sections 2.8 and 3.5.5).  This patch adds support for installing such
blackhole routes.

12 years agobabeld: refactor filtering stubs.
Juliusz Chroboczek [Thu, 9 Feb 2012 13:06:11 +0000 (14:06 +0100)]
babeld: refactor filtering stubs.

Factorise the common parts of the in/out filtering functions.  This also
fixes a bug with filtered out routes, which in babeld are signalled by
a filter returing INFINITY, not -1.

12 years agozebra: Display uptime of Babel routes in show ip[v6] route.
Juliusz Chroboczek [Thu, 9 Feb 2012 12:42:28 +0000 (13:42 +0100)]
zebra: Display uptime of Babel routes in show ip[v6] route.

12 years agobabeld: Use quagga_gettime.
Juliusz Chroboczek [Thu, 9 Feb 2012 12:35:27 +0000 (13:35 +0100)]
babeld: Use quagga_gettime.

12 years agobabeld: Don't use an ifindex when installing IPv4 routes.
Juliusz Chroboczek [Thu, 9 Feb 2012 11:29:10 +0000 (12:29 +0100)]
babeld: Don't use an ifindex when installing IPv4 routes.

Stand-alone babeld installs routes using both a next-hop gateway
and an interface index.  Unfortunately, this doesn't work for IPv4
under Quagga.

We now ignore the ifindex when installing IPv4 routes, which makes
Babel work for IPv4 in prefix-based networks.  Of course this breaks
IPv4 mesh networks, unless you play some tricks with your interfaces'
netmasks.

12 years agobabeld: remove some unused functions' arguments.
Matthieu Boutier [Tue, 31 Jan 2012 16:09:55 +0000 (17:09 +0100)]
babeld: remove some unused functions' arguments.

12 years agodoc: fix typo in babeld.
Matthieu Boutier [Tue, 7 Feb 2012 23:32:59 +0000 (00:32 +0100)]
doc: fix typo in babeld.

12 years agodoc: Document babeld.
Juliusz Chroboczek [Tue, 7 Feb 2012 15:33:17 +0000 (16:33 +0100)]
doc: Document babeld.

12 years agobabeld: Indentation fix.
Juliusz Chroboczek [Tue, 7 Feb 2012 04:44:41 +0000 (05:44 +0100)]
babeld: Indentation fix.

12 years agobabeld: Error handling and tweaks for babeld commands.
Juliusz Chroboczek [Tue, 7 Feb 2012 04:43:36 +0000 (05:43 +0100)]
babeld: Error handling and tweaks for babeld commands.

12 years agobabeld: Fix typo in hello interval command.
Juliusz Chroboczek [Tue, 7 Feb 2012 04:36:06 +0000 (05:36 +0100)]
babeld: Fix typo in hello interval command.

12 years agovtysh: Vtysh support for babeld.
Juliusz Chroboczek [Tue, 7 Feb 2012 03:58:49 +0000 (04:58 +0100)]
vtysh: Vtysh support for babeld.

12 years agobabeld: Replace the babeld.conf.sample file by one that actually works.
Juliusz Chroboczek [Tue, 7 Feb 2012 03:56:47 +0000 (04:56 +0100)]
babeld: Replace the babeld.conf.sample file by one that actually works.

12 years agobabeld: fix interface bug, simplify code.
Matthieu Boutier [Fri, 27 Jan 2012 23:29:51 +0000 (00:29 +0100)]
babeld: fix interface bug, simplify code.

Perhaps could it be able to free already free memory (so free(NULL)),
in function interface_reset().  On other hand, it initiated untracked
interfaces, raising (at least) inappropriate messages. Finally, I
remove the BABEL_IF_IS_ENABLE flag, witch was not really usefull.
Note the test if_up isn't weaker, because (...IS_UP => ...IS_ENABLE).

12 years agobabeld: state-file was loaded too early. Initial seqno too.
Matthieu Boutier [Sat, 28 Jan 2012 09:35:12 +0000 (10:35 +0100)]
babeld: state-file was loaded too early. Initial seqno too.

12 years agobabeld: fix eui64 features.
Matthieu Boutier [Fri, 27 Jan 2012 23:07:14 +0000 (00:07 +0100)]
babeld: fix eui64 features.

We are interested by eui64 with at least 6 octets.

12 years agobabeld: "return CMD_SUCCESS" was missing for command 'no debug'.
Matthieu Boutier [Fri, 27 Jan 2012 21:54:11 +0000 (22:54 +0100)]
babeld: "return CMD_SUCCESS" was missing for command 'no debug'.

12 years agobabeld: Replace redistribution strings with route_types.h defines.
Matthieu Boutier [Thu, 26 Jan 2012 21:15:34 +0000 (22:15 +0100)]
babeld: Replace redistribution strings with route_types.h defines.

12 years agobabeld: babelz merge.
Matthieu Boutier [Mon, 23 Jan 2012 22:46:32 +0000 (23:46 +0100)]
babeld: babelz merge.

Babelz is the last version of the stand-alone babel daemon. In
particular, it use multiple channels to diminuate
interferences. Please refer to this one for more details.

12 years agobabeld: remove unused variable.
Matthieu Boutier [Sun, 22 Jan 2012 23:22:14 +0000 (00:22 +0100)]
babeld: remove unused variable.

12 years agovtysh: fix regexp for install_element() in babeld
Ang Way Chuang [Fri, 27 Jan 2012 16:52:27 +0000 (20:52 +0400)]
vtysh: fix regexp for install_element() in babeld

12 years agobabeld: add MP-specific zclient API fix
Denis Ovsienko [Sat, 21 Jan 2012 19:16:00 +0000 (23:16 +0400)]
babeld: add MP-specific zclient API fix

Add proper initialization of SAFI field, which is present in the
revisions of zapi_ipv4 and zapi_ipv6 structures specific to
MP-BGP patchset. Without this change no Babel routes could make
into zebra RIB.

12 years agobabeld: change the modify route system.
Matthieu Boutier [Fri, 20 Jan 2012 14:32:16 +0000 (15:32 +0100)]
babeld: change the modify route system.

Zebra doesn't set errno to EEXIST if we add a route who was already in
the kernel, so we always returned after just doing "add; delete". This
patch fix the problem by doing "delete; add" always.

12 years agobabeld: fix bug due to v4mapped addresses.
Matthieu Boutier [Fri, 20 Jan 2012 16:53:57 +0000 (17:53 +0100)]
babeld: fix bug due to v4mapped addresses.

12 years agobabeld: add command (config) to set debug flags.
Matthieu Boutier [Thu, 19 Jan 2012 23:19:35 +0000 (00:19 +0100)]
babeld: add command (config) to set debug flags.

12 years agobabeld: remove useless variable, make local another.
Matthieu Boutier [Thu, 19 Jan 2012 21:38:56 +0000 (22:38 +0100)]
babeld: remove useless variable, make local another.

12 years agomemory: install babel memory informations.
Matthieu Boutier [Thu, 19 Jan 2012 21:37:38 +0000 (22:37 +0100)]
memory: install babel memory informations.

12 years agobabeld: fix commands informations messages.
Matthieu Boutier [Wed, 18 Jan 2012 22:03:00 +0000 (23:03 +0100)]
babeld: fix commands informations messages.

12 years agobabeld: place the babel-state file in the quagga vars directory.
Matthieu Boutier [Wed, 18 Jan 2012 21:06:10 +0000 (22:06 +0100)]
babeld: place the babel-state file in the quagga vars directory.

12 years agobabeld: use zlog_debug instead of do_debugf, for debugf.
Matthieu Boutier [Wed, 18 Jan 2012 19:20:59 +0000 (20:20 +0100)]
babeld: use zlog_debug instead of do_debugf, for debugf.

12 years agobabeld: add command: "show_babel_running_config".
Matthieu Boutier [Thu, 19 Jan 2012 21:36:56 +0000 (22:36 +0100)]
babeld: add command: "show_babel_running_config".

12 years agobabeld: add command: "show_babel_database".
Matthieu Boutier [Wed, 18 Jan 2012 19:01:31 +0000 (20:01 +0100)]
babeld: add command: "show_babel_database".

12 years agobabeld: add command: "show_babel_neighbour".
Matthieu Boutier [Wed, 18 Jan 2012 15:39:29 +0000 (16:39 +0100)]
babeld: add command: "show_babel_neighbour".

12 years agobabeld: avoid segfault (bug 706).
Matthieu Boutier [Tue, 17 Jan 2012 23:52:06 +0000 (00:52 +0100)]
babeld: avoid segfault (bug 706).

12 years agobabeld: change fprintf(stderr) in term of zlog_err.
Matthieu Boutier [Tue, 17 Jan 2012 21:46:21 +0000 (22:46 +0100)]
babeld: change fprintf(stderr) in term of zlog_err.

12 years agobabeld: implement "show babel interface" command
Denis Ovsienko [Tue, 17 Jan 2012 15:25:03 +0000 (19:25 +0400)]
babeld: implement "show babel interface" command

* babel_interface.c
  * show_babel_interface_sub(): new function to process one ifp
  * show_babel_interface(): new function, VTY wrapper
  * babel_if_init(): update respectively

12 years agobabeld: add handling of "-z" cmdline arg
Denis Ovsienko [Tue, 17 Jan 2012 13:04:00 +0000 (17:04 +0400)]
babeld: add handling of "-z" cmdline arg

12 years agobabeld: bring babel_usage() into focus
Denis Ovsienko [Tue, 17 Jan 2012 13:00:20 +0000 (17:00 +0400)]
babeld: bring babel_usage() into focus

12 years agolib: update proto_redistnum() for Babel
Denis Ovsienko [Wed, 11 Jan 2012 14:18:56 +0000 (18:18 +0400)]
lib: update proto_redistnum() for Babel

12 years agobabeld: address remaining -Wcast-qual warnings
Denis Ovsienko [Tue, 10 Jan 2012 11:58:04 +0000 (15:58 +0400)]
babeld: address remaining -Wcast-qual warnings

* net.c
  * babel_send(): arguments are not treated as "const", justify
    declaration
* babel_main.c: declare constant pointers as such

12 years agobabeld: fix bug concerning pidfile.
Matthieu Boutier [Sun, 8 Jan 2012 16:07:10 +0000 (17:07 +0100)]
babeld: fix bug concerning pidfile.

12 years agobabeld: address some other compilation warnings.
Matthieu Boutier [Sun, 8 Jan 2012 15:43:08 +0000 (16:43 +0100)]
babeld: address some other compilation warnings.

12 years agobabeld: address some compilation warnings
Denis Ovsienko [Sun, 8 Jan 2012 12:52:36 +0000 (16:52 +0400)]
babeld: address some compilation warnings

Including system headers is not necessary with zebra.h included and
sometimes results in "__ASSERT_FUNCTION redefined" compilation warning.

* babeld.c
  * babel_distribute_update_interface(): make static
* babel_interface.c
  * interface_config_write(): unused 'babel_ifp'
  * don't include system headers
* message.c
  * send_request(): unused 'babel_ifp'
  * send_multihop_request(): idem
  * don't include system headers
* route.c: don't include system headers
* xroute.c: idem
* source.h: newline at EOF
* message.h: idem

12 years agobabeld: address FreeBSD "struct route" issue
Denis Ovsienko [Sun, 8 Jan 2012 11:29:19 +0000 (15:29 +0400)]
babeld: address FreeBSD "struct route" issue

FreeBSD system headers have their own "struct route", which made it
impossible to compile babeld. Switching babeld to "struct babel_route".

12 years agobabeld: clean kernel_zebra (old functions, fields...).
Matthieu Boutier [Fri, 6 Jan 2012 22:09:23 +0000 (23:09 +0100)]
babeld: clean kernel_zebra (old functions, fields...).

12 years agobabeld: Initial import, for Babel routing protocol.
Paul Jakma [Sun, 25 Dec 2011 16:52:09 +0000 (17:52 +0100)]
babeld: Initial import, for Babel routing protocol.

* Initial import of the Babel routing protocol, ported to Quagga.
* LICENCE: Update the original LICENCE file to include all known potentially
  applicable copyright claims.  Ask that any future contributors to babeld/
  grant MIT/X11 licence to their work.
* *.{c,h}: Add GPL headers, in according with the SFLC guidance on
  dealing with potentially mixed GPL/other licensed work, at:

  https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html

12 years agolib: fix endianness bug in prefix.c
Renato Westphal [Fri, 23 Mar 2012 19:27:40 +0000 (16:27 -0300)]
lib: fix endianness bug in prefix.c

While defining two "maskbytes" arrays for the respective endiannesses,
the code was unconditionally using one that only worked on little endian
systems.

Use preprocessor macros to avoid the somewhat expensive
htonl/ntohl macros.

From: Renato Westphal <renatowestphal@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoospfd: reduce ospf_verify_header()
Denis Ovsienko [Tue, 28 Feb 2012 11:15:29 +0000 (15:15 +0400)]
ospfd: reduce ospf_verify_header()

Protocol version checks fits ospf_packet_examin() better (like it is
implemented in ospf6d), and packet type check is already there.

12 years agoospfd: bring ospf_check_auth() into focus
Denis Ovsienko [Sun, 26 Feb 2012 13:59:43 +0000 (17:59 +0400)]
ospfd: bring ospf_check_auth() into focus

The old ospf_check_auth() function did two different jobs depending on
AuType. For Null and Simple cases it actually authenticated the packet,
but for Cryptographic case it only checked declared packet size (not
taking the actual number of bytes on wire into account). The calling
function, ospf_verify_header(), had its own set of MD5/checksum checks
dispatched depending on AuType.

This commit makes the packet size check work against the real number of
bytes and moves it to ospf_packet_examine(). All MD5/checksum
verification is now performed in ospf_check_auth() function.

* ospf_packet.c
  * ospf_packet_examin(): check length with MD5 bytes in mind
  * ospf_verify_header(): remove all AuType-specific code
  * ospf_check_auth(): completely rewrite

12 years agoospfd: introduce ospf_auth_type_str[]
Denis Ovsienko [Sun, 26 Feb 2012 13:00:57 +0000 (17:00 +0400)]
ospfd: introduce ospf_auth_type_str[]

12 years agoospfd: fix packet length check for auth/LLS cases
Denis Ovsienko [Mon, 20 Feb 2012 19:08:10 +0000 (23:08 +0400)]
ospfd: fix packet length check for auth/LLS cases

An OSPFv2 packet with trailing data blocks (authentication and/or
link-local signaling) failed the recently implemented packet length
check, because trailing data length isn't counted in the packet header
"length" field. This commit fixes respective check conditions.

* ospf_packet.c
  * ospf_packet_examin(): use "bytesdeclared" instead of "bytesonwire"

12 years agoospfd: introduce ospf_lsa_minlen[] (BZ#705)
Denis Ovsienko [Fri, 17 Feb 2012 12:20:50 +0000 (16:20 +0400)]
ospfd: introduce ospf_lsa_minlen[] (BZ#705)

This commit ports more packet checks to OSPFv2, in particular, LSA size
verification and Router-LSA link blocks verification.

* ospf_lsa.h: add LSA size macros
* ospf_packet.h: add struct ospf_ls_update
* ospf_packet.c
  * ospf_lsa_minlen[]: a direct equivalent of ospf6_lsa_minlen[]
  * ospf_router_lsa_links_examin(): new function, verifies trailing
    part of a Router-LSA
  * ospf_lsa_examin(): new function like ospf6_lsa_examin()
  * ospf_lsaseq_examin(): new function like ospf6_lsaseq_examin()
  * ospf_packet_examin(): add type-specific deeper level checks

12 years agoospfd: review ospf_check_md5_digest()
Denis Ovsienko [Mon, 30 Jan 2012 16:32:39 +0000 (20:32 +0400)]
ospfd: review ospf_check_md5_digest()

Rewrite some pointer arithmetics without the additional variables and
move byte order conversion inside the function.

12 years agoospfd: review ospf_check_auth()
Denis Ovsienko [Mon, 30 Jan 2012 12:07:18 +0000 (16:07 +0400)]
ospfd: review ospf_check_auth()

1. The only purpose of "ibuf" argument was to get stream size, which
was always equal to OSPF_MAX_PACKET_SIZE + 1, exactly as initialized
in ospf_new().

2. Fix the packet size check condition, which was incorrect for very
large packets, at least in theory.

12 years agoospfd: introduce ospf_packet_minlen[] (BZ#705)
Denis Ovsienko [Mon, 30 Jan 2012 11:41:39 +0000 (15:41 +0400)]
ospfd: introduce ospf_packet_minlen[] (BZ#705)

This commit ports some of the OSPFv3 packet reception checks
to OSPFv2.

* ospf_packet.c
  * ospf_packet_minlen[]: a direct equivalent of ospf6_packet_minlen[]
  * ospf_packet_examin(): new function designed after the first part
    of ospf6_packet_examin()
  * ospf_read(): verify received packet with ospf_packet_examin()
* ospf_packet.h: add convenience macros

12 years agoospfd: fix ospf_packet_add_top() to use LOOKUP()
Denis Ovsienko [Fri, 20 Jan 2012 18:32:10 +0000 (22:32 +0400)]
ospfd: fix ospf_packet_add_top() to use LOOKUP()

12 years agoospfd: use LOOKUP() for ospf_packet_type_str
Denis Ovsienko [Sun, 15 Jan 2012 15:12:19 +0000 (19:12 +0400)]
ospfd: use LOOKUP() for ospf_packet_type_str

* ospf_packet.h: add proper str/max extern declarations
* ospf_packet.c
  * ospf_packet_type_str: rewrite in "struct message", add max value
  * ospf_packet_add(): use LOOKUP()
  * ospf_write(): ditto
  * ospf_hello(): ditto
  * ospf_read(): ditto
* ospf_dump.h: the declaration does not belong here
* ospf_dump.c
  * ospf_header_dump(): use LOOKUP()
  * show_debugging_ospf(): ditto

12 years agodoc: Fix an apparently no longer legal @itemize @asis
Paul Jakma [Thu, 8 Mar 2012 16:42:31 +0000 (16:42 +0000)]
doc: Fix an apparently no longer legal @itemize @asis

* basic.texi: @asis isn't legal with @itemize apparently, should be @w
  according to docs, but @w{} seems to be needed. Fixes doc build error.

12 years agoHACKING.tex: Change to a LaTeX version of HACKING
Paul Jakma [Thu, 8 Mar 2012 13:51:21 +0000 (13:51 +0000)]
HACKING.tex: Change to a LaTeX version of HACKING

* configure.ac: Check for latexmk and pdflatex
* Makefile.am: Add a conditional target to build HACKING.pdf, as a convenience
* HACKING.tex: A slightly more structured HACKING, is readable on its own.
* HACKING: removed

12 years agoHACKING: Typo fix
Paul Jakma [Wed, 7 Mar 2012 11:42:03 +0000 (11:42 +0000)]
HACKING: Typo fix

12 years agoHACKING: Updates that have some initial consensus, for further iteration.
Paul Jakma [Wed, 7 Mar 2012 11:02:05 +0000 (11:02 +0000)]
HACKING: Updates that have some initial consensus, for further iteration.

12 years agoMerge remote-tracking branch 'quagga-gnu.org/master'
Paul Jakma [Mon, 5 Mar 2012 11:55:53 +0000 (11:55 +0000)]
Merge remote-tracking branch 'quagga-gnu.org/master'

12 years agobgpd: Open option parse errors don't NOTIFY, resulting in abort & DoS
Paul Jakma [Mon, 9 Jan 2012 20:59:26 +0000 (20:59 +0000)]
bgpd: Open option parse errors don't NOTIFY, resulting in abort & DoS

* bgp_packet.c: (bgp_open_receive) Errors from bgp_open_option_parse are
  detected, and the code will stop processing the OPEN and return.  However
  it does so without calling bgp_notify_send to send a NOTIFY - which means
  the peer FSM doesn't get stopped, and bgp_read will be called again later.
  Because it returns, it doesn't go through the code near the end of the
  function that removes the current message from the peer input streaam.
  Thus the next call to bgp_read will try to parse a half-parsed stream as
  if it were a new BGP message, leading to an assert later in the code when
  it tries to read stuff that isn't there. Add the required call to
  bgp_notify_send before returning.
* bgp_open.c: (bgp_capability_as4) Be a bit stricter, check the length field
  corresponds to the only value it can be, which is the amount we're going to
  read off the stream. And make sure the capability flag gets set, so
  callers can know this capability was read, regardless.
  (peek_for_as4_capability) Let bgp_capability_as4 do the length check.

12 years agotools/multiple-bgpd: Fix the PREV calculation so it works for <4 bgpd
Paul Jakma [Mon, 9 Jan 2012 13:54:33 +0000 (13:54 +0000)]
tools/multiple-bgpd: Fix the PREV calculation so it works for <4 bgpd

* tools/multiple-bgpd: Make PREV more general and correct. Add comment
  to route-map about why rt/soo sets are there - cause it's still broken.

12 years agoHACKING.pending: Add Quagga-RE details
Paul Jakma [Fri, 2 Mar 2012 11:56:38 +0000 (11:56 +0000)]
HACKING.pending: Add Quagga-RE details

12 years agolib: fix incorrect thread list processing loops
Paul Jakma [Tue, 28 Feb 2012 18:32:56 +0000 (18:32 +0000)]
lib: fix incorrect thread list processing loops

* thread.c: (thread_timer_process,thread_process) thread_list_delete nulls
  thread->next. Loops need to save next first, or will only process the head.
  Problem noted by Lou Berger <lberger@labn.net>.

12 years agobgpd: Move up flag-check calls, parcel up attr-parser args, and other cleanups
Paul Jakma [Wed, 18 Jan 2012 12:28:30 +0000 (12:28 +0000)]
bgpd: Move up flag-check calls, parcel up attr-parser args, and other cleanups

* bgp_attr.h: (struct bgp_attr_parser_args) Attribute parsing context,
  containing common arguments.
* bgp_attr.c: (general) Move the bgp_attr_flag_invalid flag-check calls up,
  out of each individual attr parser function, to be done once in attr_parse.

  Similarly move the calculation of the 'total' attribute length field up
  to attr_parse.

  Bundle together common arguments to attr-parsing functions and helpers
  into (struct bgp_attr_parser_args), so it can be passed by reference down
  the stack & also de-clutter the argument lists & make it easier to
  add/modify the context for attr-parsing - add local const aliases to avoid
  modifying body of code too much. This also should help avoid cut & paste
  errors, where calls to helpers with hard-coded attribute types are pasted
  to other functions but the code isn't changed.

  (bgp_attr_flags_diagnose) as above.
  (bgp_attr_flag_invalid) as above.
  (bgp_attr_{origin,aspath,as4_path,nexthop,med,local_pref,atomic}) as above.
  (bgp_attr_{aggregator,as4_aggregator,community,originator_id}) as above
  (bgp_attr_{cluster_list,ext_communities},bgp_mp_{un,}reach_parse) as above
  (bgp_attr_unknown) as above.

  (bgp_attr_malformed) as above. Also, startp and length have to be
  special-cased, because whether or not to send attribute data depends
  on the particular error - a separate length argument, distinct from
  args->length, indicates whether or not the attribute data should be sent
  in the NOTIFY.
  (bgp_attr_aspath_check) Call to bgp_attr_malformed is wrong here, there is
  no attribute parsing context - e.g. the 'flag' argument is unlikely to be
  right, remove it. Explicitly handle the error instead.
  (bgp_attr_munge_as4_attrs) Flag argument is pointless.

  As the comment notes, the check here is pointless as AS_PATH presence
  already checked elsewhere.

  (bgp_attr_parse) Do bgp_attr_flag_invalid call here.
  Use (struct bgp_attr_parser_args) for args to attr parser functions.
  Remove out-of-context 'flag' argument to as4 checking functions.

12 years agobgpd: consolidate attribute flag checks
Paul Jakma [Tue, 17 Jan 2012 13:31:33 +0000 (13:31 +0000)]
bgpd: consolidate attribute flag checks

* bgpd/bgp_attr.c: (attr_flags_values []) array of required flags for
  attributes, EXTLEN & PARTIAL masked off as "dont care" as appropriate.
  (bgp_attr_flag_invalid) check if flags may be invalid, according to
  the above table & RFC rules.
  (bgp_attr_*) Use bgp_attr_flag_invalid.
  (bgp_attr_as4_aggregator) ditto, also take startp argument for the
  NOTIFY data.
  (bgp_attr_parse) pass startp to bgp_attr_as4_aggregator

12 years agoospf6d: remove defaults from iface config (BZ#550)
Vyacheslav Trushkin [Fri, 10 Feb 2012 06:42:45 +0000 (10:42 +0400)]
ospf6d: remove defaults from iface config (BZ#550)

12 years agoospf6d: remove own routes on SIGTERM (BZ#448)
Phil Laverdiere [Mon, 2 Jan 2012 16:04:26 +0000 (20:04 +0400)]
ospf6d: remove own routes on SIGTERM (BZ#448)

12 years agolib: fix logging of ZEBRA_HELLO message
Denis Ovsienko [Sat, 21 Jan 2012 18:50:19 +0000 (22:50 +0400)]
lib: fix logging of ZEBRA_HELLO message

12 years agolib: add THREAD_TIMER_MSEC_ON()
Everton Marques [Thu, 16 Feb 2012 05:14:54 +0000 (06:14 +0100)]
lib: add THREAD_TIMER_MSEC_ON()

 * lib/thread.h: new timer macro, millisecond precision

(this was cherrypicked from pimd to isolate all non-contained changes)

From: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agoisisd: implement MD5 circuit authentication
Fritz Reichmann [Sat, 1 Oct 2011 13:49:48 +0000 (17:49 +0400)]
isisd: implement MD5 circuit authentication

* Replace command "isis passwd" with "isis passwd {clear|md5}"
* Verify HMAC MD5 on ISIS Hello PDUs
* Add HMAC MD5 authentication to md5.h/md5.c from RFC2104

12 years agoisisd: unexpected kernel routing table (BZ#544)
Fritz Reichmann [Sat, 1 Oct 2011 13:43:12 +0000 (17:43 +0400)]
isisd: unexpected kernel routing table (BZ#544)

Fix bug 544: isisd produces an unexpected routing table for wide-metric.

* isis_spf.c: Accept VTYPE_PSEUDO_TE_IS and VTYPE_NONPSEUDO_TE_IS
  vertex types for SPF calculation
* isis_pdu.c: Change order of TLVs to match Cisco to make bitwise
  comparison easier for Wireshark
* isis_tlv.c: EXTREME_TLV_DEBUG for TLV debugging instead of
  EXTREME_DEBUG

12 years agoisisd: fix wrong next-hops from SPF
Peter Szilagyi [Sat, 1 Oct 2011 13:22:51 +0000 (17:22 +0400)]
isisd: fix wrong next-hops from SPF

The forwarding table was filled with wrong next-hops, and which is even
worse, it was done in a totally non-deterministic way.

The next-hop set for an IP prefix by isisd was the neighbor IS from
which the flooded LSP about the IP prefix was arrived. So, if an IS
received all the LSPs through its, say, eth0 interface, all entries
in the forwarding table contained the next IS reachable via eth0 as
the next-hop.

The solution is to propagate the correct next-hop further from node to
node as the SPF algorithm traverses the graph and selects the next
node to be added to the set of already covered nodes.

Also, the construction of the tentative node list (the nodes where the
shortest path is not known yet) was buggy: if a node was already a
member of this list with a certain path cost, and an alternative path
was found to it with a lower cost while processing a pseudo-node LSP,
it was not added to the list. This way, the path selected by isisd for
a certain prefix was the first one it encountered during the LSDB
processing.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
12 years agoisisd: send proper LSP after DIS election
Peter Szilagyi [Sat, 1 Oct 2011 13:15:46 +0000 (17:15 +0400)]
isisd: send proper LSP after DIS election

After an IS has been elected as the Designated IS for a LAN, it did
not refresh the content of the pseudo-node after a new node has been
connected to the same LAN. Instead, the periodically reoriginated
pseudo-node LSP still contained only those IS neighbors that were
already present when the DIS election process was commenced.

The fix for the problem schedules an LSP regeneration rather than
just reoriginating the same LSP with the old content.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
12 years agoisisd: fix circuit state machine
Peter Szilagyi [Sat, 1 Oct 2011 13:11:45 +0000 (17:11 +0400)]
isisd: fix circuit state machine

isisd has a so-called circuit state machine that takes care about
the interface state changes, such as initializing, down, up. When
an interface was brought down by a link failure, the interface
information was deleted and set to NULL. When the link was restored
later, the interface was looked up by the old pointer, but since it
was cleared, it was never found again, resulting in an interface
never entering the up state again.

Also, the program regularly crashed because of a deleted pointer in
the same context which was later accessed without any further
checking.

Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
12 years agoospf6d: fix out of bounds write in ospf6_prefix_apply_mask
David Lamparter [Mon, 31 May 2010 10:02:31 +0000 (12:02 +0200)]
ospf6d: fix out of bounds write in ospf6_prefix_apply_mask

ospf6_prefix_apply_mask would write one byte beyond the 4/8/12
bytes allocated for prefixes of length 32/64/96.

based on report and patch by Jon Andersson <jon.andersson@thales.no>

Reported-by: Jon Andersson <jon.andersson@thales.no>
Signed-off-by: David Lamparter <equinox@diac24.net>
12 years agozebra: justify rtadv VTY commands with arguments
Denis Ovsienko [Tue, 24 Jan 2012 08:39:58 +0000 (12:39 +0400)]
zebra: justify rtadv VTY commands with arguments

ipv6 nd ra-interval
ipv6 nd ra-lifetime
ipv6 nd reachable-time
ipv6 nd home-agent-preference
ipv6 nd home-agent-lifetime
ipv6 nd router-preference

Calls to atoi() and atol() are replaced with VTY_GET_INTEGER_RANGE()
macro, command patterns are clarified and aliases of some commands
are added for consistency. Other changes are listed below.

* zebra/rtadv.c
  * ipv6_nd_ra_interval_msec(): resolve -Wsign-compare
  * ipv6_nd_ra_interval(): idem
  * rtadv_init(): update to list new aliases
* doc/ipv6.texi: update to match current implementation

12 years agozebra: freshen RFC references in rtadv
Denis Ovsienko [Tue, 24 Jan 2012 07:02:03 +0000 (11:02 +0400)]
zebra: freshen RFC references in rtadv

RFC2461 was replaced by RFC4861
RFC3775 was replaced by RFC6275
draft-ietf-mip6-mipext-advapi-03 was replaced by RFC4584

12 years agozebra: use prefix_ipv6 in rtadv_prefix
Denis Ovsienko [Sun, 8 Jan 2012 14:27:12 +0000 (18:27 +0400)]
zebra: use prefix_ipv6 in rtadv_prefix

rtadv_prefix.prefix was casted to "struct prefix_ipv6" and had the same
size, make it exactly this type to make the code a bit cleaner.

12 years agozebra: clear host bits of ND RA prefix option
Denis Ovsienko [Sun, 8 Jan 2012 13:46:34 +0000 (17:46 +0400)]
zebra: clear host bits of ND RA prefix option

RFC4861 4.6.2. Prefix Information

Prefix         An IP address or a prefix of an IP address.  The
               Prefix Length field contains the number of valid
               leading bits in the prefix.  The bits in the prefix
               after the prefix length are reserved and MUST be
               initialized to zero by the sender and ignored by
               the receiver.

* rtadv.c
  * ipv6_nd_prefix(): add missing call to apply_mask_ipv6()
  * no_ipv6_nd_prefix(): idem

12 years agozebra: justify some IPv6 ND RA timers wrt RFC
Denis Ovsienko [Fri, 30 Dec 2011 17:55:49 +0000 (21:55 +0400)]
zebra: justify some IPv6 ND RA timers wrt RFC

There was a regression introduced with the previous commit:
"ipv6 nd home-agent-lifetime 1800000" appeared by default in every
interface section of running-config, although this  command is
invalid in this context. Troubleshooting and bugfixing of the issue
tracked out several bugs in router advertisement procedures, some of
which are fixed in this commit.

* zebra/interface.c
  * if_zebra_new_hook(): update to treat -1 as "uninitialized"
  * nd_dump_vty(): idem
* zebra/rtadv.c
  * rtadv_send_packet(): update processing of "router lifetime" field,
    "home agent" option and "home agent lifetime" field to conform to
    RFC6275 better
  * ipv6_nd_ra_interval_msec(): update MaxRtrAdvInterval range check,
    make sure it never exceeds (initialized) AdvDefaultLifetime
  * ipv6_nd_ra_interval(): idem
  * ipv6_nd_ra_lifetime(): update AdvDefaultLifetime range check, make
    sure it never falls below MaxRtrAdvInterval
  * ipv6_nd_homeagent_lifetime(): update HomeAgentLifetime range check
  * no_ipv6_nd_ra_lifetime(): update to treat -1 as "uninitialized"
  * no_ipv6_nd_homeagent_lifetime(): idem
  * rtadv_config_write(): idem

12 years agozebra: fix output of IPv6 ND RA options
Denis Ovsienko [Tue, 27 Dec 2011 14:49:15 +0000 (18:49 +0400)]
zebra: fix output of IPv6 ND RA options

The following options could be configured for an interface, but were
never visible in the config text:

ipv6 nd adv-interval-option
ipv6 nd home-agent-preference
ipv6 nd home-agent-lifetime
ipv6 nd home-agent-config-flag

12 years agofix zebra protocol after MP-BGP changes
Denis Ovsienko [Mon, 5 Dec 2011 12:35:14 +0000 (16:35 +0400)]
fix zebra protocol after MP-BGP changes

The previous commits modified both zebra and bgpd for additional
SAFI field, but not any other routing daemon, which led to zebra
daemon crashing with failed assertion.

12 years agozebra: fix recent MP-BGP commits for FreeBSD
Denis Ovsienko [Mon, 5 Dec 2011 09:43:18 +0000 (13:43 +0400)]
zebra: fix recent MP-BGP commits for FreeBSD

12 years agozebra: Removal of the following warning messages
G.Balaji [Sun, 27 Nov 2011 14:39:40 +0000 (20:09 +0530)]
zebra: Removal of the following warning messages
       warning: too many arguments for format [-Wformat-extra-args]