]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years agodocs: defines.texi include seems to want to be after setfilename
Paul Jakma [Thu, 9 Oct 2014 15:09:10 +0000 (16:09 +0100)]
docs: defines.texi include seems to want to be after setfilename

* quagga.texi: I'm getting warnings about stuff in defines.texi not being
  defined when building quagga.info. Seems to be fixed by moving the include
  of defines.texi to the end of the header. Also, the Texinfo docs suggest
  setfilename must go first.

(cherry picked from commit 384d7ad98c109e92eaf65bf10a3256e5657639c3)

8 years agozebra: Build the test client, can be useful, and add IPv6 to testrib.conf
Paul Jakma [Thu, 9 Oct 2014 09:51:41 +0000 (10:51 +0100)]
zebra: Build the test client, can be useful, and add IPv6 to testrib.conf

(cherry picked from commit 7a6eec54eaffa82f4f03363314bb81c400eb2a66)

8 years agoFreeBSD has changed its SOCK_RAW for being truly raw.
Olivier Cochard-Labbé [Thu, 9 Oct 2014 09:28:21 +0000 (10:28 +0100)]
FreeBSD has changed its SOCK_RAW for being truly raw.

(cherry picked from commit f6444e4f6e1664f49f7552f894c8c94e45dd3c35)

8 years ago[lib] Add support for backtrace on more platforms
Joakim Tjernlund [Thu, 25 Jun 2009 15:40:06 +0000 (16:40 +0100)]
[lib] Add support for backtrace on more platforms

* lib/sigevent.c: (program_counter) extend to support more platforms. Joint
  effort with Paul Jakma.

(cherry picked from commit b166ea2dda9f04a8b75e0bf5adb7064580695f22)

8 years agolib/plist: Add some required parentheses, according to clang-analyzer
Paul Jakma [Fri, 19 Sep 2014 15:55:46 +0000 (16:55 +0100)]
lib/plist: Add some required parentheses, according to clang-analyzer

(cherry picked from commit 18f420e9f99e7f6557cf5877673cd6e71ac32192)

8 years agoripng_nexthop: remove unused store to variable
Paul Jakma [Fri, 19 Sep 2014 14:35:54 +0000 (15:35 +0100)]
ripng_nexthop: remove unused store to variable

(cherry picked from commit 16f1606382b77ac6b951ea0de15384fcbc1df73f)

8 years agoospf6_lsdb: trivial, make it clear that showfunc is set before deref.
Paul Jakma [Fri, 19 Sep 2014 14:35:15 +0000 (15:35 +0100)]
ospf6_lsdb: trivial, make it clear that showfunc is set before deref.

(cherry picked from commit 7bef33cbf5027189bd55e4890a07a6bef8277f93)

8 years agoAdd missing GPL headers, and copyright claims that certainly apply.
Paul Jakma [Tue, 16 Sep 2014 10:53:49 +0000 (11:53 +0100)]
Add missing GPL headers, and copyright claims that certainly apply.

* Fix (a subset of)? files with non-trivial code that are missing GPL headers.

* A few copyright claims added which I am certain apply, but which I had
  missed out on the original commits.

NB: Copyright claims are not exclusive and the addition of any copyright
claim should not be read as implying a lack of any further claims, or
denying the validity of any other claims.  All those with claims of
copyright over any portion of Quagga are welcome to submit them, ideally as
patches to update copyright strings in files.

(cherry picked from commit 010ebbbca6396f272cc2d50d147dd922dda68213)

8 years agoHACKING: remove an unneeded escape
Paul Jakma [Fri, 19 Oct 2012 11:02:42 +0000 (12:02 +0100)]
HACKING: remove an unneeded escape

(cherry picked from commit d4a8607d12e1d3f655055647f1633ec154685545)

8 years agoripd: use only one constant for derivation
Lu Feng [Wed, 25 Jun 2014 07:43:15 +0000 (07:43 +0000)]
ripd: use only one constant for derivation

RIP_MAX_RTE is defined in ripd.h as 25 but is in fact the
result of a formula. More over it is not used in the code:
the code itself includes the fomula. This makes it un-clear
for maintenance.

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 342a31bfda21616209366679ac522471e5772a2f)

8 years agobgpd: route-map: share aspath object compilation code where possible
Timo Teräs [Tue, 20 May 2014 06:04:49 +0000 (09:04 +0300)]
bgpd: route-map: share aspath object compilation code where possible

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
(cherry picked from commit b304dcb8abc4e5b93f86a4024990980746e730be)

8 years agobgpd: fix route-map comments
Timo Teräs [Tue, 20 May 2014 05:57:26 +0000 (08:57 +0300)]
bgpd: fix route-map comments

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
(cherry picked from commit 2aa640bd78b64821bde9a53ecdd1e96e91b20ae4)

