]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years agolib/workqueue: Add trivial work_queue_is_scheduled helper
Paul Jakma [Tue, 15 Sep 2015 15:16:42 +0000 (16:16 +0100)]
lib/workqueue: Add trivial work_queue_is_scheduled helper

(cherry picked from commit 13c2a3db503fde67f647fa58fd4e1077517ebb5c)

8 years agotests: add testcli reference in/out & do DejaGNU
David Lamparter [Thu, 14 May 2015 12:47:05 +0000 (14:47 +0200)]
tests: add testcli reference in/out & do DejaGNU

This adds reference in & output for the previously added testcli tool,
to check basic CLI parsing/help functions.  Unlike "testcommands", this
one doesn't depend on compile-time system details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit d79668fb440ae2689b54f52c076dbd79a8689135)

8 years agotests: add CLI dummy command-exec tool
David Lamparter [Tue, 5 May 2015 09:04:59 +0000 (11:04 +0200)]
tests: add CLI dummy command-exec tool

This adds some common CLI testtool code as well as a tool that has a
bunch of commands to be poked for their correct processing.

The tool doesn't work correctly from a script at stdin at this point
because the vty code will throw away all buffered when it sees EOF, so
the tail end of the input file is lost.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit db93eec18d8f1e840b32ba2cdf8baf2510f6e1a5)

8 years agorelease: 0.99.24
David Lamparter [Mon, 2 Mar 2015 23:50:57 +0000 (00:50 +0100)]
release: 0.99.24

8 years agobuild: enable isisd by default
David Lamparter [Mon, 9 Feb 2015 10:36:10 +0000 (11:36 +0100)]
build: enable isisd by default

Most distributors enable it anyway, and it's not THAT broken anymore to
mandate disabling it by default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: track config args
David Lamparter [Sat, 22 Nov 2014 18:43:29 +0000 (10:43 -0800)]
build: track config args

Record the ./configure arguments used and make them user-visible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: remove --disable-ipv6
David Lamparter [Sat, 22 Nov 2014 18:31:33 +0000 (10:31 -0800)]
build: remove --disable-ipv6

Building with IPv6 disabled tends to break rather often and sprinkles
ugly #ifdefs around the code.  All that only to support systems where
the C library doesn't have IPv6 capability.

The year now being 2015, if this is a problem the thing to fix is the C
library.

The implication of this patch is that future patches need not care about
HAVE_IPV6 = 0 and may remove ifdefs gratuitously.  This patch doesn't
remove these ifdefs to not create unneccessary churn.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: get rid of INCLUDES, use AM_CPPFLAGS
David Lamparter [Sat, 28 Jun 2014 20:23:10 +0000 (22:23 +0200)]
build: get rid of INCLUDES, use AM_CPPFLAGS

INCLUDES in configure.ac was not used at all, and INCLUDES in
Makefile.am is supposed to be AM_CPPFLAGS these days.

Reduces warnings spewed during bootstrap/autoreconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit 237aac56960575f6ad2451ba2796d94bd5ae4b33)

8 years agobuild: harmonize configure help strings
David Lamparter [Sat, 28 Jun 2014 20:15:59 +0000 (22:15 +0200)]
build: harmonize configure help strings

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit b6fa76098d127f5641a7dda0dee21f06ca167edb)

8 years agobuild: remove --enable-solaris parameter
David Lamparter [Sat, 28 Jun 2014 20:07:41 +0000 (22:07 +0200)]
build: remove --enable-solaris parameter

This switch controlled descending into the solaris/ subdirectory, which
contains package descriptions and init scripts.  If they're not
appropriate, they'd better be removed outright.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agozebra: remove rt_ioctl kernel interface
David Lamparter [Sat, 28 Jun 2014 19:49:18 +0000 (21:49 +0200)]
zebra: remove rt_ioctl kernel interface

None of the BSDs uses ioctls to set routes anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agozebra, ripngd: remove ::/64 special-casing
David Lamparter [Sat, 28 Jun 2014 19:26:36 +0000 (21:26 +0200)]
zebra, ripngd: remove ::/64 special-casing

In the 90ies, IPv4 was believed to exist within IPv6, with some kernels
implementing this belief in code...  Our code here is keyed to "#ifdef
LINUX", yet no Linux from the past 10 years had this, making the code
completely useless.

FreeBSD 10.0 does in fact have a "::/96 via ::1 dev lo0 reject" route.
IMHO we shouldn't mess with that, the admin can filter as neccessary
anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
[DL: slightly adjusted commit message to remove misunderstanding]
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: remove ancient Linux/BSD IPv6 cruft
David Lamparter [Sat, 28 Jun 2014 19:42:25 +0000 (21:42 +0200)]
build: remove ancient Linux/BSD IPv6 cruft

IPv6 functions in a separate library... yeah, right.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: remove INRIA, NRL and MUSICA IPv6 quirks
David Lamparter [Sat, 28 Jun 2014 19:12:37 +0000 (21:12 +0200)]
build: remove INRIA, NRL and MUSICA IPv6 quirks

Valar dohaeris.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agopimd: Fix compiler warning in pim_mroute.c
Donald Sharp [Fri, 3 Jun 2016 18:35:47 +0000 (14:35 -0400)]
pimd: Fix compiler warning in pim_mroute.c

Another compiler another warning.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobuild: remove AIX, NEC EWS and IRIX
David Lamparter [Sat, 28 Jun 2014 19:01:32 +0000 (21:01 +0200)]
build: remove AIX, NEC EWS and IRIX

Valar morghulis.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
8 years agobuild: remove Linux non-netlink config
David Lamparter [Sat, 28 Jun 2014 18:54:31 +0000 (20:54 +0200)]
build: remove Linux non-netlink config

This path is deprecated, completely untested, likely broken and will not
be maintained.  Kill it with fire.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Acked-by: Greg Troxel <gdt@ir.bbn.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit 2e5ca49758543cde69d98f4a6a7b39486e88311d)

