Age | Commit message (Collapse) | Author |
|
* sockunion.h: Add back sockunion_str2su, its removal breaks things needlessly
(e.g. our own unit tests).
* sockunion.c: (sockunion_str2su) implement on top of str2sockunion.
|
|
This avoids memory heap fragmentation and imposses less load on the
system memory allocator.
* thread.h: FUNCNAME_LEN defined to 64 (ISO C99 says max 63)
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[changed FUNCNAME_LEN to a less arbitrary value]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
thread_trim_head() already checks that the list is not empty.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
* thread.c: It's only temporarily used in thread_call() to calculate the
diffs. Saves 80 bytes per copy.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
Reduce indirection for values that doesn't change in the loop.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[adjusted after dropping previous patch]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
This function scores 2nd, profiling a full internet table load. It's called
for every prefix received.
Instead of looping in the interface lists comparing addresses use a hash
to mantain them.
* bgpd.c: Init the own address hash.
* bgp_nexthop.c: Introduce methods to maintain an own address hash.
(bgp_connected_add) add addresses to the hash.
(bgp_connected_delete) delete addresses from the hash.
(bgp_nexthop_self) lookup addresses in the hash. Removed the unused afi_t
parameter.
* bgp_route.c: (bgp_update_main) Micro-optimization, rearranged condition to
not lookup the hash for bogus nexthops (0.0.0.0 or a class D/E address)
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
ospfd was crashing some times on neighbour going down. The cause was that
ospf_nsm_event() was accessing already freed memory in ospf_nbr_delete()
call from ospf_nsm_event().
What happens is that since commit b5043aab (lib: fix incorrect thread
list...) now a thread can be on the event and ready lists but
thread_cancel_event() doesn't account for that.
* thread.c: (thread_cancel_event) loop on the ready list too to cancel
pending events.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
* command.c: (cmd_ipv6_match) Drop IPv6 address recognition
heuristics and solely rely on inet_pton, because strings
like "abcd" were mistaken for IPv6 addresses.
This affects e.g. the command "neighbour WORD peer-group",
which won't work with words consisting of up to 4 characters
between 'a' and 'f' and digits.
From: Roman Hoog Antink <rha@open.ch>
[full delete instead of #if 0]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
* lib/sockunion.c,
* zebra/zebra_rib.c: replace ->sin.sin_addr.s_addr with sockunion2ip
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
sockunion_str2su() use is prone to memory leaks. Remove it's use all over
the code.
At least these commands leaked a sockunion union:
- show ip bgp vpnv4 ... routes
- show ip bgp ... received prefix-filter
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
Use of this function is prone to memory leaks.
This fixes a memory accounting bug for vty denied connections.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
A route-map with the mentioned statement causes a memory leak for every
prefix that matches.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
continually changing the zserv protocol without bumping up the version
number has made it impossible to talk to zebra without knowing the exact
version. in reality, increasing the version number more often guards
against inadvertedly running incompatible versions of a daemon and zebra
as well as aids external development.
* lib/zclient.h: #define ZSERV_VERSION 2
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
this is essentially half of a rewrite of isisd. please note that a lot
of things are still broken and isisd is not ready for production use.
|
|
The steps were:
$ git checkout google-is-is
$ git merge quagga
$ git checkout google-is-is -- isisd
# Resolve conflicts in the following:
lib/md5.h
zebra/rt_netlink.c
zebra/zebra_rib.c
zebra/zserv.c
Note that the content in the isisd directory is left unchanged in the
merge. As a result, changes made to isisd as part of the following
commits on the quagga mainline are dropped.
# 8ced4e82 is the merge base, e96b3121 is the current quagga master
$ git log --oneline --reverse 8ced4e82..e96b3121 -- isisd
5574999 isisd: fix crash on "no router isis" (BZ#536)
8998075 isisd: raise hello rate for DIS (BZ#539)
306ca83 isisd: include hash.h, not hash.c
b82cdeb delete CVS keywords
2f65867 isisd: indent longopts array
b511468 quagga: option "-z" ("--socket <path>") added
05e54ee build: delete .cvsignore files
b4e45f6 fix zebra protocol after MP-BGP changes
7fd6cd8 isisd: fix circuit state machine
907fd95 isisd: send proper LSP after DIS election
d034aa0 isisd: fix wrong next-hops from SPF
c25eaff isisd: unexpected kernel routing table (BZ#544)
e6b03b7 isisd: implement MD5 circuit authentication
|
|
Conflicts:
bgpd/bgp_route.c
|
|
Change interface up/down notification messages to also include the
hardware address of the interface. The format of these messages is now
identical to the interface add message -- move the serialization code
to common functions.
* lib/zclient.c: Modify zebra_interface_if_set_value() to also parse
the hardware address. Invoke it from zebra_interface_add_read()
and and zebra_interface_state_read().
* zebra/zserv.c: Add zserv_encode_interface(). Invoke it from
zserv_interface_add(), zserv_interface_delete() and
zserv_interface_update().
|
|
* lib/if.c: Change if_delete_retain() to delete all connected
addresses, but to not free the list that holds them. Free the list
just before the interface structure itself is freed, in
if_delete().
|
|
|
|
* lib/stream.[ch]:
- Add stream_set_endp(). This can be used to trim data (for
example, padding) at the end of a stream.
- Fix swapped 'getp' and 'endp' parameters in STREAM_WARN_OFFSETS.
From: Subbaiah Venkata <svenkata@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
* lib/md5.[ch] Add implementation of HMAC-MD5 from RFC 2104.
From: Josh Bailey <joshb@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
* lib/linklist.h
- Change the listnextnode, listhead and listtail macros so that
they allow the list pointer to be NULL.
- Modify the ALL_LIST_ELEMENTS* macros such that they clear the
data pointer at the beginning and end of the loop.
From: Josh Bailey <joshb@google.com>
Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
nonwithstanding any desire for optimisation, these versions are shorter
and more concise. reading the comments, they might even be easier to
understand.
I've tested them on i686 and x86_64, and checked that correct assembler
code is emitted for ARM, MIPS and PowerPC.
IPv6 is left as an exercise for another day, none of the ideas I had led
to a "yes, this is the one to go with" solution.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
This reverts commit d171bf58ef12ace43d48565e6870722dece1e6ed.
There are multiple reasons for this revert, including bug #720, but also
quite simply the unreadability of having 2000 lines of an autogenerated
table in the middle of a source file.
Signed-off-by: David Lamparter <equinox@diac24.net>
Reported-by: Martin Winter <mwinter@opensourcerouting.org>
|
|
|
|
|
|
* Initial import of the Babel routing protocol, ported to Quagga.
* LICENCE: Update the original LICENCE file to include all known potentially
applicable copyright claims. Ask that any future contributors to babeld/
grant MIT/X11 licence to their work.
* *.{c,h}: Add GPL headers, in according with the SFLC guidance on
dealing with potentially mixed GPL/other licensed work, at:
https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
|
|
While defining two "maskbytes" arrays for the respective endiannesses,
the code was unconditionally using one that only worked on little endian
systems.
Use preprocessor macros to avoid the somewhat expensive
htonl/ntohl macros.
From: Renato Westphal <renatowestphal@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
* thread.c: (thread_timer_process,thread_process) thread_list_delete nulls
thread->next. Loops need to save next first, or will only process the head.
Problem noted by Lou Berger <lberger@labn.net>.
|
|
|
|
* lib/thread.h: new timer macro, millisecond precision
(this was cherrypicked from pimd to isolate all non-contained changes)
From: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
* Replace command "isis passwd" with "isis passwd {clear|md5}"
* Verify HMAC MD5 on ISIS Hello PDUs
* Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
|
|
This patch contains the following:
1. Addition of IPv6 SAFI_MULTICAST BGP routes into the BGP Multicast RIB.
2. Deletion of IPv6 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
|
|
This patch contains the following:
1. Addition of IPv4 SAFI_MULTICAST BGP routes into the BGP Multicast RIB.
2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
|
|
|
|
* if.c: (if_dump) loop that doesn't do anything, wants to be
before the zlog of what it's meant to print out so all the connected
addresses get printed out. Trival: just a debug function
|
|
* (general) Move functions in headers into files, to be compiled into
shared object files. Remove inline qualifier from functions. Let the
compiler do the work.
|
|
...otherwise 4294967295 is not a valid value on 32bit systems
|
|
IPV4_ADDR_SAME() wasn't passed the right union member, this could cause
a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before
the error could be created by macro upgrade.
|
|
* lib/prefix.h
* IPV4_CLASS_DE(): make consistent with counterpart macros
* bgp_packet.c
* bgp_open_receive(): test using macro instead of ">="
* bgp_route.c
* bgp_update_rsclient(): idem
* bgp_update_main(): idem
|
|
ZEBRA_HELLO message is used by routing daemons to inform zebra
what type of routes daemon will be announcing to zebra. Also
zebra uses route_type_oaths array to track which daemon announces
which protocol. Zebra mops up routes if daemon didn't for some
reason.
|
|
ip_masklen() was likely to return incorrect results after being compiled
with -fstrict-aliasing (-O2, -O3, -Os)
|
|
The new implementation makes use of a 64KB mapping table, which makes it
possible to compute masklen faster and with constant execution time. The
map also allows for additional version of the function, which can detect
errors in input argument.
The previous implementation had a variable cost of execution, which
depended on masklen in a non-linear manner, and at its worst (/31) was
4 times slower, than the new implementation. The only case of old
function just slightly outperforming the new one is /0, which is of
little practical interest.
|
|
Experience with IPv4 counterpart of this function suggests, that
this way of type-punning is likely to cause errors.
|
|
(This patch was modified to leave calls to stream_getl() in place, they
are necessary for the stream's internal pointer to advance to the
correct position. -- Denis)
Signed-off-by: Denis Ovsienko <infrastation@yandex.ru>
Fix gcc warnings about varables that are set but never used.
* bgpd/bgp_attr.c
* cluster_unintern(): ret
* transit_unintern(): ret
* bgp_attr_default_intern(): attre
* bgp_mp_reach_parse(): rd_high, rd_low
* bgpd/bgp_route.c
* bgp_announce_check_rsclient(): bgp
* bgpd/bgp_zebra.c
* zebra_read_ipv4(): ifindex
* zebra_read_ipv6(): ifindex
* bgpd/bgpd.c
* bgp_config_write_peer(): filter
* lib/distribute.c
* distribute_list_all(): dist
* distribute_list(): dist
* distribute_list_prefix_all(): dist
* distribute_list_prefix(): dist
* lib/if_rmap.c
* if_rmap(): if_rmap
* lib/vty.c
* vty_accept(): vty
* lib/zclient.c
* zclient_read(): ret
* zebra/irdp_interface.c
* if_group(): zi
* zebra/rt_netlink.c
* kernel_read(): ret, sock
|
|
|
|
|
|
|
|
|