Age | Commit message (Collapse) | Author |
|
Change sockunion_log() to not use strdup(). This fixes a small memory
leak that occurs on every failed connect(), and is simpler/cleaner.
|
|
The delete_hook was being run after calling access list delete function.
This would cause ospf to dereference a NULL, in ospf_filter_update
because 'access->name' was already freed.
See also:
https://bugzilla.vyatta.com/show_bug.cgi?id=7654
|
|
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.
|
|
|
|
lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_*
definitions extended by else clause.
|
|
All daemons modified to support custom path to zserv
socket.
lib: generalize a zclient connection
zclient_socket_connect added. zclient_socket and
zclient_socket_un were hidden under static expression.
"zclient_serv_path_set" modified.
|
|
|
|
|
|
|
|
|
|
If the vty_serv_sock_addrinfo is being used, then vty_serv_sock_family
is unsed. Fix by adjusting ifdef/else/endif
|
|
* if.c
* if_dump(): 'node', 'c'
* distribute.c
* distribute_list_all(): 'dist'
* distribute_list(): 'dist'
* districute_list_prefix_all(): 'dist'
* if_rmap.c
* if_rmap(): 'if_rmap'
* vty.c
* vty_accept(): 'vty'
|
|
|
|
getaddrinfo returns a list of socket parameters for listening. it
will contain both IPv4 and IPv6 listening sockets. unless we use
IPV6_V6ONLY on the IPv6 ones, only the socket listed first will
work. if the IPv4 one came first, the IPv6 one would get an
"Address in use" error.
this functionality was already present for bgpd and its listening
sockets. as it is needed for vtys as well, make it a common helper.
|
|
this replaces most occurences of routing protocol lists by preprocessor
defines from route_types.h. the latter is autogenerated from
route_types.txt by a perl script (previously awk). adding a routing
protocol now is mostly a matter of changing route_types.txt and log.c.
Conflicts:
lib/route_types.awk
|
|
prefix2sockunion converts a struct prefix* to a union sockunion *;
prefix_common_bits counts the number of common bits in the prefix's
address part.
|
|
|
|
|
|
|
|
IPv6 supports the same concept of differentiated service for routing
protocols as IPv4, but like too many things, the standards committee
decided that having two names for the same thing wasn't good enough and
introduced a third more generic term transport class.
The socket option to set transport class works the same as IPv4, but the
arguments are different.
* lib/sockopt.[ch]
* setsockopt_ipv6_tclass(): new function
* bgpd/bgp_network.c
* bgp_connect(): set socket option
* bgp_listener(): set socket option
* ospf6d/ospf6_network.c
* ospf6_set_transport_class(): new function
* ospf6_serv_sock(): set socket option
* ripngd/ripngd.c
* ripng_make_socket(): set socket option
|
|
* lib/prefix.h
* IPV4_CLASS_DE(): new helper macro
* bgp_attr.c
* bgp_attr_nexthop(): add check for "partial" bit, refresh flag error
reporting, explain meaning of RFC4271 section 6.3 and implement it
|
|
* log.[ch]
* mes_lookup: add a parameter with the name of the message list, print
the name in case of failure.
* LOOKUP macro: pass the name of the message list.
|
|
Recent versions of libc on Linux (Debian Testing) create lots of
compile warnings about direct usage of libutil.h
|
|
(This commit is based on the patch from BZ#420, and should fix that bug.)
* configure.ac: detect availability of that API
* sockopt.c (setsockopt_ipv4_multicast): use it for join/leave IPv4
multicast groups
|
|
* sockopt.c (setsockopt_ipv4_multicast): check for wrong optname with
assert(), rather than return an error.
|
|
* sockopt.c (setsockopt_ipv4_multicast_if): fix missed line in
the previous commit.
|
|
* sockopt.[ch] (setsockopt_ipv4_multicast): ifindex is now mandatory (all
non-ancient OSes can use it anyway), and if_addr parameter (the address
of the interface) is now gone. (setsockopt_ipv4_multicast_if):
IP_MULTICAST_IF processing moved to this new function
* ospf_network.c (ospf_if_add_allspfrouters, ospf_if_drop_allspfrouters,
ospf_if_add_alldrouters, ospf_if_drop_alldrouters, ospf_if_ipmulticast),
rip_interface.c (ipv4_multicast_join, ipv4_multicast_leave,
rip_interface_new): adapt to the new interface
|
|
The following patch was also neccessary to compile.
* command.c: (config_logmsg_cmd) use "%s" format spec
* if.c: (connected_log) ditto
|
|
* sockopt.c (getsockopt_ifindex): "ifindex" was never used
|
|
|
|
* log.c: (closezlog) Also free the dynamically allocated filename when
a log is closed.
|
|
* lib/prefix.c: (prefix_match) nano-optimisation, let it return early
without copying pointers.
|
|
- SAFI value 3 is reserved. It was assigned by RFC 2858 for a use
that was never fully implemented, so it is deprecated by this
document.
* zebra.h: rename macro
* bgp_fsm.c: (bgp_graceful_restart_timer_expire,
bgp_graceful_stale_timer_expire, bgp_stop, bgp_establish): update
* bgpd.c: (peer_nsf_stop): update
* bgp_open.c: (bgp_capability_vty_out): SAFI 3 isn't a recognized case
any more
|
|
If router-id is not specified in ospf6d.conf, ospf6d will get it from
the zebra daemon. But ospf6d originates Link LSAs before the router-id
is returned by zebra, thus this router's Link LSAs will be flooded
with AdvRouter set to 0.
* zclient.c: zclient_start(): send ZEBRA_INTERFACE_ADD message after
ZEBRA_ROUTER_ID_ADD, not before
|
|
* bgpd/bgp_attr.c, bgpd/bgp_open.h, bgpd/bgp_route.c, lib/prefix.c,
lib/prefix.h: Various integer types were being used where, if we
had strict type checking, afi_t and safi_t would be required.
Signed-off-by: G.Balaji <balajig81@gmail.com>
(cherry picked from commit c8af35ffa2dc79ff7d7ff00b1b61f1f50a100ab6)
|
|
Signed-off-by: G.Balaji <balajig81@gmail.com>
|
|
lib/memory.c:z{a,c,re}alloc, zfree, zdup: add requires/effects
comments.
|
|
Stephen:
A recent change breaks build Quagga on Debian Lenny with amd64 (but not
i386). Not sure whether this is cause by ld, gcc, or libtool; but
whatever it just won't work for a large number of users.
Mathias:
I would guess it's a problem of libtool because it adds "-fPIC -DPIC" to
the compiler flags but doesn't remove -fPIE. That wouldn't be a problem
if the compiler would ignore the -fPIE in favor to the latter -fPIC, but
obviously it does not. [...] Those objects were actually compiled with
-fPIC but also -fPIE which seems to confuse gcc.
|
|
Because the final executables are built as position independent
executables (PIE) -- when configure has detected compiler supported for
PIE -- the objects in the library archive must be built in that way,
too. Otherwise the runtime linker has to do unneccesary relocation for
each start of the program. Even worse, the programs won't even be able
to start on a (hardened) kernel that doesn't allow those relocations to
happen by preventing making the .text segment writable (PaX's MPROTECT
feature comes to mind). The attached patch fixes this issue by adding
the appropriate flags to the Makefile.am.
|
|
* lib/memory.h
* mtype_zcalloc(): correct function prototype
* XFREE(): make both definitions consistent in setting
the pointer to NULL after freeing the memory
These changes will only have an effect if MEMORY_LOG is defined
(it is not by default).
|
|
* isisd/isis_pdu.c
* maskbit: this pre-initialized array is not modified
* lib/prefix.c
* maskbit: idem
* lib/command.c
* facility_map: idem
* itoa64: idem
* default_motd: make local var static
* facility_name(): update local var accordingly
* facility_match(): idem
|
|
* lib/prefix.h
* prefix6_bit(): add IPv6 wrapper for prefix_bit()
* ospf6d/ospf6_lsdb.c
* ospf6_lsdb_type_router_head(): employ prefix6_bit()
* ospf6_lsdb_type_head(): idem
|
|
Make one version of check prefix bit, and put it inline
with proper prototype. This gets rid of some macro's and also some
assert() that can never happen on a non-broken compiler.
* bgpd/bgp_table.c
* CHECK_BIT(): sayonara
* check_bit(): sayonara
* SET_LINK(): sayonara
* set_link(): make use of prefix_bit() instead of check_bit()
* bgp_node_match(): idem
* bgp_node_lookup(): idem
* bgp_node_get(): idem
* lib/prefix.h
* prefix_bit(): new inline version of check_bit()
* lib/table.c
* CHECK_BIT(): sayonara
* check_bit(): sayonara
* SET_LINK(): sayonara
* set_link(): make use of prefix_bit() instead of check_bit()
* route_node_match(): idem
* route_node_lookup(): idem
* route_node_get(): idem
* ospf6d/ospf6_lsdb.c
* CHECK_BIT(): sayonara
* ospf6_lsdb_lookup_next(): make use of prefix_bit() instead of
CHECK_BIT()
* ospf6_lsdb_type_router_head(): idem
* ospf6_lsdb_type_head(): idem
* ospf6d/ospf6_route.c
* CHECK_BIT(): sayonara
* ospf6_route_match_head() make use of prefix_bit() instead of
* CHECK_BIT()
|
|
* md5.c
* md5_calc(): If building on little endian then X
will be 'const uint32_t' which causes compiler
warning in code that never gets used. Just move
the endif to make sure code is not checked.
|
|
* table.c: general type safety and compiler help:
* maskbit[]: become const
* route_node_match(): take const args
* route_node_match_ipv4(): idem
* route_node_match_ipv6(): idem
* check_bit(): idem, plus adjust local vars typing
|
|
|
|
heasley: I've used this for a while to track usage.
|
|
* prefix.c: (str2prefix_ipv6) inet_pton succesful return is presumed to be
1, rather than the "not zero" the man page describes - seemed fragile.
|