Conflicts:
configure.ac
zebra/if_proc.c
zebra/rtread_proc.c

8 years agovtysh: Add code to allow pimd show running specific
Donald Sharp [Wed, 1 Jun 2016 19:34:21 +0000 (15:34 -0400)]
vtysh: Add code to allow pimd show running specific

Add code to allow the show run command to accept and
display the pimd specific configuration.

Ticket: CM-11218
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agopimd: Add support for displaying ip mroute
Donald Sharp [Wed, 1 Jun 2016 19:31:02 +0000 (15:31 -0400)]
pimd: Add support for displaying ip mroute

When you enter a static mroute under an interface
the 'show run' is not displaying this information.
Add code to allow this.

Ticket: CM-11257
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agozebra: Remove experimental warning
Donald Sharp [Wed, 1 Jun 2016 15:44:16 +0000 (11:44 -0400)]
zebra: Remove experimental warning

Remove the pimd experimental warnings that are being
displayed for some commands.

Ticket: CM-6128
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim: Fix 'no ip pim sm'
Donald Sharp [Wed, 1 Jun 2016 15:26:29 +0000 (11:26 -0400)]
pim: Fix 'no ip pim sm'

The 'no ip pim sm' command was not being accepted.
Additionally fix the help output

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Fix unprotected zlog_debug
Donald Sharp [Wed, 1 Jun 2016 13:12:07 +0000 (09:12 -0400)]
zebra: Fix unprotected zlog_debug

Fixing an unprotected zlog_debug.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
8 years agopimd: Allow command zclient to find it's data
Donald Sharp [Wed, 1 Jun 2016 01:27:48 +0000 (21:27 -0400)]
pimd: Allow command zclient to find it's data

pim has two zclient sockets to zebra.  One
is used exclusively to do mrib lookups.  The
other is to do the normal day to day communication
between pim and zebra.  With the change
to the zebra api to send up all data to all
sockets this caused the mrib lookup socket
to accumulate data in between mrib lookups.
So if at some point in time we get upcoming
data but no mrib lookups modify the code
to find the mrib lookup it is looking for.

Long term we need to figure something else out
but this change will get us moving forward again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agolib: Fixup zclient api to be consistent
Donald Sharp [Fri, 27 May 2016 00:11:15 +0000 (20:11 -0400)]
lib: Fixup zclient api to be consistent

All ZAPI commands pass the zclient around not
the individual stream we need.  Switch code
over to follow conventions.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fixup zebra zapi message table
Donald Sharp [Fri, 27 May 2016 00:06:08 +0000 (20:06 -0400)]
lib: Fixup zebra zapi message table

The zapi zebra_desc_table command_types code was
missing some entries.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix vrf_id_t data type
Donald Sharp [Thu, 26 May 2016 23:52:10 +0000 (19:52 -0400)]
lib: Fix vrf_id_t data type

We were reading a u_int16_t for vrf_id_t.  While technically
the same thing, I'd like to make sure we think about vrf_id_t's
as vrf_id_t's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agodebian: Add pimd to logrotate script
Donald Sharp [Thu, 26 May 2016 23:41:58 +0000 (19:41 -0400)]
debian: Add pimd to logrotate script

Add pimd to the log rotate script so that the USR1 signal
can be sent to pimd to tell it to rotate the log.

Ticket: CM-11253
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fixup some clang compiler warnings
Donald Sharp [Thu, 26 May 2016 23:33:12 +0000 (19:33 -0400)]
pimd: Fixup some clang compiler warnings

clang run on a fairly recent fedora complains
about some code.  Fixup the warnings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add ability to safely ignore route-maps
Donald Sharp [Thu, 26 May 2016 23:31:38 +0000 (19:31 -0400)]
pimd: Add ability to safely ignore route-maps

pim was not parsing route-map code and causing issues
using vtysh because of this.  Add code to safely
ignore the route-map code and set us up for future
expansion into route-maps if neeeded.

Ticket: CM-11219
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agovtysh: vtysh_pam() needs an ifdef USE_PAM check
Daniel Walton [Fri, 27 May 2016 14:31:41 +0000 (14:31 +0000)]
vtysh: vtysh_pam() needs an ifdef USE_PAM check

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: resolve merge issues in bgp_attr_check()
Daniel Walton [Fri, 27 May 2016 13:31:06 +0000 (13:31 +0000)]
bgpd: resolve merge issues in bgp_attr_check()

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
8 years agovtysh: Fix compile failure from cherry-pick
Donald Sharp [Thu, 26 May 2016 23:56:47 +0000 (19:56 -0400)]
vtysh: Fix compile failure from cherry-pick

Fix a compile failure from a cherry-pick of a
commit from upstream

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Double read of stream
Donald Sharp [Thu, 26 May 2016 16:41:55 +0000 (12:41 -0400)]
pimd: Double read of stream

The addition of the zclient_read_header call
reads the entirety of the stream for you and
makes sure it's consistent with the header.
When the function call was added it read the
stream data in zclient_read_header and then
reread the data after that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agodebian: Add test_igmpv3_join to packaging
Donald Sharp [Thu, 26 May 2016 14:31:59 +0000 (10:31 -0400)]
debian: Add test_igmpv3_join to packaging

Add the test_igmpv3_join program to packaging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Forgot to add the vrf_init call
Donald Sharp [Thu, 26 May 2016 01:24:01 +0000 (21:24 -0400)]
pimd: Forgot to add the vrf_init call

Forward port of vrf code didn't have the pimd
code.  So when it was forward ported we lost
the vrf_init.  Now that we have pimd let's
add it back in.

Additionally forward port lost the
additional zclient->zebra_connect call.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoospfd: Some small tweaks to the SPF execution reason patch
Paul Jakma [Thu, 9 Oct 2014 13:19:51 +0000 (14:19 +0100)]
ospfd: Some small tweaks to the SPF execution reason patch