8 years agopimd: Fix some static analysis
Donald Sharp [Thu, 26 May 2016 00:36:10 +0000 (20:36 -0400)]
pimd: Fix some static analysis

Using && instead of &.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoquagga: Fix bug in handling of --enable-shell-access
Donald Sharp [Wed, 25 May 2016 23:53:09 +0000 (19:53 -0400)]
quagga: Fix bug in handling of --enable-shell-access

The macro to expand and handle --enable-shell-access was
broken.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobuild: Remove the old PIC/PIE patch, let libtool sort it out
Paul Jakma [Thu, 20 Aug 2015 20:30:17 +0000 (21:30 +0100)]
build: Remove the old PIC/PIE patch, let libtool sort it out

* Remove the old change from '08 to add in PIE arguments at automake level.
  Versions of libtool since then know how to deal with -fpie and do the right
  thing according to whether its building shared or executable objects.
  So just pass '-fpie' as CFLAG and let libtool do its thing.

8 years agopimd: Clean up some more compile warnings
Donald Sharp [Wed, 25 May 2016 23:43:00 +0000 (19:43 -0400)]
pimd: Clean up some more compile warnings

Turns out we were missing $(WERROR) for compiling pimd
so we were not catching compile warning issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix SPT bit initial setting
Donald Sharp [Thu, 12 Nov 2015 15:54:04 +0000 (07:54 -0800)]
pimd: Fix SPT bit initial setting

The initial setting of the SPT bit was incorrect.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix pim_upstream_find to match on INADDR_ANY for source
Donald Sharp [Wed, 4 Nov 2015 00:39:40 +0000 (16:39 -0800)]
pimd: Fix pim_upstream_find to match on INADDR_ANY for source

Fix the pim_upstream_find code to match on INADDR_ANY for source.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoPimd: pim register send is being sent and received at the RP
Donald Sharp [Thu, 29 Oct 2015 18:27:39 +0000 (11:27 -0700)]
Pimd: pim register send is being sent and received at the RP

Modify the code to send a register packet upstream to the RP.
Packet is currently being received but not properly decoded
currently.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify NOCACHE code to create (S,G) route
Donald Sharp [Thu, 29 Oct 2015 13:41:24 +0000 (06:41 -0700)]
pimd: Modify NOCACHE code to create (S,G) route

The code was hard-coding the (S,G) route to get the
multicast packet up into pimd.  This code fixes
this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Create special pimreg interface
Donald Sharp [Thu, 29 Oct 2015 13:35:12 +0000 (06:35 -0700)]
pimd: Create special pimreg interface

The linux kernel wants a pimreg vif device.  The pimd
code wants a 'struct interface *' for anything it works
with.  Since the pimreg vif device is not a real linux
device that zebra knows about.  Cheat by creating
a pimreg interface pointer and setup the code to
properly be able to handle the registration of the vif
device.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix some file inclusion issues.
Donald Sharp [Wed, 28 Oct 2015 19:22:22 +0000 (12:22 -0700)]
pimd: Fix some file inclusion issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Move add_oif into pim_oil.c
Donald Sharp [Wed, 28 Oct 2015 18:00:37 +0000 (11:00 -0700)]
pimd: Move add_oif into pim_oil.c

This commit does two things:
(A) Sets up #defines for the pimreg to be used in pim_mroute.c
(B) Moves add_oif into pim_oil.c where it belongs

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add New Source type for where a (S,G) mroute is learned
Donald Sharp [Wed, 28 Oct 2015 17:14:06 +0000 (10:14 -0700)]
pimd: Add New Source type for where a (S,G) mroute is learned

Add Source type for (S,G) mroute.  This will allow us to know that
a (S,G) route came from an actual Source( ie the kernel called us
back with information about a multicast packet it received with
no mroute for it ).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Convert the RP(G) code to return a struct pim_rpf
Donald Sharp [Wed, 28 Oct 2015 14:00:31 +0000 (07:00 -0700)]
pimd: Convert the RP(G) code to return a struct pim_rpf

This will facilitate sending packets to the right spot

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix compile warnings with zlog_hexdump
Donald Sharp [Wed, 25 May 2016 23:14:36 +0000 (19:14 -0400)]
lib: Fix compile warnings with zlog_hexdump

When using zlog_hexdump tell the compiler that we don't expect
to actually change the memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Modify the RP data structure.
Donald Sharp [Tue, 27 Oct 2015 20:13:23 +0000 (13:13 -0700)]
pimd: Modify the RP data structure.

Modify the RP data structure to know how to get to it from here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Move I_am_DR macro to more appropriate place
Donald Sharp [Fri, 23 Oct 2015 14:37:45 +0000 (07:37 -0700)]
pimd: Move I_am_DR macro to more appropriate place

