summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/cli: reduce strcmp in CLI hot pathsDavid Lamparter2015-05-052-136/+174
| | | | | | | | | | | | Er, no idea how anyone could ever have thought that it would be a good idea to have a zillion of strcmp() calls in the CLI's active paths, just to compare against things like "A.B.C.D". Reduces 40k prefix list load time from 1.65s to 1.23s (1.34:1). Acked-by: Paul Jakma <paul@jakma.org> [v2: killed CMDS_* macros] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: constify sockunion apiTimo Teräs2015-05-052-18/+18
| | | | | | | Add const to read-only api calls. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix rtadv check for non-glibc linuxTimo Teräs2015-05-051-1/+1
| | | | | | | Default RTADV enabled for non-glibc linux (fixes check for musl libc). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix build with rtadv disabledTimo Teräs2015-05-051-1/+2
| | | | | | | | Otherwise we get warning on rtadv_init() prototype not being defined when compiling rtadv.c (as dummy stub is provided always). Signed-off-by: Timo Teräs <timo.teras@iki.fi> 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>
* HACKING: Use space char for indentation.Paul Jakma2015-04-271-17/+6
| | | | | | | * HACKING.tex: Whitespace/indent section is probably out of date. Rephrase. Remove the editor recommendations, as I don't know what would be correct. Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
* HACKING: Fix spelling mistakesPaul Jakma2015-04-271-10/+10
| | | | Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
* gdb: Add a directory of files with gdb macrosPaul Jakma2015-04-262-0/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | * gdb/: Directory to contain files with GDB macros. Organised by topic into separate files. * gdb/lib.txt: General OS API and Quagga lib macros: (def_ntohs) convert big-endian short to host order. (def_ntohl) convert big-endian long to host order. (walk_route_table_next) Walk to next route_node in a table, according to given top and current node arguments. (walk_route_table) walk the given route table dumping non-null info pointers, from the given root node. (dump_timeval) timeval to human readable output (dump_s_addr) Print IP address of given pointer to a (struct in_addr).s_addr (dump_s6_addr) Ditto for IPv6. (dump_prefix4) Dump a Quagga (struct prefix_ipv4 *) (dump_prefix6) Dump (struct prefix_ipv6 *) (dump_prefix) Dump a (struct prefix *). (rn_next_{down,up}) left-down and up-and-right walks of a route_table from a given route_node. * gdb/ospfd.txt: ospfd specific gdb macros, depends on gdb/lib.txt (dump_ospf_lsa_flags) LSA flags to text. (dump_ospf_lsa_data) dump the data of a (struct lsa_header *) argument. (dump_ospf_lsa) Dump the details of a (struct ospf_lsa *) (walk_ospf_lsdb) Go through an LSDB, rooted at the given (struct route_node *), and dump LSA details. (ospf_backbone_lsdb_top) Get the LSDB top pointer for the given LSA type.
* Merge branch 'volatile/fix_warnings'David Lamparter2015-04-23109-742/+554
|\ | | | | | | | | | | Thanks to Donald Sharp and Greg Troxel for providing feedback! Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: assorted warning fixesDavid Lamparter2015-04-212-2/+3
| | | | | | | | | | | | A few warnings slipped through the cracks... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: fix NetBSD interface stats printfDavid Lamparter2015-04-211-18/+23
| | | | | | | | | | | | | | | | | | "format '%qu' expects type 'long long unsigned int', but argument 3 has type '__uint64_t'" Move to %llu, which is more standard. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: fix more initialisers (for BSD)David Lamparter2015-04-213-5/+5
| | | | | | | | | | | | | | FreeBSD and NetBSD spew a few more warnings about variable initialisers. Found with OSR's/NetDEF's fancy new CI system. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * tests: fix warningsDavid Lamparter2015-04-2113-48/+53
| | | | | | | | | | | | | | While I don't see -Werror being used on tests anytime soon, there's no reason to keep the warnings in tests unfixed. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: silence zebra_serv_un unused warningDavid Lamparter2015-04-211-1/+2
| | | | | | | | | | | | zebra_serv_un() is unused if --enable-tcp-zebra is given. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pimd: fix out of tree buildDavid Lamparter2015-04-211-1/+1
| | | | | | | | | | | | | | 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>
| * build: add --enable-werrorDavid Lamparter2015-04-2115-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * build: determine CFLAGS more intelligentlyDavid Lamparter2015-04-211-47/+59
| | | | | | | | | | | | | | Instead of hardcoding some compiler detection, this just checks which CFLAGS actually work with the compiler specified by the user. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: drop unused static variableDavid Lamparter2015-04-211-1/+0
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix SNMP write supportDavid Lamparter2015-04-211-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This code - dating back to the initial import in 2002 - probably never worked. Calling asn_parse_int seems to always have been wrong, and in the meantime, there no longer is a "struct variable *" argument for write_method. If anyone tried to use it, it'd probably have crashed. (I didn't try.) Fix this up so it actually works. It's the only place in Quagga where a SNMP write is actually supported, so it's an odd one out anyway, but heh. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * snmp: fix warningsDavid Lamparter2015-04-215-14/+13
| | | | | | | | | | | | batch-fix all warnings that come up when enabling AgentX SNMP support. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: drop unused variables & RETSIGTYPEDavid Lamparter2015-04-213-18/+8
| | | | | | | | | | | | | | | | | | Drop unused return values in vtysh. Also gets rid of the rather funny prototyping of signal setup in vtysh - which as a side effect makes it not need AC_TYPE_SIGNAL in configure.ac anymore. It wasn't used sensibly to begin with... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: fix function prototypesDavid Lamparter2015-04-215-24/+29
| | | | | | | | | | | | | | This makes a whole bunch of vtysh functions static, fixes prototypes for a few more, and masks user_free() and user_write_config() (both unused.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: don't use '\0' as NULLDavid Lamparter2015-04-212-6/+6
| | | | | | | | | | | | for some reason, the vty code was using '\0' in place of NULL. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: fix pointer arithmetic warningDavid Lamparter2015-04-211-3/+3
| | | | | | | | | | | | | | caddr_t was signed; this buffer size comparison is better done in unsigned. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: oi->cost is uint32, not shortDavid Lamparter2015-04-211-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ospf6d: use existing union, avoid strict-aliasingDavid Lamparter2015-04-211-5/+4
| | | | | | | | | | | | | | | | There are preexisting fields u.lp.id and u.lp.adv_router in struct prefix that do the same thing as these type-punning pointer derefs. Use these and shut up the strict-aliasing warnings. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchquagga: break excessively long help stringDavid Lamparter2015-04-211-9/+14
| | | | | | | | | | | | | | watchquagga's command line help string exceeds the ISO C maximum string length (4095 characters). Just break it in two. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib, vtysh: reduce unneccessary C extension usageDavid Lamparter2015-04-212-2/+5
| | | | | | | | | | | | | | We're only supporting GCC, Clang and ICC; but there's no reason to use nonstandard C constructs if they don't actually provide any benefit. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib: use const consistently for zserv pathDavid Lamparter2015-04-212-3/+3
| | | | | | | | | | | | | | The global variable is missing its const, but the accessor function has a meaningless extra const in exchange... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib: silence type range warning in macroDavid Lamparter2015-04-211-6/+10
| | | | | | | | | | | | | | | | While splitting up the CLI input macro is a bit annoying, this seems to be the least annoying way to get rid of the "< 0" comparison warning for unsigned long. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * pimd: cast ioctl values when printing themDavid Lamparter2015-04-211-4/+4
| | | | | | | | | | | | | | | | 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>
| * pimd: cast to sockaddr_in to sockaddrDavid Lamparter2015-04-213-4/+7
| | | | | | | | | | | | | | 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>
| * pimd: mask unused zclient_broken()David Lamparter2015-04-211-0/+2
| | | | | | | | | | | | | | 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>
| * zebra: clean up misc_null pragmasDavid Lamparter2015-04-211-4/+15
| | | | | | | | | | | | | | The no-op alternatives provided in misc_null trigger a few warnings since they provide functions / use pragmas without prototypes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: static int inline -> static inline intDavid Lamparter2015-04-211-2/+2
| | | | | | | | | | | | | | The BSD socket kernel interface had some weird ordering of function attribute keywords. ("static int inline foobar()") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: use SA_SIZE for RT_ROUNDUP on FreeBSDDavid Lamparter2015-04-211-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD provides SA_SIZE (and none of the other options to infer padded size of a struct sockaddr). Just define SAROUNDUP to SA_SIZE if it is available. This also drops a superfluous-looking extra macro branch which would require ROUNDUP. It seemed redundant to my eyes, but I have no idea what odd things might have triggered addition of this in the first place... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: use prototypes/includes in rt_netlinkDavid Lamparter2015-04-213-5/+6
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: remove unused netlink_route()/kernel_rtm_ipv6()David Lamparter2015-04-212-135/+0
| | | | | | | | | | | | | | | | kernel_delete_ipv6_old(), removed in 51bdeba a little while ago, was the last user of netlink_route() and kernel_rtm_ipv6(). Everything else uses the _multipath variants of these functions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra, isisd: cast to unsigned char for ctypesDavid Lamparter2015-04-212-2/+3
| | | | | | | | | | | | | | | | 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>
| * bgpd: random() returns longDavid Lamparter2015-04-211-4/+4
| | | | | | | | | | | | | | | | | | | | bgpd was using unsigned to store a probability value to be used with random(). That, however, returns long, running into some warnings (and worst case, if RAND_MAX > UINT_MAX, won't work correctly. Just use long to shuffle the value around. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: don't use #ifdef inside macro argsDavid Lamparter2015-04-211-58/+1
| | | | | | | | | | | | | | | | Using #ifdef inside preprocessor macro argument lists is not guaranteed to work. In reality it mostly does, but we don't need these ifdefs for HAVE_IPV6 anymore, so let's get rid of the warning nonetheless. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd, zebra: fix struct/pointer sizeof mixupsDavid Lamparter2015-04-212-4/+5
| | | | | | | | | | | | | | | | | | | | Two places were taking sizeof(pointer) instead of the sizeof(struct), while performing operations on the struct. Both are initialisation functions; I guess we haven't seen fallout since they weren't critical. Fix anyway. [v2: fix mistake that actually broke bgpd RS workqueue init] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix ecommunity_token initialiserDavid Lamparter2015-04-211-2/+2
| | | | | | | | | | | | | | | | This pulls up ecommunity_token_unknown to be the first enum value (at 0), and uses that as initialiser to get rid of the uninitialised use warning. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: add/cleanup initialisersDavid Lamparter2015-04-214-4/+4
| | | | | | | | | | | | | | | | There were some (inconsequential) warnings about uninitialised use of variables. Also, in one case, sub-structs were mixed in initialisation, which doesn't quite work as intended. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: add missing includesDavid Lamparter2015-04-218-0/+11
| | | | | | | | | | | | | | 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>