* ospf_spf.h: use an enum for the reason, and have it as a new argument to
  ospf_spf_calculate_schedule, no need for additional call, and let compiler
  do the checking.
* ospf_spf.c: format changes - Quagga coding style places function names
  at the start of a new line, for easy grepping for definition.
  (ospf_spf_calculate_timer) Change the log format of SPF execution time to
  avoid ginormous line, and make logging conditional, as is the norm.

(cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8)

Conflicts:
ospfd/ospf_spf.c

8 years agozebra: MBGP routes should not be installed in the kernel
Balaji [Thu, 23 Oct 2014 15:25:25 +0000 (15:25 +0000)]
zebra: MBGP routes should not be installed in the kernel

MBGP routes are used only for PIM RPF checks and hence should
not be installed in the kernel's FIB. Ignore route node set to Multicast
SAFI.

Signed-off-by: Balaji.G <balajig81@gmail.com>
Acked-by: Everton Marques <everton.marques@gmail.com>
[pushed down rn->table->info assignment below assert]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 9511633e08ff15c23608983fdc1bc735d427332e)

Conflicts:
zebra/zebra_rib.c

8 years agobgpd: Fixes for recent well-known-attr check patch.
Paul Jakma [Tue, 21 Oct 2014 15:59:01 +0000 (16:59 +0100)]
bgpd: Fixes for recent well-known-attr check patch.

* bgp_attr.c: Recent patch to tighten well-known attr checks and apply that
  to all AFIs has some breakage with MP-extensions and GR, which needs to be
  fixed.
  (bgp_attr_check) Graceful Restart EoR can be an empty UPDATE for IPv4/uni.
  MP-Ext allow UPDATE with just MP_UNREACH_NLRI. Check for these and return
  proceed.
  NEXT_HOP becomes optional, if MP_REACH_NLRI is present and there's no
  v4 NLTI, update NEXT_HOP check accordingly.
  Print the missing attr in string form in the log message.
  (bgp_attr_parse) AS_PATH need not be there, so
  bgp_attr_munge_as4_attrs call needs to be conditional on that.

(cherry picked from commit aed1b556cf2f55680ae09d7ad1a1f22729dea8c5)

Conflicts:
bgpd/bgp_attr.c

8 years agobgpd: well-known attr check only run for v4/uni, which could cause a crash.
Paul Jakma [Tue, 23 Sep 2014 14:23:01 +0000 (15:23 +0100)]
bgpd: well-known attr check only run for v4/uni, which could cause a crash.

* ANVL testing by Martin Winter threw up a crash in bgpd in aspath_dup
  called from bgp_packet_attribute, if attr->aspath was NULL, on an IPv6
  UPDATE.

  This root cause is that the checks for well-known, mandatory attributes
  were being applied only if an UPDATE contained the IPv4 NLRI and the
  peer was configured for v4/unicast (i.e. not deconfigured). This is
  something inherited from GNU Zebra, and never noticed before.

* bgp_attr.c: (bgp_attr_parse) Move the well-known mandatory attribute
  check to here, so that it can be run immediately after all attributes
  are parsed, and before any further processing of attributes that might
  assume the existence of WK/M attributes (e.g. AS4-Path).
  (bgp_attr_munge_as4_attrs) Missing AS_PATH shouldn't happen here anymore,
  but retain a check anyway for robustness - it's definitely a hard error
  though.
* bgp_attr.h: (bgp_attr_check) No longer needs to be exported, make static.
* bgp_packet.c: (bgp_update_receive) Responsibility for well-known check
  now in bgp_attr_parse.

(cherry picked from commit 055086f70febc30fdfd94bb4406e9075d6934cd8)

Conflicts:
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_packet.c

8 years agobgpd.c: Remove unused store to variable
Paul Jakma [Fri, 19 Sep 2014 14:34:48 +0000 (15:34 +0100)]
bgpd.c: Remove unused store to variable

(cherry picked from commit b2dd59ee0e74926278e128846624f5c93288223b)

Conflicts:
bgpd/bgpd.c

8 years agoFix most compiler warnings in default GCC build.
Paul Jakma [Fri, 19 Sep 2014 13:42:23 +0000 (14:42 +0100)]
Fix most compiler warnings in default GCC build.

Fix lots of warnings. Some const and type-pun breaks strict-aliasing
warnings left but much reduced.

* bgp_advertise.h: (struct bgp_advertise_fifo) is functionally identical to
  (struct fifo), so just use that.  Makes it clearer the beginning of
  (struct bgp_advertise) is compatible with with (struct fifo), which seems
  to be enough for gcc.
  Add a BGP_ADV_FIFO_HEAD macro to contain the right cast to try shut up
  type-punning breaks strict aliasing warnings.
* bgp_packet.c: Use BGP_ADV_FIFO_HEAD.
  (bgp_route_refresh_receive) fix an interesting logic error in
  (!ok || (ret != BLAH)) where ret is only well-defined if ok.
* bgp_vty.c: Peer commands should use bgp_vty_return to set their return.
* jhash.{c,h}: Can take const on * args without adding issues & fix warnings.
* libospf.h: LSA sequence numbers use the unsigned range of values, and
  constants need to be set to unsigned, or it causes warnings in ospf6d.
* md5.h: signedness of caddr_t is implementation specific, change to an
  explicit (uint_8 *), fix sign/unsigned comparison warnings.
* vty.c: (vty_log_fixed) const on level is well-intentioned, but not going
  to fly given iov_base.
* workqueue.c: ALL_LIST_ELEMENTS_RO tests for null pointer, which is always
  true for address of static variable.  Correct but pointless warning in
  this case, but use a 2nd pointer to shut it up.
* ospf6_route.h: Add a comment about the use of (struct prefix) to stuff 2
  different 32 bit IDs into in (struct ospf6_route), and the resulting
  type-pun strict-alias breakage warnings this causes.  Need to use 2
  different fields to fix that warning?

general:

* remove unused variables, other than a few cases where they serve a
  sufficiently useful documentary purpose (e.g.  for code that needs
  fixing), or they're required dummies.  In those cases, try mark them as
  unused.
* Remove dead code that can't be reached.
* Quite a few 'no ...' forms of vty commands take arguments, but do not
  check the argument matches the command being negated.  E.g., should
  'distance X <prefix>' succeed if previously 'distance Y <prefix>' was set?
  Or should it be required that the distance match the previously configured
  distance for the prefix?
  Ultimately, probably better to be strict about this.  However, changing
  from slack to strict might expose problems in command aliases and tools.
* Fix uninitialised use of variables.
* Fix sign/unsigned comparison warnings by making signedness of types consistent.
* Mark functions as static where their use is restricted to the same compilation
  unit.
* Add required headers
* Move constants defined in headers into code.
* remove dead, unused functions that have no debug purpose.

(cherry picked from commit 7aa9dcef80b2ce50ecaa77653d87c8b84e009c49)

Conflicts:
bgpd/bgp_advertise.h
bgpd/bgp_mplsvpn.c
bgpd/bgp_nexthop.c
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
lib/command.c
lib/if.c
lib/jhash.c
lib/workqueue.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_neighbor.h
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c
ospfd/ospf_api.c
zebra/router-id.c
zebra/rt_netlink.c
zebra/rt_netlink.h

8 years agozebra: fix rtnh_len in the rt_netlink messages for multipath case
Lu Feng [Fri, 11 Jul 2014 07:52:15 +0000 (07:52 +0000)]
zebra: fix rtnh_len in the rt_netlink messages for multipath case

In _netlink_route_build_multipath():
- Each time when appending a IPv4 gateway in the message, rtnh_len
  is increased by sizeof (struct rtattr) + 4, where we should use
  "bytelen" instead of the hard coding "4".
- As what done for IPv4, we should increase rtnh_len accordingly
  along with adding a IPv6 gateway, or else the IPv6 gateways will
  be lost.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 621e2aaf33d8ab73bf44b0eea3f3900135d34996)

Conflicts:
zebra/rt_netlink.c

8 years agoripd: allow to enable/disable the ECMP feature
Lu Feng [Fri, 18 Jul 2014 06:13:19 +0000 (06:13 +0000)]
ripd: allow to enable/disable the ECMP feature

Introduce a new command "[no] allow-ecmp" to enable/disable the
ECMP feature in RIP. By default, ECMP is not allowed.

Once ECMP is disabled, only one route entry can exist in the list.

* rip_zebra.c: adjust a debugging information, which shows the number
               of nexthops according to whether ECMP is enabled.
* ripd.c: rip_ecmp_add() will reject the new route if ECMP is not
          allowed and some entry already exists.
          A new configurable command "allow-ecmp" is added to control
          whether ECMP is allowed.
          When ECMP is disabled, rip_ecmp_disable() is called to
          remove the multiple nexthops.
* ripd.h: Add a new member "ecmp" to "struct rip", indicating whether
          ECMP is allowed or not.

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 0b74a0a5db7bcf65bf68c44b547b02b1310b5cdb)

8 years agoripd: add ECMP support
Lu Feng [Fri, 18 Jul 2014 06:13:18 +0000 (06:13 +0000)]
ripd: add ECMP support

* Each node in the routing table is changed into a list, holding
  the multiple equal-cost paths.

* If one of the multiple entries gets less-preferred (greater
  metric or greater distance), it will be directly deleted instead
  of starting a garbage-collection timer for it.
  The garbage-collection timer is started only when the last entry
  in the list gets INFINITY.

* Some new functions are used to maintain the ECMP list. And hence
  rip_rte_process(), rip_redistribute_add() and rip_timeout() are
  significantly simplified.

* rip_zebra_ipv4_add() and rip_zebra_ipv4_delete() now can share
  the common code. The common part is moved to rip_zebra_ipv4_send().

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b397cf4f0fc484c5ebfc8a680090055c8e6cbe32)

Conflicts:
ripd/rip_zebra.c

8 years agoconfigure: Fix warnings on CentOS and bump the minimum autoconf version
Paul Jakma [Tue, 16 Feb 2016 11:30:33 +0000 (11:30 +0000)]
configure: Fix warnings on CentOS and bump the minimum autoconf version

* configure.ac: Bump the minimum version to 2.60 as needed by
  AC_USE_SYSTEM_EXTENSIONS.  AC 2.60 is nearly 10 years old, note.  Add
  AC_PROG_RANLIB, for when --disable-shared is used.

  There are other warnings on, e.g., CentOS 6.7 with 2.63, but they
  don't go away if the suggestion to add AC_SYSTEM_EXTENSIONS is
  followed. This warning doesn't occur on Fedora with AC 2.69.

  Note: autoconf (and other auto*) should only be needed on developer
  machines building direct from git.  Other systems should be using the
  'make dist' tarballs, with a ready-made build system, that does not
  need auto* intalled.

(cherry picked from commit f9f4731245eb9f83d0795acac24183c6cf709288)

8 years agodoc: older versions of texinfo seem to be sensitive to location of unmacro
Paul Jakma [Tue, 16 Feb 2016 11:28:35 +0000 (11:28 +0000)]
doc: older versions of texinfo seem to be sensitive to location of unmacro

* bgpd.texi: The unmacro of mprec seems to be disliked by older texinfos.
  Moving it to after the section fixes it. Even easier, just don't undef the
  macro.

(cherry picked from commit f8113a2b10a97ba0d5e915b318cebea283d03169)

8 years agodistro/redhat: Update to support CentOS/RHEL/Fedora, upstart/init/systemd
Martin Winter [Fri, 30 Oct 2015 05:15:42 +0000 (22:15 -0700)]
distro/redhat: Update to support CentOS/RHEL/Fedora, upstart/init/systemd

* redhat/quagga.spec.in: Update to support CentOS, RHEL and Fedora, and
  support the various init systems across different versions of these
  distros, e.g.  upstart/init/systemd.

  Clean up various warnings from rpmlint.

  Remove configure options that are gone.

