summaryrefslogtreecommitdiffstats
path: root/ripd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: split & distribute memtypes and stop (re|ab)using lib/ MTYPEsDavid Lamparter2016-09-194-0/+75
| | | | | | | | | | | | | | | | | | | This is a rather large mechanical commit that splits up the memory types defined in lib/memtypes.c and distributes them into *_memory.[ch] files in the individual daemons. The zebra change is slightly annoying because there is no nice place to put the #include "zebra_memory.h" statement. bgpd, ospf6d, isisd and some tests were reusing MTYPEs defined in the library for its own use. This is bad practice and would break when the memtype are made static. Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> [CF: rebased for cmaster-next] Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* lib: migrate to new memory-type handlingDavid Lamparter2016-09-191-0/+1
| | | | | | | | | Move over to the new allocation counting added in the previous commit. (This commit is mostly mechanical.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
* Merge remote-tracking branch 'origin/cmaster' into cmaster-nextDonald Sharp2016-08-191-1/+3
|\
| * Fix for CM-12450 Ensure quagga logs at startup are sent to syslog (until log ↵Sid Khot2016-08-181-1/+3
| | | | | | | | | | | | | | | | configuration is processed) Ticket: CM-12450 Reviewed By: CCR-5112 Testing Done: Manual
* | *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-183-10/+10
| | | | | | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* | lib: fix setting of IPv4 multicast sockopts on OpenBSDRenato Westphal2016-08-081-2/+8
|/ | | | | | | | | | | | OpenBSD doesn't support the "ifindex hack" derived from RFC 1724 which allows an ifindex to be encoded in the imr_interface field (in_addr) of the ip_mreq structure. OpenBSD also doesn't support the RFC3678 Protocol-Independent socket API extensions, which allows an interface to be specified by its ifindex. With that said, in OpenBSD we still need to specify an interface by its IP address. This patch adds an exception in the multicast sockopt functions to handle this case. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: snmp: add a load of "static" specifiersDavid Lamparter2016-07-281-3/+3
| | | | | | | Make it easier to see which bits in *_snmp.c are actually referenced from non-SNMP parts of the code. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* all: add default log file if none are definedDon Slice2016-07-111-1/+2
| | | | | | | | | | | | Added a default log file named /var/log/quagga/Quagga.log to every daemon to capture log entries if no log file is defined. This also allows the capture of logged information prior to reading each daemon's config file. If a log file is defined manually, it will override this default file name. Ticket: CM-10987 Signed-off-by: Don Slice Reviewed By: Donald Sharp Testing Done: Manual testing
* Quagga: Fix code to use srandom/randomDonald Sharp2016-05-301-2/+2
| | | | | | | | Quagga was using a mix of srand/rand and srandom/random. Consolidate to use srandom/random which are the POSIX versions of random number generators Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* build: get rid of INCLUDES, use AM_CPPFLAGSDavid Lamparter2016-06-031-1/+1
| | | | | | | | | | | | | 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)
* ripd: allow to enable/disable the ECMP featureLu Feng2016-05-263-5/+102
| | | | | | | | | | | | | | | | | | | | | | | 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)
* ripd: add ECMP supportLu Feng2016-05-264-357/+442
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* snmp: fix warningsDavid Lamparter2016-05-261-3/+3
| | | | | | | batch-fix all warnings that come up when enabling AgentX SNMP support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit dfee58f1d41a2e36c7f5f38a3ef5712224131824)
* make some structures constant.Stephen Hemminger2016-05-261-1/+1
| | | | | | | | These pre-initialized arrays are not modified. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Feng Lu <lu.feng@6wind.com> (cherry picked from commit 88d37b902bc8127379d3293b9671aa6a11479c23)
* ripd: use only one constant for derivationLu Feng2016-05-262-2/+2
| | | | | | | | | | | | 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)
* build: Remove the old PIC/PIE patch, let libtool sort it outPaul Jakma2016-05-261-2/+1
| | | | | | | * 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.
* lib: refactor connected_lookup_prefixDonald Sharp2016-05-121-9/+14
| | | | | | | | | | | The connected_lookup_address function should really be a connected_lookup_prefix function. Refactor the code to use it. Ticket: CM-10890 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* quagga: Fixup startup to allow consistency between sysV and systemdDonald Sharp2016-04-271-4/+0
| | | | | | | | | | | | | | | | | | | We want the ability to start up quagga in a varied set of environments. This needs to be done in SysV and systemd startups. As such refactor the code to allow us to allow end users to easily switch between the two sysV: edit the /etc/quagga/daemons file service quagga [start|stop|reload|restart] Systemd: edit the /etc/quagga/daemons file systemctl [start|stop|reload|restart] quagga Ticket: CM-10634 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* quagga: Remove iflist global variableDonald Sharp2016-04-082-13/+15
| | | | | | | | | | | | | | | The file if.c has a iflist that had the list of interfaces in the default vrf. Remove this variable and replace with a vrf_iflist lookup on the default vrf where it was used. Additionally, modify ptm code to iterate over all vrf's when enabling ptm. Ticket: CM-10338 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
* ripd, isisd: fix warnings that make the build failChristian Franke2016-03-301-1/+1
| | | | | | | | | | | These issues have been found by running buildtest.sh using GCC 5.2.0 and Clang 3.7.0 Fixes pointer checks that can never be null Signed-off-by: Christian Franke <chris@opensourcerouting.org> Tested-by: NetDEF CI System <cisystem@netdef.org> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* quagga: delete interface from default table when moved to vrfDon Slice2016-03-181-1/+4
| | | | | | | | | | All daemons changed to flag an interface that has been moved to a vrf as DELETED instead of INTERNAL. When they were flagged as IFINDEX_INTERNAL, ospf, rip, and isis would re-install them in the default assuming that they were being "pre-defined" before the kernel definitions. Ticket: CM-9265 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
* Quagga: Support VRF unregister for clientsvivek2016-02-121-1/+1
| | | | | | | | | | | | | Clients (BGP, OSPF etc.) register with Zebra for information about a VRF such as Router ID, interfaces and redistribution. Add API to support unregister also which is required for the non-default VRF. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-9128 Reviewed By: CCR-4098 Testing Done: Manual testing
* quagga: remove babelDaniel Walton2016-02-111-1/+0
| | | | | | | | Ticket: CM-9274 Reviewed By: sharpd@cumulusnetworks.com Testing Done: <DETAILED DESCRIPTION (REPLACE)>
* ripd: Fix crash when a default route is passed to ripDonald Sharp2016-02-111-1/+4
| | | | | | | | | | | | | When rip is not configured and zebra decides to send a default route to it, check to make sure that rip is configured before accepting anything from zebra. Ticket: CM-9270 Reviewed-by: Don Slice Tested: OSPF test case that was erroring out no longer happens Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Modify protocols to have systemd integrationDonald Sharp2016-02-101-0/+4
| | | | | | | | Modify the daemons to integrate with systemd, if it is enabled via configure, and to notify systemd that they are running/stopping and to send watch notifications. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Quagga: vrf_id not being set correctlyDonald Sharp2015-11-201-1/+2
| | | | | | | | | | | | | | | Several routing protocols use the zapi_ipv[4|6] api to talk to zebra. There are some instances where the api.vrf_id was not being set. Since the practice is to declare the api structure on the stack, the data inside is not being set to 0. As such random vrf_id values were being passed to zebrad causing rage and confusion. Ticket: CM-8287 Reviewed-by: CCR-3841 Testing: Test suites no longer crashing and burning Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: add VRF ID in the API message headerFeng Lu2015-11-043-38/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API messages are used by zebra to exchange the interfaces, addresses, routes and router-id information with its clients. To distinguish which VRF the information belongs to, a new field "VRF ID" is added in the message header. And hence the message version is increased to 3. * The new field "VRF ID" in the message header: Length (2 bytes) Marker (1 byte) Version (1 byte) VRF ID (2 bytes, newly added) Command (2 bytes) - Client side: - zclient_create_header() adds the VRF ID in the message header. - zclient_read() extracts and validates the VRF ID from the header, and passes the VRF ID to the callback functions registered to the API messages. - All relative functions are appended with a new parameter "vrf_id", including all the callback functions. - "vrf_id" is also added to "struct zapi_ipv4" and "struct zapi_ipv6". Clients need to correctly set the VRF ID when using the API functions zapi_ipv4_route() and zapi_ipv6_route(). - Till now all messages sent from a client have the default VRF ID "0" in the header. - The HELLO message is special, which is used as the heart-beat of a client, and has no relation with VRF. The VRF ID in the HELLO message header will always be 0 and ignored by zebra. - Zebra side: - zserv_create_header() adds the VRF ID in the message header. - zebra_client_read() extracts and validates the VRF ID from the header, and passes the VRF ID to the functions which process the received messages. - All relative functions are appended with a new parameter "vrf_id". * Suppress the messages in a VRF which a client does not care: Some clients may not care about the information in the VRF X, and zebra should not send the messages in the VRF X to those clients. Extra flags are used to indicate which VRF is registered by a client, and a new message ZEBRA_VRF_UNREGISTER is introduced to let a client can unregister a VRF when it does not need any information in that VRF. A client sends any message other than ZEBRA_VRF_UNREGISTER in a VRF will automatically register to that VRF. - lib/vrf: A new utility "VRF bit-map" is provided to manage the flags for VRFs, one bit per VRF ID. - Use vrf_bitmap_init()/vrf_bitmap_free() to initialize/free a bit-map; - Use vrf_bitmap_set()/vrf_bitmap_unset() to set/unset a flag in the given bit-map, corresponding to the given VRF ID; - Use vrf_bitmap_check() to test whether the flag, in the given bit-map and for the given VRF ID, is set. - Client side: - In "struct zclient", the following flags are changed from "u_char" to "vrf_bitmap_t": redist[ZEBRA_ROUTE_MAX] default_information These flags are extended for each VRF, and controlled by the clients themselves (or with the help of zclient_redistribute() and zclient_redistribute_default()). - Zebra side: - In "struct zserv", the following flags are changed from "u_char" to "vrf_bitmap_t": redist[ZEBRA_ROUTE_MAX] redist_default ifinfo ridinfo These flags are extended for each VRF, as the VRF registration flags. They are maintained on receiving a ZEBRA_XXX_ADD or ZEBRA_XXX_DELETE message. When sending an interface/address/route/router-id message in a VRF to a client, if the corresponding VRF registration flag is not set, this message will not be dropped by zebra. - A new function zread_vrf_unregister() is introduced to process the new command ZEBRA_VRF_UNREGISTER. All the VRF registration flags are cleared for the requested VRF. Those clients, who support only the default VRF, will never receive a message in a non-default VRF, thanks to the filter in zebra. * New callback for the event of successful connection to zebra: - zclient_start() is splitted, keeping only the code of connecting to zebra. - Now zclient_init()=>zclient_connect()=>zclient_start() operations are purely dealing with the connection to zbera. - Once zebra is successfully connected, at the end of zclient_start(), a new callback is used to inform the client about connection. - Till now, in the callback of connect-to-zebra event, all clients send messages to zebra to request the router-id/interface/routes information in the default VRF. Of corse in future the client can do anything it wants in this callback. For example, it may send requests for both default VRF and some non-default VRFs. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> Conflicts: lib/zclient.h lib/zebra.h zebra/zserv.c zebra/zserv.h Conflicts: bgpd/bgp_nexthop.c bgpd/bgp_nht.c bgpd/bgp_zebra.c isisd/isis_zebra.c lib/zclient.c lib/zclient.h lib/zebra.h nhrpd/nhrp_interface.c nhrpd/nhrp_route.c nhrpd/nhrpd.h ospf6d/ospf6_zebra.c ospf6d/ospf6_zebra.h ospfd/ospf_vty.c ospfd/ospf_zebra.c pimd/pim_zebra.c pimd/pim_zlookup.c ripd/rip_zebra.c ripngd/ripng_zebra.c zebra/redistribute.c zebra/rt_netlink.c zebra/zebra_rnh.c zebra/zebra_rnh.h zebra/zserv.c zebra/zserv.h
* *: call if_init()/if_terminate() from vrf_init()/vrf_terminate()Feng Lu2015-10-302-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Later, an interface will belong to a specific VRF, and the interface initialization will be a part of the VRF initialization. So now call if_init() from vrf_init(), and if_terminate() from vrf_terminate(). Daemons have the according changes: - if if_init() was called or "iflist" was initialized, now call vrf_init() instead; - if if_terminate() was called or "iflist" was destroyed, now call vrf_terminate() instead. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Conflicts: bgpd/bgp_main.c pimd/pim_iface.c pimd/pim_iface.h pimd/pim_main.c pimd/pimd.c
* Zebra: Make redistribute do replace instead of del/add for better convergencevivek2015-10-211-2/+4
| | | | | | | | | | | | | | | | | | | Ticket: CM-6768 Reviewed By: CCR-3207 Testing Done: bgpsmoke, smoke, topo to create failure Redistributing routes goes through a del/add cycle whenever a redistributed is updated. This del/add cycle causes disruption by causing traffic loss for brief/long periods of time(6-8 s in case of OSPF). The modifications in this patch remove the del/add cycle to ensure that this disruption doesn't happen. Also fixed sending no forwarding address when announcing IPv4 routes with IPv6 nexthops, and sending nexthop only when there is a single path. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* quagga: Additional centos 6 -enable-werror fixesDonald Sharp2015-09-291-1/+2
| | | | | | | | | This commit fixes these warnings: 1) bgpd/bgp_nexthop.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>
* lib: zclient.c remove extern struct thread_master *Donald Sharp2015-09-233-4/+4
| | | | | | | | | | | | zclient.c depended upon link time inclusion of a extern struct thread_master *master. This is a violation of the namespace of the calling daemon. If a library needs the pointer pass it in and save it for future use. This code change also makes the zclient code consistent with the other lib functions that need to schedule work on your behalf Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Zebra: Add IPv6 protocol filtering support & Setting Src of IPv6 routesDinesh G Dutt2015-09-162-5/+5
| | | | | | | | | | | | | | | | | | Ticket: Reviewed By: CCR-3335 Testing Done: bgpsmoke, ENHE tests etc. Add support for filtering routes from upper layer protocols to zebra via route-maps for IPv6. The same functionality already existed for IPv4. In addition, add support for setting source of routes via IPv6 protocol map. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkataraman <vivek@cumulusnetworks.com> Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
* Add --enable-werror to configureDonald Sharp2015-07-261-1/+1
|
* Some more missing changesDonald Sharp2015-07-221-1/+1
|
* Fixup of some last remaining differences between stg and gitDonald Sharp2015-07-221-1/+1
|
* When a route-map configuration is used to set the nexthop to a value, makeDonald Sharp2015-06-111-0/+7
| | | | | | sure that the value is acceptable. For example, if the route-map is setting the IPv6 link-local nexthop, make sure the value is an IPv6 link-local address.
* ripd: ripd-warnings.patchDonald Sharp2015-05-202-15/+2
| | | | | | Remove compile warnings for the ripd directory Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by:
* Per AFI redist registrationsDonald Sharp2015-05-201-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | The problem is that zclient->redist[ZEBRA_ROUTE_MAX] used for storing a client’s redist state, has no address-family qualification. This means a client can only store its interest in a protocol (connected, static etc.), but cant choose IPv4 or ipv6 with that. This hindered implementation on client sides to manage redistribution of ipv4 and ipv6 both. BGP's redistribution of protocols like connected/static is one such place. One fix could be to overload this and flap the redist connection each time any new afi is added for redist, but that may have side-effects on the existing afi redist. The cleaner way is to modify redist data-structure to also take AFI, and adjust routines that deal with it, so that a client can register for a protocol redistribution based on the AFI. BGP already maintains redistribution state based on afi and protocol (bgp->redist[AFI_MAX][ZEBRA_ROUTE_MAX]). This patch takes care of filling up the gap in zclient/zserv redistribution state to also use AFI qualification. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
* Multi-Instance OSPF SummaryDonald Sharp2015-05-202-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ——————————————------------- - etc/init.d/quagga is modified to support creating separate ospf daemon process for each instance. Each individual instance is monitored by watchquagga just like any protocol daemons.(requires initd-mi.patch). - Vtysh is modified to able to connect to multiple daemons of the same protocol (supported for OSPF only for now). - ospfd is modified to remember the Instance-ID that its invoked with. For the entire life of the process it caters to any command request that matches that instance-ID (unless its a non instance specific command). Routes/messages to zebra are tagged with instance-ID. - zebra route/redistribute mechanisms are modified to work with [protocol type + instance-id] - bgpd now has ability to have multiple instance specific redistribution for a protocol (OSPF only supported/tested for now). - zlog ability to display instance-id besides the protocol/daemon name. - Changes in other daemons are to because of the needed integration with some of the modified APIs/routines. (Didn’t prefer replicating too many separate instance specific APIs.) - config/show/debug commands are modified to take instance-id argument as appropriate. Guidelines to start using multi-instance ospf --------------------------------------------- The patch is backward compatible, i.e for any previous way of single ospf deamon(router ospf <cr>) will continue to work as is, including all the show commands etc. To enable multiple instances, do the following: 1. service quagga stop 2. Modify /etc/quagga/daemons to add instance-ids of each desired instance in the following format: ospfd=“yes" ospfd_instances="1,2,3" assuming you want to enable 3 instances with those instance ids. 3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf and ospfd-3.conf. 4. service quagga start/restart 5. Verify that the deamons are started as expected. You should see ospfd started with -n <instance-id> option. ps –ef | grep quagga With that /var/run/quagga/ should have ospfd-<instance-id>.pid and ospfd-<instance-id>/vty to each instance. 6. vtysh to work with instances as you would with any other deamons. 7. Overall most quagga semantics are the same working with the instance deamon, like it is for any other daemon. NOTE: To safeguard against errors leading to too many processes getting invoked, a hard limit on number of instance-ids is in place, currently its 5. Allowed instance-id range is <1-65535> Once daemons are up, show running from vtysh should show the instance-id of each daemon as 'router ospf <instance-id>’ (without needing explicit configuration) Instance-id can not be changed via vtysh, other router ospf configuration is allowed as before. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
* 'set metric -12' is broken in the parserDonald Sharp2015-05-201-8/+8
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* Add support for route tagsDonald Sharp2015-05-201-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Credit ------ A huge amount of credit for this patch goes to Piotr Chytla for their 'route tags support' patch that was submitted to quagga-dev in June 2007. Documentation ------------- All ipv4 and ipv6 static route commands now have a "tag" option which allows the user to set a tag between 1 and 65535. quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag ? <1-65535> Tag value quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag 40 quagga(config)# quagga# show ip route 1.1.1.1/32 Routing entry for 1.1.1.1/32 Known via "static", distance 1, metric 0, tag 40, best * 10.1.1.1, via swp1 quagga# The route-map parser supports matching on tags and setting tags ! route-map MATCH_TAG_18 permit 10 match tag 18 ! ! route-map SET_TAG_22 permit 10 set tag 22 ! BGP and OSPF support: - matching on tags when redistribing routes from the RIB into BGP/OSPF. - setting tags when redistribing routes from the RIB into BGP/OSPF. BGP also supports setting a tag via a table-map, when installing BGP routes into the RIB. Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* Fix "no set metric" for ospf6 and RIPDonald Sharp2015-05-201-2/+10
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* ripd: use only one constant for derivationLu Feng2014-07-022-2/+2
| | | | | | | | | | | 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>
* *: nuke ^L (page feed)David Lamparter2014-06-048-36/+36
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd & ripngd: avoid the zero interface metricLu Feng2014-06-031-1/+1
| | | | | | | | | | | The interface metric is initialized to 0 in the commit db19c85: zebra: set metric for directly connected routes via netlink to 0 Ripd and ripngd must be aware of it and avoid increase the route metric by 0. Signed-off-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/command.c: rewrite command matching/parsingChristian Franke2014-04-011-3/+0
| | | | | | | | | | Add support for keyword commands. Includes new documentation for DEFUN() in lib/command.h, for preexisting features as well as new keyword specification. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd: correctly redistribute ifindex routes (BZ#664)David Lamparter2013-04-091-2/+3
| | | | | | | | | | | | | ripd had a check to restrict metric 0 to only directly connected routes. This check was implemented by checking against Connected as route type. This is, however, incorrect -- all routes that directly use an interface without a nexthop should be treated as directly connected and passed off with metric 0. ripngd does not posess such a check and was not touched. Reported-by: Sean Fulton <sean@gcnpublishing.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use array_size() helper macroBalaji.G2012-10-251-1/+1
| | | | | | | | Use the array_size() helper macro. Replaces several instances of local macros with the same definition. Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd: clear sockaddr_in before usingNick Hilliard2012-09-251-0/+1
| | | | | | | | | ripd_create_socket() failed in bind() on Mac OS X 10.7 since there was garbage in unused fields of struct sockaddr_in. * ripd/ripd.c: zero out struct sockaddr_sin from before filling. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* snmp: let handlers accept OID from a lesser prefixVincent Bernat2012-06-251-0/+12
| | | | | | | | | Most table handlers do not expect to be given an OID whose prefix is outside what they can handle. This is not a problem with the SMUX implementation since it always correct the OID such that the prefix matches. However, this is not the case for the AgentX implementation. A new function, smux_header_table() is used to do this normalization.