summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* ospfd: invalid MD5 auth_key?Joakim Tjernlund2014-10-271-2/+2
| | | | | | | | | | | | | | | 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>
* zebra: route_unlock_node is missing in "show ip[v6] route <prefix>" commandsLu Feng2014-10-271-0/+4
| | | | | Signed-off-by: Feng Lu <lu.feng@6wind.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
* docs: defines.texi include seems to want to be after setfilenamePaul Jakma2014-10-171-4/+3
| | | | | | | * 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.
* zebra: Build the test client, can be useful, and add IPv6 to testrib.confPaul Jakma2014-10-172-4/+24
|
* FreeBSD has changed its SOCK_RAW for being truly raw.Olivier Cochard-Labbé2014-10-171-1/+2
|
* bgpd: well-known attr check only run for v4/uni, which could cause a crash.Paul Jakma2014-10-173-54/+59
| | | | | | | | | | | | | | | | | | | | | | * ANVL testing by Martin Winter threw up a crash in bgpd in aspath_dup called from bgp_packet_attribute, if attr->aspath was NULL, on an IPv6 UPDATE. This root cause is that the checks for well-known, mandatory attributes were being applied only if an UPDATE contained the IPv4 NLRI and the peer was configured for v4/unicast (i.e. not deconfigured). This is something inherited from GNU Zebra, and never noticed before. * bgp_attr.c: (bgp_attr_parse) Move the well-known mandatory attribute check to here, so that it can be run immediately after all attributes are parsed, and before any further processing of attributes that might assume the existence of WK/M attributes (e.g. AS4-Path). (bgp_attr_munge_as4_attrs) Missing AS_PATH shouldn't happen here anymore, but retain a check anyway for robustness - it's definitely a hard error though. * bgp_attr.h: (bgp_attr_check) No longer needs to be exported, make static. * bgp_packet.c: (bgp_update_receive) Responsibility for well-known check now in bgp_attr_parse.
* [lib] Add support for backtrace on more platformsJoakim Tjernlund2014-10-172-4/+40
| | | | | * lib/sigevent.c: (program_counter) extend to support more platforms. Joint effort with Paul Jakma.
* lib/plist: Add some required parentheses, according to clang-analyzerPaul Jakma2014-10-171-4/+4
|
* ripng_nexthop: remove unused store to variablePaul Jakma2014-09-231-1/+0
|
* ospf6_lsdb: trivial, make it clear that showfunc is set before deref.Paul Jakma2014-09-232-15/+25
|
* bgpd.c: Remove unused store to variablePaul Jakma2014-09-231-2/+2
|
* Fix most compiler warnings in default GCC build.Paul Jakma2014-09-2338-211/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lots of warnings. Some const and type-pun breaks strict-aliasing warnings left but much reduced. * bgp_advertise.h: (struct bgp_advertise_fifo) is functionally identical to (struct fifo), so just use that. Makes it clearer the beginning of (struct bgp_advertise) is compatible with with (struct fifo), which seems to be enough for gcc. Add a BGP_ADV_FIFO_HEAD macro to contain the right cast to try shut up type-punning breaks strict aliasing warnings. * bgp_packet.c: Use BGP_ADV_FIFO_HEAD. (bgp_route_refresh_receive) fix an interesting logic error in (!ok || (ret != BLAH)) where ret is only well-defined if ok. * bgp_vty.c: Peer commands should use bgp_vty_return to set their return. * jhash.{c,h}: Can take const on * args without adding issues & fix warnings. * libospf.h: LSA sequence numbers use the unsigned range of values, and constants need to be set to unsigned, or it causes warnings in ospf6d. * md5.h: signedness of caddr_t is implementation specific, change to an explicit (uint_8 *), fix sign/unsigned comparison warnings. * vty.c: (vty_log_fixed) const on level is well-intentioned, but not going to fly given iov_base. * workqueue.c: ALL_LIST_ELEMENTS_RO tests for null pointer, which is always true for address of static variable. Correct but pointless warning in this case, but use a 2nd pointer to shut it up. * ospf6_route.h: Add a comment about the use of (struct prefix) to stuff 2 different 32 bit IDs into in (struct ospf6_route), and the resulting type-pun strict-alias breakage warnings this causes. Need to use 2 different fields to fix that warning? general: * remove unused variables, other than a few cases where they serve a sufficiently useful documentary purpose (e.g. for code that needs fixing), or they're required dummies. In those cases, try mark them as unused. * Remove dead code that can't be reached. * Quite a few 'no ...' forms of vty commands take arguments, but do not check the argument matches the command being negated. E.g., should 'distance X <prefix>' succeed if previously 'distance Y <prefix>' was set? Or should it be required that the distance match the previously configured distance for the prefix? Ultimately, probably better to be strict about this. However, changing from slack to strict might expose problems in command aliases and tools. * Fix uninitialised use of variables. * Fix sign/unsigned comparison warnings by making signedness of types consistent. * Mark functions as static where their use is restricted to the same compilation unit. * Add required headers * Move constants defined in headers into code. * remove dead, unused functions that have no debug purpose.
* Add missing GPL headers, and copyright claims that certainly apply.Paul Jakma2014-09-1917-1/+342
| | | | | | | | | | | | | * 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.
* lib: Improve error reporting from broken config filesSteve Hill2014-09-193-9/+20
| | | | | | | | * command.h: (config_from_file) Add variable to interface for line number reporting. * command.c: (config_from_file) Set & increment 'line_num' while parsing. * vty.c: (vty_read_file) Report parse errors in the correct order to stderr, with added line numbers.
* HACKING: remove an unneeded escapePaul Jakma2014-09-191-1/+1
|
* lib: include thread information in backtracesDavid Lamparter2014-09-154-0/+55
| | | | | | | now that we know what thread we're currently executing, let's add that information to SEGV / assert backtraces. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: unstupidify thread debug informationDavid Lamparter2014-09-152-67/+58
| | | | | | | | | | | | | | | | | the library's thread scheduling functions keep track of the thread function's name, so far so good. However, copying the compiler-provided constant into a buffer inside the thread structure is plain useless. Also, strip_funcname() was trying to support something that never happens. Instead, let's use some bytes here to track where threads are scheduled from. Another commit will print that information on crashes. Ripping out useless stuff: -64 bytes in the thread structure Re-add as const ptr: +8 bytes Extra debug info: +12 bytes Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix rtnh_len in the rt_netlink messages for multipath caseLu Feng2014-09-151-1/+2
| | | | | | | | | | | | | | In _netlink_route_build_multipath(): - Each time when appending a IPv4 gateway in the message, rtnh_len is increased by sizeof (struct rtattr) + 4, where we should use "bytelen" instead of the hard coding "4". - As what done for IPv4, we should increase rtnh_len accordingly along with adding a IPv6 gateway, or else the IPv6 gateways will be lost. 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>
* ripd: allow to enable/disable the ECMP featureLu Feng2014-09-153-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>
* ripd: add ECMP supportLu Feng2014-09-154-355/+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>
* *: merge branch stable/0.99.23David Lamparter2014-08-198-22/+116
|\ | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * lib: unset ZEBRA_IFA_PEER if no dst addr present (BZ#801)David Lamparter2014-08-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On OpenBSD, carp interfaces claim to be PtP interfaces with a 0.0.0.0/0 peer address. We process those in zebra and try to send them to clients, at which point they get encoded as all-0. The client code, however, decodes that to a NULL pointer instead of 0.0.0.0. This later turns into a SEGV when CONNECTED_PREFIX sees that ZEBRA_IFA_PEER is set and tries to access the peer prefix. This is a band-aid fix for stable/0.99.23, a long-term solution needs some conceptual improvements on the entire thing. (The usefulness of a PtP-to-0.0.0.0/0 is a separate question; at this point dropping the peer prefix seems the least intrusive solution.) Reported-by: Laurent Lavaud <laurent.lavaud@ladtech.fr> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * isisd: type mix-up in 28a8cfc "don't require IPv4"David Lamparter2014-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Whoops, these are in6_addrs, not prefix_ipv6... funnily enough, it does the right thing either way, if it compiles, which it only does on Linux because IN6_IS_ADDR_LINKLOCAL contains a cast to the right type. On BSD there is no such cast, hence it explodes on trying to compile, trying to access struct members of in6_addrs while operating on prefix_ipv6... Fixes: 28a8cfc ("isisd: don't require IPv4 for adjacency") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: memmove needed in community_del_valJohn Glotzer2014-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bgpd/bgp_community_del_val memcpy is used for potentially overlapping regions which is *not* safe. It may "work" in some cases but is not guaranteed to work in all cases. The case that I saw fail was on an x86_64 architecture with the number of bytes being moved/copied equal to 8. The way the code is written the uint32_t pointers will always differ by 1, which is equivalent to a memcpy/memmove of regions that are 4 bytes away from one another. So the code failed while copying an 8 byte region to an address that is 4 bytes lower i.e. overlapping regions. Interestingly, the same architecture had no problems with a 12 byte copy. When the code failed the communities were [200,300,400] and a call was made to delete the 200 community. The result of this was an array that looked like [400,400] which was uniquified to [400]. Of course the expected result should have been [300, 400]. One additional point - in our production environment memmove would not *link* without including <string.h> but in an isolated quagga git repo this #include does not seem to be required and I see memmove is used in vtysh.c without this #include either. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * build: do not assume glibc on linuxTimo Teräs2014-08-181-2/+3
| | | | | | | | | | | | | | | | | | The whole IPv6 stack detection could need refactoring. But this fixes the linux check to not assume glibc. Fixes build against musl c-library. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: fix struct msghdr initializersTimo Teräs2014-08-181-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | struct msghdr field orders are not strictly specified in POSIX. Improve portability by using designated initializer. This fixes build against musl c-library where struct msghdr is POSIX compliant (Linux kernel and glibc definitions are non-conforming). As the result is also more readable, struct iovec initilizers were also converted. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: fix detection and usage of sys/cdefs.hTimo Teräs2014-08-183-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | This header is non-standard (though present on many systems) and there is no standard for what it should or should not define. Remove it where it is not really needed. But add also a configure check, so it can be used if available but otherwise fallback to defining the needed macroes. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * isisd: don't require IPv4 for adjacencyDavid Lamparter2014-08-181-10/+79
| | | | | | | | | | | | | | | | This was precluding isisd from IPv6-only operation; no adjacency would come up unless there was IPv4 in parallel. Reported-by: Martin Winter <mwinter@netdef.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * tests/bgpd: don't hardcode error number (fix f57000c)David Lamparter2014-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | f57000c ("bgpd: don't send NOTIFY twice for malformed attrs") introduces BGP_ATTR_PARSE_ERROR_NOTIFYPLS as additional error code that implies the caller should sent a NOTIFY and convert it to BGP_ATTR_PARSE_ERROR. Sadly, the latter was hardcoded in bgp_mp_attr_test.c, which now didn't consider the new value to be an error. Make the testcase treat all nonzero values as error without discern. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | 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>
* | *: merge branch stable/0.99.23David Lamparter2014-06-295-75/+58
|\| | | | | | | | | | | bgp extcommunity fixes from stable branch Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: don't send NOTIFY twice for malformed attrsDavid Lamparter2014-06-292-12/+25
| | | | | | | | | | | | | | Most of the attribute parsing functions were already sending a notify, let's clean up the code to make it happen only once. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix IP endianness in debug messageDavid Lamparter2014-06-291-1/+1
| | | | | | | | | | | | inet_ntop expects network byte order. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix memory leak on malformed attributeDavid Lamparter2014-06-291-1/+4
| | | | | | | | | | | | | | | | When bgp_attr_parse returns BGP_ATTR_PARSE_ERROR, it may already have parsed and allocated some attributes before hitting that error. Free the attr's data before returning. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix double free after extcommunity set (BZ#799)David Lamparter2014-06-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The route-map extcommunity set code was incorrectly assuming that it owns the intern'd struct ecommunity reference. In reality, the intern'd reference belongs to bgp_update_receive() and we're not supposed to touch it in the route-map code. Instead, like all the other set commands, we use a on-heap but non-intern'd ecommunity to set the new value. This is then either intern'd in bgp_update_main/_rsclient() through bgp_attr_intern(), or free'd through bgp_attr_flush(). This fixes Bugzilla #799, which is that bgpd otherwise crashes with a double free. The ecommunity got unintern'd first in the route-map set command, then in bgp_update_receive(). Debugged-by: Milan Kocian <milon@wq.cz> Reported-by: Florian S <florian@herrenlohe.de> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: remove duplicate route-map extcommunity codeDavid Lamparter2014-06-291-50/+9
| | | | | | | | | | | | | | route_set_ecommunity_rt and _soo share almost all of their code. Let's remove one of the redundant copies. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: fix some bgp_update_main() attribute leaksDavid Lamparter2014-06-291-6/+9
| | | | | | | | | | | | | | | | | | | | | | bgp_update_main() wasn't doing anything to release attribute values set from route maps for two of its error paths. To fix, pull up the appropriate cleanup from further down and apply it here. bgp_update_rsclient() doesn't have the issue since it immediately does bgp_attr_intern() on the results from bgp_{export,import}_modifier. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | bgpd: merge branch tteras/master~3 (b304dcb)David Lamparter2014-06-296-64/+63
|\ \ | |/ |/| | | | | | | route-map tidying + next-hop-self all Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd: route-map: share aspath object compilation code where possibleTimo Teräs2014-06-251-48/+24
| | | | | | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi>
| * bgpd: implement "next-hop-self all"Timo Teräs2014-06-255-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | As specified in: http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/command/irg-cr-book/bgp-m1.html#wp4972925610 This allows overriding next-hop for ibgp learned routes on an RR for reflected routes. Especially useful for using iBGP in DMVPN setups. See: http://blog.ipspace.net/2014/04/changes-in-ibgp-next-hop-processing.html Signed-off-by: Timo Teräs <timo.teras@iki.fi>
| * bgpd: fix route-map commentsTimo Teräs2014-06-251-4/+4
|/ | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* release: 0.99.23quagga-0.99.23David Lamparter2014-06-241-1/+1
|
* doc: update NEWS for 0.99.23 changesDavid Lamparter2014-06-241-0/+24
|
* *: nuke ^L (page feed)David Lamparter2014-06-04115-658/+658
| | | | | | | | | | | | | | 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>
* build: Quagga 0.99.23-rc1quagga-0.99.23-rc1David Lamparter2014-06-031-1/+1
| | | | | | this is not a full release version, so neither release notes nor documentation are updated yet. Also, signing the tag with my private GPG key instead of the Quagga one.
* isisd: ignore the unrecognized TLVsLu Feng2014-06-031-1/+0
| | | | | | | | | | | | When processing LSPDUs, the unrecognized TLVs/sub-TLVs should be silently ignored. In parse_tlvs(), ISIS_WARNING is returned once an unrecognized TLV exists. It breaks the processing in lsp_authentication_check() and lsp_update_data(). So remove it. Signed-off-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd: fix "show ip rip status" documentationJoachim Nilsson2014-06-031-2/+2
| | | | | | | The command was mis-named in the documentation as "show ip protocols". Signed-off-by: Joachim Nilsson <troglobit@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd & ripngd: avoid the zero interface metricLu Feng2014-06-032-2/+2
| | | | | | | | | | | 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: remove redundant and incorrect sys/fcntl.h includeTimo Teräs2014-06-031-1/+0
| | | | | | | | | POSIX defines <fcntl.h>, <sys/fcntl.h> is the same thing. However, it should not be used as it's existence can depend on C-library implementation. E.g. musl gives warning if <sys/fcntl.h> is used. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: fix crash when allowas-in is done on inactive peerStephen Hemminger2014-06-031-0/+3
| | | | | | | | | | When allowas-in is changed on a peer that is not up, BGP would crash trying to do route_refresh. If peer is not up, there is no need to do notification or send. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Feng Lu <lu.feng@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>