Brian Bennett [Tue, 17 Feb 2015 23:26:12 +0000 (23:26 +0000)]
solaris: fix SMF manifest dependency model and start method
Resolves an issue where quagga daemons restart in an infinite loop.
Quagga daemons declare a dependency on zebra that requires a restart
of the daemon when zebra restarts and they explicitly restart zebra,
which again triggers their own restart.
Restarting zebra when other daemons are started is explicitly removed,
leaving dependency management up to SMF rather than handling it in the
start method.
solaris/quagga.init.in: Remove calls to routeadm_zebra_enable, and the
routeadm_zebra_enable function.
solaris/quagga.xml.in: Set dependency zebra grouping to require_all.
Fixes: #818 Signed-off-by: Greg Troxel <gdt@ir.bbn.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 75a3cf6cf69f6ab940f8421b0f79b2b1f689b904)
Brian Bennett [Tue, 17 Feb 2015 22:32:22 +0000 (22:32 +0000)]
build: Extend ip_mreq hack to DragonFlyBSD and SunOS
This extends the ip_mreq hack to DragonFlyBSD and SunOS. This has been
in pkgsrc for some time. I've cleaned up the pkgsrc patch a little and
am submitting it upstream. Credit is due to pkgsrc maintainers.
Tested on SmartOS (illumos).
Fixes: #819 Signed-off-by: Greg Troxel <gdt@ir.bbn.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b8a893c38e97377b2a2582b1621b988e55811412)
David Lamparter [Tue, 10 Feb 2015 10:39:39 +0000 (11:39 +0100)]
build: enable AM_SILENT_RULES
This shuts up make by default (can be reversed with "make V=1" or
--disable-silent-rules). This is useful since warnings and error
messages become more visible with less noise.
Tested on Linux with GNU make and FreeBSD with system's BSD make.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit cc81308148271aeed2277e16885ddca7e2d5bb9b)
David Lamparter [Fri, 28 Nov 2014 07:40:58 +0000 (08:40 +0100)]
doc: fix some warnings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit f16195c173f8e2e17ea35f143b6ffcd50c0619fb)
David Lamparter [Sat, 22 Nov 2014 18:31:44 +0000 (10:31 -0800)]
tests: remove --disable-ipv6
With --disable-ipv6 gone, the IPv6 detection logic in the tests is not
needed anymore either.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit 85c63b844df4a295a64f37573e0ba08a7cc63659)
David Lamparter [Sat, 28 Jun 2014 18:22:55 +0000 (20:22 +0200)]
build: remove bogus/deprecated inet_* tests
These actually break configure on FreeBSD very subtly, because inet_aton
and __inet_aton are both detected, and then later other tests get
warnings about HAVE_INET_ATON being defined twice.
That said, they're incorrect to begin with since they detect alternative
functions but there is nothing in place to actually use these
alternates.
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 79f74962d20fa2c90df5a57335fc3b5e19bfeccf)
Amritha Nambiar [Wed, 28 Jan 2015 18:09:30 +0000 (18:09 +0000)]
isisd: match adjacency with source of hellos
isis_pdu.c: match adjacency with source of hellos,
check for source ID on receiving hello
If an adjacency exists, check the adjacency is with the
same router as the source of the hellos. In case a mismatch
is detected, bring down the adjacency and let the next
hellos trigger creating the new adjacency.
Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3c28aaf437d8d473adb89c5e74574a61a9ea7cc6)
Lu Feng [Thu, 8 Jan 2015 01:21:02 +0000 (01:21 +0000)]
isisd: fix crash on changing the circuit type of a passive interface
Signed-off-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 92cff4f7cd7e805e6689e73e63029aaccd145eca)
Lu Feng [Thu, 8 Jan 2015 01:39:18 +0000 (01:39 +0000)]
ospfd: set O-bit in the option of all DD packets
If opaque-capability is enabled, we must set the O-bit in
the option field of all DD packets. Changing the option
field of DD packets may cause the peer to reset the state
back to ExStart.
Signed-off-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 86ce951e349fd08d1ba2c66f5f6d07756689422a)
Fix tests/aspathtest.c again, this time by including a NEXT_HOP
attribute (which is out of correct order with AS_PATH, but that doesn't
matter here.) This satisfies bgp_attr_check(), which after 1a211cb
refuses updates without nexthop attribute.
Fixes: 1a211cb ("one more fix for tightening of check for missing well-known attributes") Cc: Paul Jakma <paul@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 143637198e333f0c822766b38f9d8cfe75c04e21)
Olivier Dugeon [Mon, 3 Nov 2014 13:59:06 +0000 (14:59 +0100)]
ospfd: Fix initial Opaque LSA DB synchronisation
ospfd has issues resynchronising its Opaque LSA DB with neighbours after restart
or interface events. The problem comes from opaque_lsa.c code that blocks
subsequent opaque LSA flooding until the neighbour router acknowledge that, and
removes the old opaque LSA from its LSDB. The bug comes from the fact that the
lock is never release, thus avoiding subsequent opaque LSA flooding.
More detail about the bugs and its solution is describeid in file
doc/te-link-params.md
LISTNODE_DETACH doesn't clear out the node, and LISTNODE_ATTACH doesn't
set ->next (since it assumes a fresh/zeroed listnode). As a result, the
new listnode_move_to_tail() created a nice circular list, in turn
crashing ospfd in ospf_write() later.
Reported-by: Martin Winter <mwinter@netdef.org> Fixes: 6d83113 ("ospfd: Tweak previous iface RR write patch to avoid free/malloc & redundant log") Cc: Paul Jakma <paul@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Dinesh Dutt <ddutt@cumulusnetworks.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
(cherry picked from commit 1c6db0d2da34044ddfb42665fda8a3387ecc451d)
David Lamparter [Mon, 8 Dec 2014 16:42:12 +0000 (17:42 +0100)]
bgpd: set BGP_ATTR_MP_[UN]REACH_NLRI (fixes 1a211cb)
Unfortunately, the attribute present bits for MP_REACH and MP_UNREACH
which 1a211cb ("bgpd: one more fix"...) tests for are never set in their
corresponding attribute parsing functions.
Reported-by: Martin Winter <mwinter@netdef.org> Fixes: 1a211cb "bgpd: one more fix for tightening of check for missing well-known attributes" Cc: Paul Jakma <paul@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit daefeb8755e194dd19a5f1910bc78d13c8147efb)
Greg Troxel [Tue, 2 Dec 2014 19:51:49 +0000 (14:51 -0500)]
zebra/kernel_socket.c: Use platform alignment
Use the platform-provided RT_ROUNDUP macro to align sockaddrs on the
routing socket, rather than using hard-coded assumptions about
alignment. Emit a warning if the OS doesn't define alignment macros.
Resolves failure of ripngd on NetBSD 6 i386, which changed alignment
to uint64_t from long.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit 88d37b902bc8127379d3293b9671aa6a11479c23)
David Lamparter [Thu, 30 Oct 2014 05:42:00 +0000 (06:42 +0100)]
tests: fix tests for 055086f (well-known attr check)
Fix tests/aspathtest.c by including an ORIGIN attribute in the
testcases. After 055086f "bgpd: well-known attr check only run for
v4/uni, which could cause a crash," we're now checking for it and tests
are failing due to that.
Note that test #11 ("4b AS4_PATH w/o AS_PATH") is no longer accepted as
OK since the function now checks for the existence of an AS_PATH attr.
Fixes: 055086f ("bgpd: well-known attr check only run for v4/uni"...) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit c68f6d9dbb9f910d3ee82e099655fff7c12ef856)
Vincent JARDIN [Mon, 27 Oct 2014 13:03:14 +0000 (13:03 +0000)]
Handy guidelines to contribute
Explain how to be a nice contributor in a handy way.
Signed-off-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
(cherry picked from commit f80ba04074f1211d857d08d6deddc41d029be1c7)
The one place this was being used in BGP is now gone,
can remove deprecated interface. Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit 3790eb0d3f0bbb24b9c6be97f547cec144ee05d1)
Yasuhiro Ohara [Thu, 17 Dec 2009 05:41:17 +0000 (05:41 +0000)]
Bug in ospf6_lsa_compare()
This fix is probably correct on 32bit systems,
but i think it will not work on 64bit systems.
sizeof(signed long) would be 8 and therefore the
cast from u_int32_t will map all the values to
non-negative part of long int.
You would like to use int (like in ospfd) and
change the type of seqnuma, seqnumb to that.
The type int32_t would be even more proper, but
sizeof(int) is 4 on relevant platforms.
Signed-off: Ondrej Zajicek <santiago@crfreenet.org> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Yasuhiro Ohara <yasu@jaist.ac.jp>
(cherry picked from commit bdd8cd70a042473477f9144c9cedb8dde11ba2c1)
Joakim Tjernlund [Thu, 26 Nov 2009 12:23:07 +0000 (12:23 +0000)]
ospfd: invalid MD5 auth_key?
This looks fishy in ospf_make_md5_digest()
if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt)))
auth_key = (const u_int8_t *) "";
...
MD5Update(&ctx, auth_key, OSPF_AUTH_MD5_SIZE);
auth_key points to a "" string of len 1 which is a lot
smaller that OSPF_AUTH_MD5_SIZE. Is this intentional to
get some random data or just a plain bug?
Anyone using MD5 should have a closer look and decide
what to do. Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit ea2a598411cc7bd20456849e56bbc9e93c9916e7)
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.
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.
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)
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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:
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>
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
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>
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>
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>