Move the I_am_DR(ifp) outside of pim_macro.c and into
pim_iface.h where it belongs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add some code to intelligently handle WHOLEPKT generation
Donald Sharp [Fri, 23 Oct 2015 14:10:30 +0000 (07:10 -0700)]
pimd: Add some code to intelligently handle WHOLEPKT generation

When we get a NOCACHE call from the kernel, there is
no point generating a mcast route for the packet if
there is no RP configured, or if PIM-SSM is configured
on the interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add some debug code to unknown packet upcalls
Donald Sharp [Fri, 23 Oct 2015 12:58:39 +0000 (05:58 -0700)]
pimd: Add some debug code to unknown packet upcalls

When receiving data from the kernel from the kernel socket,
some calls that are received are not known what they are.
Provide some more debug code to handle appropriately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fixup some broken code for the register receive
Donald Sharp [Tue, 20 Oct 2015 15:42:16 +0000 (08:42 -0700)]
pimd: Fixup some broken code for the register receive

Some of the register receive code was broken.  This fixes that

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Cleanup some comments and documentation
Donald Sharp [Tue, 20 Oct 2015 15:41:09 +0000 (08:41 -0700)]
pimd: Cleanup some comments and documentation

Starting the transition of PIM-SSM to PIM-SM means
that we have to cleanup some internal code comments
so that the code will match the comments.

Signed-off-by: Donald Sharp<sharpd@cumulusnetworks.com
8 years agopimd: Start handling of pim REGISTER packet type
Donald Sharp [Tue, 20 Oct 2015 15:36:37 +0000 (08:36 -0700)]
pimd: Start handling of pim REGISTER packet type

This code starts the handling of the pim register type.  No guarantees that
it works correctly, just that it compiles and the start of the code is in there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Cause NOCACHE event to create WHOLEPKT events for pimd
Donald Sharp [Tue, 20 Oct 2015 15:26:24 +0000 (08:26 -0700)]
pimd: Cause NOCACHE event to create WHOLEPKT events for pimd

pimd needs the ability to send the multicast packet to the RP.
This code causes the incoming unknown multicast packet to
be send to pimd so it can be sent as a REGISTER packet towards
the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix nexthop resolution breakage
Donald Sharp [Tue, 20 Oct 2015 15:25:13 +0000 (08:25 -0700)]
pimd: Fix nexthop resolution breakage

Nexthop resolution was broken due to some ill placed debug statements.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fixup kernel callbacks to handle them better
Donald Sharp [Tue, 20 Oct 2015 13:00:02 +0000 (06:00 -0700)]
pimd: Fixup kernel callbacks to handle them better

This patch sets up the handling of the 3 basic kernel callbacks:
IGMPMSG_WRONGVIF - When a multicast message comes in the wrong vif
IGMPMSG_NOCACHE - There is no multicast route associated with a received(S,G)
IGMPMSG_WHOLEPKT - There is no outgoing interface for a packet.

The code's debugs are cleaned up to be covered by debug statements

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Register with kernel to get unknown multicast packets
Donald Sharp [Tue, 20 Oct 2015 01:23:16 +0000 (18:23 -0700)]
pimd: Register with kernel to get unknown multicast packets

Start the process of creating the pimreg vif device so that
we can get the callbacks from the kernel with the multicast packets

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: don't print uninitialized string (3b02fe8)
David Lamparter [Sat, 7 Mar 2015 07:40:48 +0000 (08:40 +0100)]
zebra: don't print uninitialized string (3b02fe8)

This crept in as part of the MRIB improvements and I missed the compiler
warning between other noise.  Unfortunately, printing an uninitialised
variable can in fact make zebra crash, so this is not trivial.

Fixes: 3b02fe8 ("zebra: add "show ip rpf" to get result of RPF lookup")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: SwitchToSptDesired addition
Donald Sharp [Fri, 16 Oct 2015 16:11:51 +0000 (09:11 -0700)]
pimd: SwitchToSptDesired addition

Add code to tell us if we want to switch to a SPT for the (S,G)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com
8 years agopimd: Add code to start the KAT(S,G) as needed
Donald Sharp [Fri, 16 Oct 2015 14:50:16 +0000 (07:50 -0700)]
pimd: Add code to start the KAT(S,G) as needed

The KAT(S,G) timer can now be started and on
expiry the timer clears the PMBR(S,G).

More work needs to be done for when this timer pops, but
good enough of a start now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Create some infrastructure code for RST(S,G) and KAT(S,G)
Donald Sharp [Fri, 16 Oct 2015 14:01:47 +0000 (07:01 -0700)]
pimd: Create some infrastructure code for RST(S,G) and KAT(S,G)