A few edits and commit message by:
Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>

(cherry picked from commit a5efdb60905049e1224a020b78dd9699bdd15b29)

8 years agodistro/redhat/rpm: remove with_ipv6, package pimd binary, remove pam stack
Paul Jakma [Thu, 11 Feb 2016 13:54:23 +0000 (13:54 +0000)]
distro/redhat/rpm: remove with_ipv6, package pimd binary, remove pam stack

* redhat/quagga.spec.in: remove with_ipv6, it should just be the norm now.
  The actual pimd binary wasn't being packaged, fix.
  Remove deprecated pam.stack support.

* redhat/quagga.pam.stack: ancient, nuke.
* Makefile.am: ditto

(cherry picked from commit 283d5d7f2fa12c3d33dc17962154665a9993b2c5)

8 years agoAdding redhat init/service files to start pimd
Martin Winter [Thu, 13 Aug 2015 00:31:07 +0000 (17:31 -0700)]
Adding redhat init/service files to start pimd

Added missing pimd.init (for RedHat/CentOS <= 6) and
pimd.service (for RedHat/CentOS >= 7)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit fca2c24ff21a9d837229bc40e462c6615e368123)

8 years agodistro: fix redhat/quagga.spec.in
Paul Jakma [Fri, 4 Sep 2015 13:25:13 +0000 (14:25 +0100)]
distro: fix redhat/quagga.spec.in

* quagga.spec.in: Add default for with_pimd macro.
  Remove ancient condtional on quagga_buildreqs.
  More recent rpmbuild complains about too many levels of recursion in
  quagga_buildreqs, so use %{expand:..}.
  Actually use quagga_buildreqs in BuildRequires!
  groff is needed for build.
  texi2html --number argument has disappeared, split into 2.

Acked-by: Donald Sharp <sharpd at cumulusnetworks.com>
(cherry picked from commit e07068c838142a127da8821afd660f075f7c35f8)

8 years agodoc: Add AFI/SAFI show commands to manual
Lou Berger [Tue, 12 Jan 2016 18:42:10 +0000 (13:42 -0500)]
doc: Add AFI/SAFI show commands to manual

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 544ec70f66d0ec081dadde79bec1f25c2241f57f)

8 years agobgpd: encap: extend extcommunity handling
Lou Berger [Tue, 12 Jan 2016 18:42:00 +0000 (13:42 -0500)]
bgpd: encap: extend extcommunity handling

Add code to print ENCAP communities.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5a81fc9ae610ff343902ebabc12237d6e40d91cb)

8 years agobgpd: kill unused variable in bgp_socket()
Lou Berger [Tue, 12 Jan 2016 18:41:52 +0000 (13:41 -0500)]
bgpd: kill unused variable in bgp_socket()

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 4d80560a2b064182191371fd7e4304bf829a4d9f)

8 years agobgpd: add nexthop length to AF macro
Lou Berger [Tue, 12 Jan 2016 18:41:51 +0000 (13:41 -0500)]
bgpd: add nexthop length to AF macro

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3e841d3b49bdb475ce793eee5d82e5137dff57d3)

8 years agolib: add SAFI_ENCAP type, safi2str prefix utility
Lou Berger [Tue, 12 Jan 2016 18:41:50 +0000 (13:41 -0500)]
lib: add SAFI_ENCAP type, safi2str prefix utility

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 2daf7f3a8d69213f35b16a04dbe300957481a811)

8 years agolib: treat realloc of null pointer as alloc Now use zalloc rather than alloc with...
Lou Berger [Tue, 12 Jan 2016 18:41:47 +0000 (13:41 -0500)]
lib: treat realloc of null pointer as alloc Now use zalloc rather than alloc with null. Fixes issue seen in bgp check tests.

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 9248b61f54955e56212f3ae4c8a7ab704f7ad01c)

8 years agozebra: make RTF_LLINFO optional to fix FreeBSD
Lou Berger [Tue, 12 Jan 2016 18:41:44 +0000 (13:41 -0500)]
zebra: make RTF_LLINFO optional to fix FreeBSD

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b05c6ca57130f079f8a8a6686d9d4ffa5ff440f0)

8 years agozebra: wire up "debug zebra packet detail"
Lou Berger [Tue, 12 Jan 2016 18:41:43 +0000 (13:41 -0500)]
zebra: wire up "debug zebra packet detail"

There was no way to actually set ZEBRA_DEBUG_DETAIL, even though some
debug output was conditional to it.  Add CLI command.

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit d7be042378eac103634ab62abf4b2a5ca225092d)

8 years agodocs: Update bgpd docs, inc. on decision process, and with a section on MED.
Paul Jakma [Wed, 2 Dec 2015 16:47:43 +0000 (16:47 +0000)]
docs: Update bgpd docs, inc. on decision process, and with a section on MED.

* bgpd.texi: Document the -l argument. Update the 'BGP decision process' table
  to reflect what /actually/ is implemented. Add docs on 'compare-routerid' in
  the bestpath section.

  Add a section on MED, to highlight the issues it has by default, and to
  highlight that it is terminally broken for its original purpose in many
  modern iBGP topologies.

  Mention the potential workarounds and fixes.

* routemap.texi: set an anchor on 'set metric' so bgpd.texi can reference it.

(cherry picked from commit d5062d218994885710fe02f516f0c06025b4fc9a)

8 years agotests: add more AS4 capability tests + little fixes for couple of GR test cases.
Paul Jakma [Wed, 25 Nov 2015 17:14:36 +0000 (17:14 +0000)]
tests: add more AS4 capability tests + little fixes for couple of GR test cases.

Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 321d4130a615445d0f49f41c909c92d5401fd5ff)

8 years agodoc: Add 'OSPF Fundamentals' section to OSPF docs
Paul Jakma [Tue, 20 Oct 2015 15:14:56 +0000 (16:14 +0100)]
doc: Add 'OSPF Fundamentals' section to OSPF docs

