summaryrefslogtreecommitdiffstats
path: root/isisd
Commit message (Collapse)AuthorAgeFilesLines
* quagga: Remove double read of streamDonald Sharp2016-03-111-1/+3
| | | | | | | | | | The addition of a MIN(X,Y) with a stream_getc in the Y causes a double read of the stream due to the way that MIN is defined. This fix removes a crash in all protocols. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: Check prefix length from zebra is sensiblePaul Jakma2016-03-081-1/+1
| | | | | | | | | | | | | * zclient.c: prefix length on router-id and interface address add messages not sanity checked. fix. * */*_zebra.c: Prefix length on zebra route read was not checked, and clients use it to write to storage. An evil zebra could overflow client structures by sending overly long prefixlen. Prompted by discussions with: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-02-263-11/+11
|
* lib, zebra: unify link layer type and hardware address handlingTimo Teräs2016-02-261-10/+0
| | | | | | | | | | | | | | | | This removes the BSD specific usage of struct sockaddr_dl hardware address. This unifies to use explict hw_addr member for the address, and zebra specific enumeration for the link layer type. Additionally the zapi is updated to never send platform specific structures over the wire, but the ll_type along with hw_addr_len and hw_addr are now sent for all platforms. Based on initial work by Paul Jakma. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd, lib: Fix some more compiler warningsDonald Sharp2015-12-081-0/+2
| | | | | | | A couple compiler warnings snuck in from the last round of work being looked at. This cleans them up Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: make send_lsp more robustChristian Franke2015-12-084-48/+114
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Tested-by: NetDEF CI System <cisystem@netdef.org>
* isisd: fix misleading wording in logChristian Franke2015-12-081-5/+5
| | | | | | | | | The changed messages are actually located before transmission is attempted. Therefore, the tense is somewhat misleading, especially since transmission may not always succeed. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: handle lsp confusion (ISO/IEC 10589:2002 7.3.16.2)Christian Franke2015-12-082-6/+40
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: fix IPv6 mask applicationChristian Franke2015-12-081-5/+5
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: show interface's ipv6 addresesChristian Franke2015-12-081-3/+23
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: provide more detailed log for failed address removalChristian Franke2015-12-081-0/+20
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: add support to import routes from other protocolsChristian Franke2015-12-0813-108/+1667
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: fix assertion in LSP refresh timer calculationChristian Franke2015-12-081-1/+4
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: add a slight delay to lsp_regenerate_scheduleChristian Franke2015-12-085-35/+169
| | | | | | | | | | | | | | | | | | | | | | | isisd implements a holdoff interval and will refrain from regenerating an lsp if the difference between the current time and its last refresh is less than the holdoff interval. Instead, it will schedule a timer to regenerate the lsp after the holdoff interval has passed. This implementation has one disadvantage in the case where there is a succession of calls to lsp_regenerate_schedule. In such a case, the first call will trigger an immediate regeneration of the lsp, while the other calls will only schedule the regeneration timer. This leads to cases where it takes holdoff interval time for information to propagate, just because the information was only available e.g. at the second call of lsp_regenerate_schedule in such a succession of calls. By not immediately regenerating an lsp if the last generation time is sufficiently long ago, but instead scheduling the regeneration with a very small delay, we allow all information from such a succession of calls to be considered. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: add a debug mode that traces LSP constructionChristian Franke2015-12-083-5/+158
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: purge on correct levelChristian Franke2015-12-083-5/+6
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: allow to adjust lsp-mtuChristian Franke2015-12-088-63/+172
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: initialize circuit to match area is_typeChristian Franke2015-12-082-6/+20
| | | | | | | | | New circuits should be initialized to match the is_type of their area. Also add an additional check to make sure that no IIHs are sent for levels which are not enabled. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: do remove ipv6 routes from ZebraChristian Franke2015-12-081-1/+1
| | | | | | | | | | We can abort isis_zebra_route_del_ipv6 if the route in question has ISIS_ROUTE_FLAG_ZEBRA_SYNCED unset, meaning it's not in the kernel. Aborting the function if the flag is set prevents us from removing any routes. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: don't corrupt memory for long hostnamesChristian Franke2015-12-082-3/+12
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: fix a typo in a log messageChristian Franke2015-12-081-1/+1
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: remove superfluous checks after XMALLOC etc.Christian Franke2015-12-083-30/+1
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: annotate some function arguments with constChristian Franke2015-12-087-28/+28
| | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd, isisd: fix warnings that make the build failChristian Franke2015-12-081-3/+3
| | | | | | | | | | | 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>
* Merge 'patch-tracking/4/proposed/netdef-solaris' into acceptedPaul Jakma2015-10-285-14/+19
|\
| * isisd/isis_dlpi: Fix warningDavid Lamparter2015-10-161-1/+1
| | | | | | | | | | | | 'fd' may be used uninitialized. Init to -1 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * isisd/solaris: fix size_t confusionsDavid Lamparter2015-10-161-11/+12
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: make sure zebra.h is always included firstDavid Lamparter2015-10-164-2/+6
| | | | | | | | | | | | | | | | zebra.h pulls in config.h, which results in fiddling with things like __FILE_OFFSET_BITS. It must always be included first, in order to set flags that influence the compiler via <features.h>. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | isisd: Fix LSPs not being regenerated after adjacency changeMichael Zingg2015-10-271-1/+12
| | | | | | | | | | | | | | | | | | | | In isisd LSP's are not regenerated after a change in adjacency if lsp-gen-interval has expired. I have tested this on Debian 6.0 with zebra and level1 isisd with point to point links. This problem is also listed in Test ISIS-18.3 on the opensourcerouting.org wiki: http://confluence.isc.org/display/osr/ANVL+ISIS+Compliance+Test+Plan http://confluence.isc.org/display/osr/ANVL+ISIS+Results
* | isisd: Drop packet received on multiple interfaces due to the time gap in ↵Amritha Nambiar2015-10-271-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | binding socket to an interface Due to the time window between opening socket and binding it to an interface, the same hello packet is delivered on multiple interfaces, unique socket per circuit is not yet established. When such hellos get processed, they form incorrect adjacencies. So, drop the packet that is received on multiple interfaces because the socket for the circuit is yet to bind to an interface. V2: Fix warning on sign comparison Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
* | lib: zclient.c remove extern struct thread_master *Donald Sharp2015-10-273-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>
* build: Remove the old PIC/PIE patch, let libtool sort it outPaul Jakma2015-09-031-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.
* isisd: Attached-bit in LSP headerAmritha Nambiar2015-09-033-11/+60
| | | | | | | | | | | | | | | | | | | | | | | | Set/reset attached-bit in LSP header: This patch provides support for set/reset attached_bit in the LSP header. In IS-IS networks, routing inter-area traffic from L1 areas is accomplished by sending the traffic to the nearest L1/L2 router. A L1/L2 router identifies itself by setting an attach-bit (ATT-bit) in its (LSP). The ATT-bit in LSP can be changed using the set-attached-bit or no-set-attached-bit commands (similar to ‘set-overload-bit’ and 'no set-overload-bit’) using telnet terminal in router configuration mode. Steps: enable configure terminal router isis <Routing area> set-attached-bit V2: Removed looping through area list as this well set the bit for all areas in the list. This implementation now looks exactly like the current overload bit implementation. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
* isisd: Add new adjacency to LSP neighbor listAmritha Nambiar2015-09-031-1/+7
| | | | | | | | | | | | | | | | | | 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>
* Quagga: Fix code to use srandom/randomDonald Sharp2015-06-212-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>
* *: add VRF ID in the API message headerFeng Lu2015-06-031-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* *: call if_init()/if_terminate() from vrf_init()/vrf_terminate()Feng Lu2015-06-022-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>
* isisd: always print adj->sysid (clang 3.6 warning)David Lamparter2015-05-271-7/+1
| | | | | | | | | | | As any new compiler version, clang 3.6 has new warnings, one of these being that it now warns for testing whether the address of an array will be true. Of course there is no point in this check for the sysid, so let's always just print the sysid. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix crash on processing own p2p helloAmritha Nambiar2015-05-051-0/+11
| | | | | | | | | | | | | | 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>
* build: add --enable-werrorDavid Lamparter2015-04-211-1/+1
| | | | | | | | | | | | | | | This allows enabling -Werror in a consistent way. Note that this is different from just specifiying it in CFLAGS, since that would either break configure tests (if done on ./configure), or would override configure's CFLAGS (if done on make). Using --enable-werror instead provides a new WERROR variable that is additionally used during make with a consistent set of warning flags. The tests/ directory is exempt. (Rationale being, better to have more tests than pedantically complain about them.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra, isisd: cast to unsigned char for ctypesDavid Lamparter2015-04-211-1/+1
| | | | | | | | ctype.h macros take int as arguments, but expect arguments to be in unsigned char's range. Even though it probably works, this isn't correct on systems that have a signed char type. Cast explicitly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: remove unused process_is_hello()David Lamparter2015-04-211-83/+0
| | | | | | | The code uses process_lan_hello() or process_p2p_hello(). The unused process_is_hello() seems to be a leftover generic version. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix size_t confusionsDavid Lamparter2015-04-211-8/+6
| | | | | | | isisd had a few places that mixed up size_t vs. unsigned long, and %zd vs. %ld. Clean out. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: assorted fixes (unused variables, static)David Lamparter2015-04-215-13/+8
| | | | | | This just mops up a few warnings in isisd. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: fix minor & vs. && mix-upDavid Lamparter2015-04-211-1/+1
| | | | | | apparently we were displaying all IPv6 reachabilities as external. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: don't use POSIX reserved y1/yn namesDavid Lamparter2015-04-211-12/+12
| | | | | | | y1 and yn are POSIX standard names for Bessel functions. For consistency, just rename all of these variables from "y" to "yy". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add missing includesDavid Lamparter2015-04-211-0/+2
| | | | | | | Some places, particularly headers, were spewing warnings since they don't include neccessary other headers to get struct/enum definitions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix signedness mix-upsDavid Lamparter2015-04-214-10/+11
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: remove stray extra semicolonsDavid Lamparter2015-04-211-4/+4
| | | | | | Some places had extra semicolons where none belong. Remove them. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use void * for printing pointersDavid Lamparter2015-04-211-2/+2
| | | | | | | | | On higher warning levels, compilers expect %p printf arguments to be void *. Since format string / argument warnings can be useful otherwise, let's get rid of this noise by sprinkling casts to void * over printf calls. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>