These two timers have some default values.  Create the
default defines to be used and start setting up the data
structures for them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start work for handling of register command
Donald Sharp [Thu, 15 Oct 2015 16:02:50 +0000 (09:02 -0700)]
pimd: Start work for handling of register command

Start the coding of the REGISTER receive and send.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Check to see if we are the RP
Donald Sharp [Thu, 15 Oct 2015 15:58:37 +0000 (08:58 -0700)]
pimd: Check to see if we are the RP

Add code to allow on interface up/down events the check of whether
or not this process is the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add SPTbit(S,G) support
Donald Sharp [Thu, 15 Oct 2015 13:58:41 +0000 (06:58 -0700)]
pimd: Add SPTbit(S,G) support

Add code to allow pimd to store the SPTbit as needed and
to properly test against it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Start adding the ability to handle the Bridge Router
Donald Sharp [Thu, 15 Oct 2015 13:19:31 +0000 (06:19 -0700)]
pimd: Start adding the ability to handle the Bridge Router

Add code to allow the check and set the PMBR(S,G) if the register.borderbit
is set.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add code to get RP(G)
Donald Sharp [Fri, 2 Oct 2015 17:34:11 +0000 (10:34 -0700)]
pimd: Add code to get RP(G)

Add code to figure out who the RP is for group G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add RP check code
Donald Sharp [Fri, 2 Oct 2015 16:30:02 +0000 (09:30 -0700)]
pimd: Add RP check code

Add the ability for the node to determine if it is the RP or not.
Currently this only allows static RP's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Receive and transmit (*,G) to the RP
Donald Sharp [Wed, 30 Sep 2015 12:41:18 +0000 (05:41 -0700)]
pimd: Receive and transmit (*,G) to the RP

Receive a (*,G) route and send it upstream to the RP.
The RP at this time does not properly handle the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix test_igmp_join code to handle thread_master * changes
Donald Sharp [Tue, 29 Sep 2015 16:42:08 +0000 (09:42 -0700)]
pimd: Fix test_igmp_join code to handle thread_master * changes

Fixup of pimd to be cognizant of thread_master pointer changes

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoImplement "ip pim rp X.Y.Z.A" and "ip pim sm" commands
Donald Sharp [Tue, 8 Sep 2015 15:10:19 +0000 (08:10 -0700)]
Implement "ip pim rp X.Y.Z.A" and "ip pim sm" commands

Allow the user to specify the static Rendevous point
as well as specifying that an interface is Sparse Mode.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoFixup of Code to allow pimd to actually run on startup
Donald Sharp [Wed, 3 Jun 2015 15:20:45 +0000 (08:20 -0700)]
Fixup of Code to allow pimd to actually run on startup

Fixup of various control files to allow quagga to startup
properly with pimd actually part of the set

8 years agopimd: Limit pim hello log messages
Donald Sharp [Wed, 21 Oct 2015 20:13:51 +0000 (16:13 -0400)]
pimd: Limit pim hello log messages

pimd was outputting allot of data surrounding pim hello packets.
In addition the debugging was inconsistent and not all turned
on via 'debug pim packet hello'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix size_t zlog_err format string warning
Paul Jakma [Thu, 29 Oct 2015 14:24:13 +0000 (14:24 +0000)]
pimd: Fix size_t zlog_err format string warning

fc1c114aa / "pimd: Fix warning", the size_t arg should have a %zu format.

8 years agopimd: Cleanup interface startup
Donald Sharp [Fri, 2 Oct 2015 16:27:27 +0000 (12:27 -0400)]
pimd: Cleanup interface startup

This patch cleans up some interface startup, removes duplicate
debug messages and protects against some always being displayed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Notice when we receive a packet type we can't handle yet
Donald Sharp [Thu, 1 Oct 2015 16:40:52 +0000 (12:40 -0400)]
pimd: Notice when we receive a packet type we can't handle yet

There are PIM packet types that have not been implemented yet.
Notice when we get one of those and safely do nothing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add knowledge of different packet types
Donald Sharp [Thu, 1 Oct 2015 16:40:51 +0000 (12:40 -0400)]
pimd: Add knowledge of different packet types

There are several additional packet types that pimd is unaware of
Add code to allow pim to understand them in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Cleanup zebra debugs to be protected by debug commands
Donald Sharp [Wed, 30 Sep 2015 14:22:46 +0000 (10:22 -0400)]
pimd: Cleanup zebra debugs to be protected by debug commands

pimd is very chatty without any pim debugs turned on.
This commit fixes a bunch of the debugs to be protected
by appropriate pim debug statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Do not display some default values as part of a show run
Donald Sharp [Wed, 30 Sep 2015 13:10:12 +0000 (09:10 -0400)]
pimd: Do not display some default values as part of a show run