* ospf_fundamentals.texi: New section explaining the fundamentals of OSPF
  for system admins, to help them debug their networks.
* {Makefile.am,ospfd.texi}: include and build previous

Conflicts:
doc/Makefile.am

(cherry picked from commit e56aab94a615a2b676473fbd09145b444a348029)

8 years agoospfd: PointToPoint neighbors are identified by router ID
Joakim Tjernlund [Fri, 25 Apr 2014 12:36:16 +0000 (14:36 +0200)]
ospfd: PointToPoint neighbors are identified by router ID

According to RFC 2328, section 10.5  PointToPoint neighbors
should be identified by router ID instead of source IP address.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
(cherry picked from commit 5c1791f28e2e831e4e9b92c3c2f7d8ed832cb968)

8 years agotests: Fix warnings from test-stream.c
Donald Sharp [Mon, 12 Oct 2015 18:33:31 +0000 (14:33 -0400)]
tests: Fix warnings from test-stream.c

test-stream is generating some compiler warnings

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

8 years agoquagga: Additional centos 6 -enable-werror fixes
Donald Sharp [Tue, 29 Sep 2015 13:25:10 +0000 (09:25 -0400)]
quagga: Additional centos 6 -enable-werror fixes

This commit fixes these warnings:

1) bgpd/bgp_nexthop.c - dereferencing pointer 'X' does break strict-aliasing rules
2) pimd/pim_igmp_join.c - dereferencing pointer 'X' does break strict-aliasing rules
3) ripd/ripd.c - 'ifaddr.prefixlen' may be used uninitialized in this function

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

8 years agozebra/if_ioctl_solaris: Make foo static
David Lamparter [Wed, 16 Sep 2015 05:09:30 +0000 (22:09 -0700)]
zebra/if_ioctl_solaris: Make foo static

make interface_ioctl_ioctl() and if_get_index() static

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 7904509bdf9ec7fad3ac1aee763ae39e7c308c52)

8 years agozebra/rt_socket: Fix warnings
David Lamparter [Wed, 16 Sep 2015 04:55:38 +0000 (21:55 -0700)]
zebra/rt_socket: Fix warnings

Fix warning about unused sin_masklen / sin6_masklen

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 8fa1d027f23115dcb1c38b09c6e46edf5b8f7238)

8 years agozebra/rtread_getmsg: fix sign warnings
David Lamparter [Wed, 16 Sep 2015 04:40:31 +0000 (21:40 -0700)]
zebra/rtread_getmsg: fix sign warnings

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ebd2687a531a0f9b9449f6fcf7001f53afa99d02)

8 years agoisisd/isis_dlpi: Fix warning
David Lamparter [Wed, 16 Sep 2015 03:58:29 +0000 (20:58 -0700)]
isisd/isis_dlpi: Fix warning

'fd' may be used uninitialized. Init to -1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit f90ce64d68cf0ad56ff0370338ec58c883a3448d)

8 years agosolaris: more warnings fixed
David Lamparter [Wed, 16 Sep 2015 03:36:20 +0000 (20:36 -0700)]
solaris: more warnings fixed

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit da1b7eaa0ac5d590818e1cde92a9807a2f0e07f2)

8 years agosolaris: no ROUNDUP
David Lamparter [Wed, 16 Sep 2015 02:35:41 +0000 (19:35 -0700)]
solaris: no ROUNDUP

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit a2b503131b188292ede08df99309bcbef4bd1a52)

8 years agoisisd/solaris: fix size_t confusions
David Lamparter [Tue, 15 Sep 2015 10:00:59 +0000 (03:00 -0700)]
isisd/solaris: fix size_t confusions

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ba6cd587b4114528c8d6af439c4f49c7bb95a92b)

8 years ago*: fix in_addr initialisers
David Lamparter [Tue, 15 Sep 2015 10:00:09 +0000 (03:00 -0700)]
*: fix in_addr initialisers

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5181a0296687a6004dd00c7c0874886c9ff0bf60)

8 years agozebra/solaris: fix uninitialised vars
David Lamparter [Tue, 15 Sep 2015 09:59:04 +0000 (02:59 -0700)]
zebra/solaris: fix uninitialised vars

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 6d9362274e8ba2d57ffe17aa735eb941ac3d5fbc)

8 years agobuild: make libraries self-reliant
David Lamparter [Tue, 15 Sep 2015 09:19:46 +0000 (02:19 -0700)]
build: make libraries self-reliant

libospf and libospfclient both need libzebra, so they should link
against it. The days of libtool propagating upwards such dependencies
are nearing their end...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit d8d5c60ecfab4dd609a07b4baa00d735f59002b9)

8 years agoospf6d: fix uninitialized warning in SNMP
David Lamparter [Tue, 15 Sep 2015 09:12:23 +0000 (02:12 -0700)]
ospf6d: fix uninitialized warning in SNMP

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit a4065069e6bdd0bc7475312530b0e9457f818e0d)

8 years agobuild/solaris: drop duplicate __EXTENSION__ define
David Lamparter [Tue, 15 Sep 2015 09:03:36 +0000 (02:03 -0700)]
build/solaris: drop duplicate __EXTENSION__ define

__EXTENSION__ is already defined in config.h by autoconf; drop the
duplicate from zebra.h.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 089e5eb7310683be6806726dbf7b7c94b1b66bfb)

8 years agoHACKING: Change format to MarkDown
Paul Jakma [Sun, 21 Jun 2015 22:00:13 +0000 (23:00 +0100)]
HACKING: Change format to MarkDown

* HACKING: Converted initially from LaTeX to markdown with:

  'pandoc -f latex -t markdown HACKING.tex'

  Then tweaked by hand to add a header with some suitable variables for the
  pandoc LaTeX template to make better use of the page space, and to add
  newpages so the title page is standalone as in the previous version.

  Also went through and reflowed paragraphs best as I could to make them
  match the previous document, to make it a little easier to verify nothing
  had been changed other than the markup, via diff.

  PDF can be generated with: 'pandoc  -o HACKING.pdf HACKING.md'