There is no need to display igmp default values for the query-interval
and the query-max-response-time-dsec

Before change:

!
interface swp4
 description swp4 -> host-212's swp1
 ip igmp
 ip igmp query-interval 125
 ip igmp query-max-response-time-dsec 100
 ip pim ssm
 link-detect
!

After change:
!
interface br1
 ip igmp
 ip pim ssm
 link-detect
!

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix warning
Martin Winter [Thu, 24 Sep 2015 04:13:58 +0000 (21:13 -0700)]
pimd: Fix warning

Fix long unsigned / unsigned mixup

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
8 years agopimd: use IPPROTO_IP (not SOL_IP) for IP_PKTINFO
David Lamparter [Tue, 15 Sep 2015 09:18:23 +0000 (02:18 -0700)]
pimd: use IPPROTO_IP (not SOL_IP) for IP_PKTINFO

Solaris uses the same socket API for IP_PKTINFO as Linux, but doesn't
have a SOL_IP define.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: Fix compile warning (error with Werror) on BSD
Paul Jakma [Thu, 24 Sep 2015 09:26:55 +0000 (10:26 +0100)]
pimd: Fix compile warning (error with Werror) on BSD

* ioctl commands can vary in type between systems, cast to an unsigned long
  before passing to format command.

8 years agopimd: Remove stdout zlog changes
Donald Sharp [Tue, 8 Sep 2015 19:19:55 +0000 (15:19 -0400)]
pimd: Remove stdout zlog changes

Quagga start has unnecessary pim messages to stdout.  Causing some confusion.
Logging is already saving this information in pimd.log

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix leaked fd
Donald Sharp [Tue, 8 Sep 2015 19:02:07 +0000 (15:02 -0400)]
pimd: Fix leaked fd

When caling pim_sock_open if the failure cause happens, however
unlikely, don't leak the fd on failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobuild: Enable vtysh and pimd as part of default build
Donald Sharp [Fri, 17 Jul 2015 01:18:34 +0000 (21:18 -0400)]
build: Enable vtysh and pimd as part of default build

The default build needs vtysh and pimd as a default build so
that when a change is made we can catch build issues before they
become a problem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd/pimd: fix zAPI parsing
Nicolas Dichtel [Wed, 16 Sep 2015 07:42:36 +0000 (09:42 +0200)]
bgpd/pimd: fix zAPI parsing

Commit c99f3481a598 has changed the API. Now, the vrfid has been added in
the header, thus we must read it before parsing the rest of the message.

To ease code maintenance, let's add a new function to read a zAPI header.

Fixes: c99f3481a598 ("*: add VRF ID in the API message header")
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
8 years agopimd: Create ability to modify hell and hold timers per interface
Donald Sharp [Fri, 21 Aug 2015 23:35:27 +0000 (19:35 -0400)]
pimd: Create ability to modify hell and hold timers per interface

Create new per interface command:
'ip pim hello <1-180> {<1-180>}'

The first number is the Hello Timer for this interface
The second number is the Hold Timer to pass to neighbors on this interface.
The second number is optional.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Change ioctl call failure from vty_out to zlog_warn
Donald Sharp [Thu, 2 Jul 2015 13:53:59 +0000 (09:53 -0400)]
pimd: Change ioctl call failure from vty_out to zlog_warn

The command 'show ip multicast' when run, iterates over all interfaces
on the router, if you do not have pim configured on that interface
it would generate an error message:

Interface Address         ifi Vif  PktsIn PktsOut    BytesIn   BytesOut
br1       20.0.15.1         7   7       0       0          0          0
swp1      169.254.0.10      3   3       0       0          0          0
swp2      169.254.0.26      4   4       0       0          0          0
ioctl(SIOCGETVIFCNT=35296) failure for interface swp3 vif_index=-1: errno=22: Invalid argument
ioctl(SIOCGETVIFCNT=35296) failure for interface swp4 vif_index=-1: errno=22: Invalid argument

This fixes the issue to display this instead:

Interface Address         ifi Vif  PktsIn PktsOut    BytesIn   BytesOut
br1       20.0.15.1         7   7       0       0          0          0
swp1      169.254.0.10      3   3       0       0          0          0
swp2      169.254.0.26      4   4       0       0          0          0
swp3      0.0.0.0           5  -1       0       0          0          0
swp4      0.0.0.0           6  -1       0       0          0          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Ensure new generation_id is different from previous
Donald Sharp [Thu, 2 Jul 2015 17:22:49 +0000 (13:22 -0400)]
pimd: Ensure new generation_id is different from previous

The RFC states that an interfaces generation_id must be changed
if it experiences an if down.  From 4.3.1:

The GenID option contains a randomly generated
32-bit value that is regenerated each time PIM forwarding is started
or restarted on the interface, including when the router itself
restarts.

Since we are only grabbing a new generation_id without comparing
it to the previous generation_id, it is possible that random
can generate the exact same number.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Stop DR election on every hello
Donald Sharp [Tue, 16 Jun 2015 20:19:56 +0000 (13:19 -0700)]
pimd: Stop DR election on every hello

The DR election is occurring on every hello received.
This is because the hello receive packet returns a 0
for any successfully received packet.  PIMD then looked
at the 0 returned and did a DR election.

Code was inspected for the cases where DR should happen:
(A) Interface ip address change
(B) DR priority in hello packet changes
(C) Received a new neighbor on an interface
(D) Neighbor timer pops.

Each of these initiate a DR election in the code currently.

Testing was initiated on a pim network:
tor-11# show ip pim designated-router
NonPri: Number of neighbors missing DR Priority hello option

Interface Address         DR              Uptime   Elections Changes NonPri
br1       20.0.15.1       20.0.15.1       00:08:16         1       1      0
swp1      169.254.0.10    169.254.0.10    00:08:16         2       1      0
swp2      169.254.0.26    169.254.0.26    00:08:16         2       1      0
tor-11#

As you can see Elections == 2.  This is because pimd performs
an election on (A) and (C) above.  I see no need to modify
(A) to check if we have any knowledge of the interface before
this call.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix first DR Election
Donald Sharp [Fri, 19 Jun 2015 00:01:34 +0000 (17:01 -0700)]
pimd: Fix first DR Election

The function pim_neighbor_new caused the dr election before
the addition of the neighbor to the pim_ifp->pim_neighbor_list,
in pim_neighbor_add, which is needed to properly elect the
correct DR.

Move the dr_election and hello trigger till after the addition
to the list.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add ability to set DR Priority for an interface
Donald Sharp [Fri, 19 Jun 2015 01:14:20 +0000 (18:14 -0700)]
pimd: Add ability to set DR Priority for an interface

From RFC 4601, Section 4.3.1:

The DR_Priority Option allows a network administrator to give
preference to a particular router in the DR election process by
giving it a numerically larger DR Priority.  The DR_Priority Option
SHOULD be included in every Hello message, even if no DR Priority is
explicitly configured on that interface.  This is necessary because
priority-based DR election is only enabled when all neighbors on an
interface advertise that they are capable of using the DR_Priority
Option.  The default priority is 1.

This modification allows the setting of the DR Priority on a per
interface basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: add support for configuring multicast static routes
Jafar Al-Gharaibeh [Thu, 11 Jun 2015 23:29:02 +0000 (18:29 -0500)]
pimd: add support for configuring multicast static routes

Hi,

This patch adds the ability to configure multicast static routes
directly into pimd. Two source files are introduced to implement the new
feature in addition to changes to existing files.

Here is how it can be used the CLI:

interface <incoming interface>
ip mroute <outgoing interface> <group addr>                          #
for asm
or ip mroute <outgoing interface> <group addr> <source>    # for ssm

Please let me know if you have any questions or concerns,

Regards,
Jafar

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoRemoval of 'show ip mroute'
Donald Sharp [Sat, 30 May 2015 22:57:54 +0000 (18:57 -0400)]
Removal of 'show ip mroute'

The 'show ip mroute' in zebra_vty.c collided with the
'show ip mroute' command in pim_cmd.c.  The 'show ip rpf'
command is functionally equivalent to the zebra_vty.c
'show ip mroute'.  Therefore remove the 'show ip mroute' command
in zebra_vty.c.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim: 'show debugging' collision
Donald Sharp [Thu, 28 May 2015 00:40:46 +0000 (17:40 -0700)]
pim: 'show debugging' collision

The 'show debugging' cli as setup by pim collided with 'show debugging isis'.
Fix that and clean up cli help commands to actually display correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoFixup of redhat control files to properly start pimd
Donald Sharp [Thu, 28 May 2015 00:57:31 +0000 (17:57 -0700)]
Fixup of redhat control files to properly start pimd

8 years agopimd assert when no route to source from a new igmp join
Donald Sharp [Sat, 13 Jun 2015 00:47:26 +0000 (17:47 -0700)]
pimd assert when no route to source from a new igmp join

When pim_upstream_new is called the code looks up the nexthop.
If there is no route to the source, the code silently ignored
the error returned.  When the nexthop lookup fails don't create
the 'struct pim_stream *' to return.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopim_mroute.h has a different version of code than linux/mroute.h provides
Donald Sharp [Fri, 5 Jun 2015 19:15:44 +0000 (12:15 -0700)]
pim_mroute.h has a different version of code than linux/mroute.h provides