(cherry picked from commit 67c3d75f5324b610352998c670f5f0cc4ba0ff2a)

8 years agoHACKING: rename to HACKING.md in prep for conversion to MarkDown
Paul Jakma [Sun, 21 Jun 2015 21:38:44 +0000 (22:38 +0100)]
HACKING: rename to HACKING.md in prep for conversion to MarkDown

(cherry picked from commit 3e71e369452c38c9c16a19d0edd40323e6b31023)

8 years agoFixed if_add_update possible null dereference
Morgan Stewart [Thu, 17 Sep 2015 23:04:30 +0000 (19:04 -0400)]
Fixed if_add_update possible null dereference

Coverity Scan #1221454
In zebra/interface.c if_data could be null dereferenced without early
check.

Signed-off-by: Morgan Stewart <morgan@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit c8394ace7081ef0e71f3d162067c83c2629fc088)

8 years agozebra: Fix leaked sockets in rtadv.c
Morgan Stewart [Wed, 16 Sep 2015 17:17:54 +0000 (13:17 -0400)]
zebra: Fix leaked sockets in rtadv.c

Coverity Scan #709790
In zebra/rtadv.c: rtadv_make_socket leaks socket for error cases.
Added lines to close the socket for each error case or return.

Signed-off-by: Morgan Stewart <morgan@cumulusnetworks.com>
(cherry picked from commit 26b663da7ea8a3efae816d6e7fda293bdc1082f5)

8 years agozebra: fix addr sent in ZEBRA_IPV6_NEXTHOP_LOOKUP
Hiroshi Yokoi [Tue, 8 Sep 2015 02:52:20 +0000 (11:52 +0900)]
zebra: fix addr sent in ZEBRA_IPV6_NEXTHOP_LOOKUP

I found that zebra doesn't set correct IPv6 address in its result because of
using *addr's address.  Although I'm using 0.99.22, the latest version has
also use "&addr".  Shouldn't it use "addr"?

Signed-off-by: Hiroshi Yokoi <hiroshi.yokoi.0313@gmail.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 8ccd74c29f5242f312c1e0561497558482c9be65)

8 years agovtysh: allow --with-libpam to build with --enable-werror
Donald Sharp [Fri, 4 Sep 2015 18:21:23 +0000 (14:21 -0400)]
vtysh: allow --with-libpam to build with --enable-werror

The function vtysh_pam fails the build with --enable-werror enabled
because it is a static function not declared as such

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

8 years agobgpd: Addition of "show ip bgp dampening" command tree
Balaji [Sat, 16 May 2015 17:42:17 +0000 (23:12 +0530)]
bgpd: Addition of "show ip bgp dampening" command tree

This patch addresses David's comments and contains:

1.Addition of show ip bgp dampening command tree
2.Addition of show ip bgp dampening parameters to display BGP dampening
  parameters.

Signed-off-by: Balaji.G <balajig81@gmail.com>
(cherry picked from commit 3921cc54445417aa1ca22668063701a626e93098)

8 years agobuild/lib: Check for and include stdbool.h by default
Paul Jakma [Tue, 15 Sep 2015 15:15:27 +0000 (16:15 +0100)]
build/lib: Check for and include stdbool.h by default

* stdbool.h should be widely supported by now, and the 'bool' type makes
  more semantic sense than an integer type for boolean values.

(cherry picked from commit e8441a81f6c9f73bc8a25669003abffb40066703)

8 years agoospfd: trap on state change seems to send incorrect value for ospfNbrState
Fernando Soto [Mon, 11 May 2015 20:52:00 +0000 (20:52 +0000)]
ospfd: trap on state change seems to send incorrect value for ospfNbrState

The ospfNbrState in the ospf trap sent from ospfd shows an incorrect state.

For example, when the connection goes down, the ospfNbrState in the trap is
sent as '8' (full).  When the connection is reestablished, the state is sent
as '7' (loading).

The reason seems to be that the trap is sent from nsm_notice_state_change()
before the state is actually updated by calling nsm_change_state().

After applying the attached patch, the traps are sent with nbrState '1' when
the connection goes down and '8' when it goes back up.

Bugzilla #833 https://bugzilla.quagga.net/show_bug.cgi?id=833

(cherry picked from commit b6404390a713144252b62f49a328315d1952c6d8)

8 years agoospfd: Fix bug in 94266fa822ba, nbr_self rebuild didn't add valid nbr_self
Paul Jakma [Tue, 8 Sep 2015 14:31:45 +0000 (15:31 +0100)]
ospfd: Fix bug in 94266fa822ba, nbr_self rebuild didn't add valid nbr_self

94266fa822ba "ospfd: Self nbrs needs to be rebuilt when router ID changes."
  deleted the nbr_self, and added it back, but ospf_nbr_add_self doesn't
  actually create the nbr_self - it assumes it's already there. Leading
  to use after free and crashes after a router-id change.
* ospfd/ospf_neighbor.{c,h}: (ospf_nbr_self_reset) Little helper to reset the
  nbr_self correctly.
* ospf_interface.c: (ospf_if_cleanup) moved code to ospf_nbr_self_reset
* ospfd.c: (ospf_router_id_update) Use ospf_nbr_self_reset instead of doing
  the reset badly, fixing 94266fa822ba.

(cherry picked from commit c920e510d09c6c4ab63a3da5375009442a950f82)

8 years agoisisd: Add new adjacency to LSP neighbor list
Amritha Nambiar [Thu, 2 Jul 2015 22:42:58 +0000 (15:42 -0700)]
isisd: Add new adjacency to LSP neighbor list

isis_pdu.c :
New adjacency did not always get added to LSP neighbor list.