linux/mroutes.h and pim_mroute.h both have copies of the same structures.
This is causing failures in setsockopt(..., MRT_ADD_MFC,...) because
of data structure incompatibilities between the kernel and what
pim_mroute.h was providing.  Modify the code to check for mroute.h
and include it if necessary.  I did not modify the non linux/mroute.h
path because I do not have other systems to test on easily.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoPIMD: Fix code to use srandom/random
Donald Sharp [Fri, 19 Jun 2015 23:26:18 +0000 (19:26 -0400)]
PIMD: Fix code to use srandom/random

pimd rolled it's own solution to random #'s, that was not
terribly random.  Rely on the underlying system to generate
random #'s for us

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: assorted warning fixes
David Lamparter [Tue, 21 Apr 2015 08:46:13 +0000 (10:46 +0200)]
*: assorted warning fixes

A few warnings slipped through the cracks...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: fix out of tree build
David Lamparter [Tue, 21 Apr 2015 07:45:06 +0000 (09:45 +0200)]
pimd: fix out of tree build

pimd/Makefile.am was missing srcdir/lib from its include paths, breaking
out-of-tree build regarding route_types.h

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: cast ioctl values when printing them
David Lamparter [Wed, 4 Mar 2015 05:37:20 +0000 (06:37 +0100)]
pimd: cast ioctl values when printing them