The adjacencies that were created once minimum time allowed before LSP
retransmission had surpassed, instantly got their LSP regenerated, but
the adjacency circuit type was not set to IIH PDU circuit type before
the LSP was regenerated , hence didn't pass the check for adjacency
circuit type in lsp_build(), and the adjacency was not added to neighbor list.

When a new adjacency is up, to build LSP with neighbor entry corresponding
to the adjacency, set adjacency circuit type to circuit type from hello PDU
header before new LSP is regenerated/built. This will result in the new
adjacency entry getting added to the LSP neighbor list TLV.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
(cherry picked from commit 06cc655c0345d610eb946bd41968caa03dc118ed)

8 years agoospfd: ospf_nbr_nbma_set()/ospf_snmp_vl_add() add unlock
Joakim Tjernlund [Mon, 8 Mar 2010 12:58:14 +0000 (13:58 +0100)]
ospfd: ospf_nbr_nbma_set()/ospf_snmp_vl_add() add unlock

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit 4de398e3b676bcf041984e285dba12f229215419)

8 years agoospfd: ospf_ls_upd_send() add missing unlock.
Joakim Tjernlund [Mon, 8 Mar 2010 12:58:13 +0000 (13:58 +0100)]
ospfd: ospf_ls_upd_send() add missing unlock.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit 4eaecdc403461fe59026e1ce3a217526d75eca25)

8 years agoospfd: ospf_ase.c, external_lsa locking fixes.
Joakim Tjernlund [Mon, 8 Mar 2010 12:58:12 +0000 (13:58 +0100)]
ospfd: ospf_ase.c, external_lsa locking fixes.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit fc363cd8a02ad1ac8a6ca57013fd8c531d45926a)

8 years agoospfd: Move route_unlock_node() in ospf_ase_incremental_update()
Joakim Tjernlund [Mon, 8 Mar 2010 12:58:10 +0000 (13:58 +0100)]
ospfd: Move route_unlock_node() in ospf_ase_incremental_update()

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit d5643f5a477e099a3dcae4a707ccb5ca66bfee66)

8 years agoospfd: add missing unlock for ospf_interface_address_delete()
Joakim Tjernlund [Mon, 8 Mar 2010 12:58:09 +0000 (13:58 +0100)]
ospfd: add missing unlock for ospf_interface_address_delete()

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit fbb6c8650344fe72d39f538c681659e8b76a39d0)

8 years agoospfd: Self nbrs needs to be rebuilt when router ID changes.
Joakim Tjernlund [Thu, 19 Nov 2009 14:27:30 +0000 (15:27 +0100)]
ospfd: Self nbrs needs to be rebuilt when router ID changes.

Some self nbrs are identified by router_id, these needs
to be rebuilt instead of just resetting router ID.
Possibly one could optimize for !(virtual | ptop) links
by doing oi->nbr_self->router_id = router_id instead.

Router ID will change once after startup config has been
read and zebra reports router ID, unless router ID has
been configured in ospf.

(cherry picked from commit 94266fa822baf9b9c9e10ac03ccec8ccf3ce0c98)

8 years agolib, stream: fix stream sanity checks
Wenjian Ma [Fri, 19 Jun 2015 02:53:26 +0000 (10:53 +0800)]
lib, stream: fix stream sanity checks

Because  operator "!" has higher priority  than "&&",
So we put the "&&" expression in "()" to check both getp and endp.
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 1ed8ce47b922b71f3b3cdd661e647bbe7ed2eca7)

8 years agolib: make sockunion2str safer to use
Timo Teräs [Sat, 23 May 2015 08:08:38 +0000 (11:08 +0300)]
lib: make sockunion2str safer to use

It's mostly used for logging, and the return value is never
checked, so try to make it valid.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 53009d387a633997b16d32224b50451b5c81b61a)

8 years agoroute table: constify some APIs
Timo Teräs [Fri, 22 May 2015 10:41:01 +0000 (13:41 +0300)]
route table: constify some APIs

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3293bc280f15d8e3c04e0bf9b0a8d54d342a87a9)

8 years agosockunion: add accessors for sockunion address
Timo Teräs [Fri, 22 May 2015 10:40:59 +0000 (13:40 +0300)]
sockunion: add accessors for sockunion address

Upcoming nhrp code will use this, and it can be used to remove
the sockunion2ip(X) macro.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 483abc037b0ac4b3ed168c4810bb14ea338fa80c)

8 years agosockopt: add support for querying tcp round-trip-time
Timo Teräs [Wed, 29 Apr 2015 06:43:03 +0000 (09:43 +0300)]
sockopt: add support for querying tcp round-trip-time

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 6b2672f3c9493aef3495192e113f95a7db4b65bc)

8 years agoospfd: Make ospf_passive_interface_update calls friendly to static analysis
Paul Jakma [Fri, 19 Sep 2014 15:41:10 +0000 (16:41 +0100)]
ospfd: Make ospf_passive_interface_update calls friendly to static analysis

* ospf_vty.c: ({no_}ospf_passive_interface_addr_cmd) To a static analyser,
  the call to ospf_passive_interface_update can look like uninitialised memory
  in addr might be read from. It won't be, as ospf_passive_interface_update
  only reads addr if params != IF_DEF_PARAMS, but not clear. Split up the
  helper into the two cases to make it clear.

(cherry picked from commit e1bcd4741c24ff990a9413ead9a9e37b80153046)

8 years agoisisd: fix crash on processing own p2p hello
Amritha Nambiar [Thu, 23 Apr 2015 22:36:55 +0000 (15:36 -0700)]
isisd: fix crash on processing own p2p hello

isis_pdu.c :
isisd crashes if router's own p2p hello packets get processed
thereby creating an adjacecncy with itself. Asserts at
isis_find_vertex. So discard own p2p IIH PDU and avoid
creating adjacency with self. This would also fix duplicate
systemID on an interface. These checks already exists for IS-IS
LAN Level 1/2 Hello PDU in process_lan_hello, but not for
point-to-point IIH PDUs.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 491417ac6383e2ea557951b24eb7bd3fffb69394)