ioctl values might be int or long, cast them to unsigned long for
consistent printing.  (They're long on FreeBSD, but were printed with
%d.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: cast to sockaddr_in to sockaddr
David Lamparter [Tue, 3 Mar 2015 20:03:52 +0000 (21:03 +0100)]
pimd: cast to sockaddr_in to sockaddr

While glibc seems to have something in the system headers that prevents
this from triggering a warning, FreeBSD doesn't.  Fix the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: Rework pim to handle changes between us and upstream
Donald Sharp [Wed, 25 May 2016 05:31:30 +0000 (01:31 -0400)]
pimd: Rework pim to handle changes between us and upstream

The code in pimd needs to be updated to handle the changes
we've made to api's that it depends on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: mask unused zclient_broken()
David Lamparter [Tue, 3 Mar 2015 09:41:21 +0000 (10:41 +0100)]
pimd: mask unused zclient_broken()

this function is used by the currently not present zclient reconnect
code.  It'll be unmasked again when that code hits master.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobuild: enable pimd in test script
David Lamparter [Wed, 4 Feb 2015 05:24:41 +0000 (06:24 +0100)]
build: enable pimd in test script

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: merge pimd as of 2015-01-19
David Lamparter [Wed, 4 Feb 2015 06:01:14 +0000 (07:01 +0100)]
pimd: merge pimd as of 2015-01-19

Welcome pimd to the Quagga daemon zoo!

This is a merge of commit 77ae369 ("pimd: Log ifindex found for an
interface when zebra lib reports a new connected address."), with
the intermediate "reconnect" changes removed (c9adf00...d274381).
d274381 is replaced with b162ab7, which includes some changes.  In
addition, 4 reconnect-related changes and 1 cosmetic one have been
bumped out.

The rebase command used to produce the branch that is merged here is:
  git rebase --onto b162ab7 c9adf00 77ae369

Note that 3 patches had their author rewritten from
    "Anonymous SR#108542 <>" (which is not a valid git author ID)
to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address
                               listed in the associated Savannah ticket)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agodoc: explain rpf lookup default mode
David Lamparter [Mon, 2 Feb 2015 02:00:22 +0000 (03:00 +0100)]
doc: explain rpf lookup default mode

Reported-by: Alexis Rosen <quagga-users@alexis.users.panix.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agodoc: zebra multicast RIB commands
David Lamparter [Fri, 30 Jan 2015 00:44:25 +0000 (01:44 +0100)]
doc: zebra multicast RIB commands

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: mark multicast commands experimental
David Lamparter [Tue, 27 Jan 2015 19:24:15 +0000 (20:24 +0100)]
zebra: mark multicast commands experimental

depending on feedback from actually having these commands in a released
version, we may want to adjust them.  Thus, mark them as experimental so
users are aware of this.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add "show ip rpf" to get result of RPF lookup
David Lamparter [Thu, 22 Jan 2015 18:12:35 +0000 (19:12 +0100)]
zebra: add "show ip rpf" to get result of RPF lookup

Checking what route exactly a RPF lookup for a given source uses is
essential for an administrator to debug multicast routing issues.  This
command provides exactly that, using the multicst RPF lookup function
and printing out its result to the CLI.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: make MRIB lookup behaviour switchable
David Lamparter [Tue, 6 Jan 2015 18:53:24 +0000 (19:53 +0100)]
zebra: make MRIB lookup behaviour switchable

depending on the usage scenario (and availability of multitopology IGP
protocols, which is currently zero in Quagga), different approaches of
Multicast RPF lookups are useful.

Reference behaviours from commercial vendors are urib-only/mrib-only
(Juniper, depending on inet.2 availability) and lowest-distance (Cisco).
As we are currently without MT IGP support, mrib-first seems the most
useful default for Quagga.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: return route_node from rib_match_ipv4_safi
David Lamparter [Thu, 22 Jan 2015 18:09:36 +0000 (19:09 +0100)]
zebra: return route_node from rib_match_ipv4_safi

The multicast code needs to know the route_node in addition to the rib
entry in order to perform distance or prefix-length comparisons.  Add it
as optional "out" pointer parameter.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: dummy kernel "install" multicast routes
David Lamparter [Mon, 12 Jan 2015 06:05:06 +0000 (07:05 +0100)]
zebra: dummy kernel "install" multicast routes

This is a followup to 9511633 ("zebra: MBGP routes should not be
installed in the kernel"), which was correct in disabling MRIB routes
being installed in the kernel, yet broke the MRIB since now routes were
never marked as active.

Hence, push down the check into the kernel install functions, so that
the routes are still marked active.  At the same time, the FPM calls get
a check each since otherwise we'd bump the FPM interface on MRIB
updates.

Fixes: 9511633 ("zebra: MBGP routes should not be installed in the kernel")
Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: fix optional distance on static mrib route
David Lamparter [Thu, 22 Jan 2015 18:03:53 +0000 (19:03 +0100)]
zebra: fix optional distance on static mrib route

Unfortunately, the quagga CLI parser doesn't support [<1-255>].  Fix by
working around with an alias.

Replaces the following commits:
- zebra: mrib: [no] ip mroute - require distance.
- zebra: mrib: [no] ip mroute - make distance optional.
(Rewritten as alias)

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: mrib: static route support
Everton Marques [Mon, 14 Jul 2014 14:19:00 +0000 (11:19 -0300)]
zebra: mrib: static route support

With the MRIB being independent from the Unicast RIB, there's currently
now way to add static routes to the MRIB.  Address that by adding a
separate set of commands for MRIB static routes.

Combines these original patches:
- zebra: mrib: ip mroute command to add unicast route to MRIB for multicast RPF.
- zebra: mrib: no ip mroute: Fix removal of static multicast RPF route.
- zebra: mrib: remove unused static_add/delete_ipv4
- zebra: Cleanups to zebra_rib.
- pimd: Merge pim-only branch.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB
Everton Marques [Tue, 1 Jul 2014 18:15:52 +0000 (15:15 -0300)]
zebra: add ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB

This adds a new zapi call "ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB" performing a
Multicast RPF lookup for a given source.  Details of the lookup
behaviour are left to the zebra side of things.

Note: this is non-reactive, as in, only delivers a snapshot of the state
at a particular point in time.  There's no push notification of changes
happening to the RIB.

This combines the following 3 original patches:
- zebra: add zsend_ipv4_nexthop_lookup_mrib()
- zserv: Query mrib (SAFI_MULTICAST).
- zebra: Cleanups to zebra_rib.

Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: add rib_match_ipv4_safi()
Everton Marques [Mon, 22 Sep 2014 22:35:51 +0000 (19:35 -0300)]
zebra: add rib_match_ipv4_safi()

This is the same as rib_lookup_ipv4(), without the SAFI hardcoded.

Cc: Balaji G <balajig81@gmail.com>
Cc: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: identify MRIB on debug messages
David Lamparter [Thu, 22 Jan 2015 18:02:13 +0000 (19:02 +0100)]
zebra: identify MRIB on debug messages

since the same code handles both URIB and MRIB, the debug messages can
get rather confusing if the RIB isn't identified.  Mark the MRIB in
debug messages so we can distinguish that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: factor out rib debug logs
David Lamparter [Thu, 24 Apr 2014 18:22:53 +0000 (20:22 +0200)]
zebra: factor out rib debug logs

Introduces a logging function that takes a struct route_node * argument,
and prefixes log output with that node's prefix.  While this removes
some duplication, it will also later be useful for srcdest route nodes.

Behaviour before and after the patch should be exactly identical.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: Ensure IPv6 RA configuration is displayed correctly
vivek [Mon, 23 May 2016 16:46:14 +0000 (09:46 -0700)]
zebra: Ensure IPv6 RA configuration is displayed correctly

IPv6 RAs on an interface can be enabled either by the operator or internally
due to the configuration of a BGP unnumbered neighbor. Ensure that this is
displayed in the configuration correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11076
Reviewed By: CCR-4770
Testing Done: Manual; also verified by defect submitter.