Age | Commit message (Collapse) | Author |
|
2006-12-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if.h: (struct connected) Add new ZEBRA_IFA_PEER flag indicating
whether a peer address has been configured. Comment now shows
the new interpretation of the destination addr: if ZEBRA_IFA_PEER
is set, then it must contain the destination address, otherwise
it may contain the broadcast address or be NULL.
(CONNECTED_DEST_HOST,CONNECTED_POINTOPOINT_HOST) Remove obsolete
macros that were specific to IPv4 and not fully general.
(CONNECTED_PEER) New macro to check ZEBRA_IFA_PEER flag.
(CONNECTED_PREFIX) New macro giving the prefix to insert into
the RIB: if CONNECTED_PEER, then use the destination (peer) address,
else use the address field.
(CONNECTED_ID) New macro to come up with an identifying address
for the struct connected.
* if.c: (if_lookup_address, connected_lookup_address) Streamline
logic with new CONNECTED_PREFIX macro.
* prefix.h: (PREFIX_COPY_IPV4, PREFIX_COPY_IPV6) New macros
for better performance than the general prefix_copy function.
* zclient.c: (zebra_interface_address_read) For non-null destination
addresses, set prefixlen to equal the address prefixlen. This
is needed to get the new CONNECTED_PREFIX macro to work properly.
* connected.c: (connected_up_ipv4, connected_down_ipv4,
connected_up_ipv6, connected_down_ipv6) Simplify logic using the
new CONNECTED_PREFIX macro.
(connected_add_ipv4) Set prefixlen in destination addresses (required
by the CONNECTED_PREFIX macro). Use CONNECTED_PEER macro instead
of testing for IFF_POINTOPOINT. Delete invalid warning message.
Warn about cases where the ZEBRA_IFA_PEER is set but no
destination address has been supplied (and turn off the flag).
(connected_add_ipv6) Add new flags argument so callers may set
the ZEBRA_IFA_PEER flag. If peer/broadcast address satisfies
IN6_IS_ADDR_UNSPECIFIED, then reject it with a warning.
Set prefixlen in destination address so CONNECTED_PREFIX will work.
* connected.h: (connected_add_ipv6) Add new flags argument so
callers may set the ZEBRA_IFA_PEER flag.
* interface.c: (connected_dump_vty) Use CONNECTED_PEER macro
to decide whether the destination address is a peer or broadcast
address (instead of checking IFF_BROADCAST and IFF_POINTOPOINT).
* if_ioctl.c: (if_getaddrs) Instead of setting a peer address
only when the IFF_POINTOPOINT is set, we now accept a peer
address whenever it is available and not the same as the local
address. Otherwise (no peer address assigned), we check
for a broadcast address (regardless of the IFF_BROADCAST flag).
And must now pass a flags value of ZEBRA_IFA_PEER to
connected_add_ipv4 when a peer address is assigned.
The same new logic is used with the IPv6 code as well (and we
pass the new flags argument to connected_add_ipv6).
(if_get_addr) Do not bother to check IFF_POINTOPOINT: just
issue the SIOCGIFDSTADDR ioctl and see if we get back
a peer address not matching the local address (and set
the ZEBRA_IFA_PEER in that case). If there's no peer address,
try to grab SIOCGIFBRDADDR regardless of whether IFF_BROADCAST is set.
* if_ioctl_solaris.c: (if_get_addr) Just try the SIOCGLIFDSTADDR ioctl
without bothering to check the IFF_POINTOPOINT flag. And if
no peer address was found, just try the SIOCGLIFBRDADDR ioctl
without checking the IFF_BROADCAST flag. Call connected_add_ipv4
and connected_add_ipv6 with appropriate flags.
* if_proc.c: (ifaddr_proc_ipv6) Must pass new flags argument to
connected_add_ipv6.
* kernel_socket.c: (ifam_read) Must pass new flags argument to
connected_add_ipv6.
* rt_netlink.c: (netlink_interface_addr) Copy logic from iproute2
to determine local and possible peer address (so there's no longer
a test for IFF_POINTOPOINT). Set ZEBRA_IFA_PEER flag appropriately.
Pass new flags argument to connected_add_ipv6.
(netlink_address) Test !CONNECTED_PEER instead of if_is_broadcast
to determine whether the connected destination address is a
broadcast address.
* bgp_nexthop.c: (bgp_connected_add, bgp_connected_delete)
Simplify logic by using new CONNECTED_PREFIX macro.
* ospf_interface.c: (ospf_if_is_configured, ospf_if_lookup_by_prefix,
ospf_if_lookup_recv_if) Simplify logic using new CONNECTED_PREFIX
macro.
* ospf_lsa.c: (lsa_link_ptop_set) Using the new CONNECTED_PREFIX
macro, both options collapse into the same code.
* ospf_snmp.c: (ospf_snmp_if_update) Simplify logic using new
CONNECTED_ID macro.
(ospf_snmp_is_if_have_addr) Simplify logic using new CONNECTED_PREFIX
macro.
* ospf_vty.c: (show_ip_ospf_interface_sub) Use new CONNECTED_PEER macro
instead of testing the IFF_POINTOPOINT flag.
* ospfd.c: (ospf_network_match_iface) Use new CONNECTED_PEER macro
instead of testing with if_is_pointopoint. And add commented-out
code to implement alternative (in my opinion) more elegant behavior
that has no special-case treatment for PtP addresses.
(ospf_network_run) Use new CONNECTED_ID macro to simplify logic.
* rip_interface.c: (rip_interface_multicast_set) Use new CONNECTED_ID
macro to simplify logic.
(rip_request_interface_send) Fix minor bug: ipv4_broadcast_addr does
not give a useful result if prefixlen is 32 (we require a peer
address in such cases).
* ripd.c: (rip_update_interface) Fix same bug as above.
|
|
2006-07-02 Paul Jakma <paul.jakma@sun.com>
* rt_netlink.c: (netlink_interface_addr) Fix CID #104, can not
proceed if addr is NULL.
* zebra_rib.c: (static_add_ipv6) Fix CID #18, double check
required arguments are supplied for the given nexthop type.
|
|
2006-01-17 Paul Jakma <paul.jakma@sun.com>
* kernel_socket.c: (ifam_read) Read metric from RTM_NEWADDR.
If interface is an alias, pass the alias as a label for
connected_add_ipv{4,6}.
* rt_netlink.c: (netlink_interface_addr) print out
IFA_CACHEINFO info, if present, when debugging kernel
messages.
|
|
2005-11-23 Paul Jakma <paul.jakma@sun.com>
* (general) fix some small compile errors, and mark several
functions as static.
* kernel_socket.c: (ifan_read) should be static.
fix missing brackets.
(ifm_read,ifam_read,rtm_read_mesg,kernel_read) Make static
(ifam_read_mesg) make static. fix incorrect variable name.
(rtm_read) make static. Fix call to rib_delete_ipv4 which
should be rib_delete_ipv6.
(routing_socket,kernel_init) should be static. Void argument
should be specified as such, not left incomplete.
* rt_netlink.c: rt.h should be included, contains prototypes of
exported functions.
(kernel_delete_ipv6_old) fix sign of index argument.
* rt_socket.c: Exact same as previous. Also, make various
functions static.
* rtread_getmsg.c: Include zserv.h, which prototypes
route_read. Make static.
* rtread_sysctl.c: zserv.h and rt.h should be included.
fix definition of route_read.
|
|
* connected.{c,h}: Include memory.h
(connected_add_ipv4) Use MTYPE for ifc label.
(connected_add_ipv6) Also should accept label. Store it in ifp.
(connected_del_ipv4) Taking label as argument is pointless.
* rt_netlink.c: (netlink_interface_addr) update label usage
for connected_{add,delete} functions.
* if_ioctl.c: (if_getaddrs) NULL label for connected_add_ipv6.
* if_ioctl_solaris.c: (interface_list_ioctl) Pass LIFC_NOXMIT
so we also find out about NOXMIT interfaces like VNI.
Bit of hackery to turn interface names into the primary
interface name, later with routing socket messages we only
will about primary interfaces anyway, so we must normalise
the name.
(if_get_addr) take label as argument, so it can
be passed to connected_add.
If label is provided, then it is interface name to issue the
ioctl for address information on, not the ifp name.
(interface_list) List AF_UNSPEC too, just in case.
* if_proc.c: (ifaddr_proc_ipv6) label for connected_add_ipv6.
* interface.c: (if_addr_wakeup) Some very bogus code - sets
IFF_RUNNING - add comment.
(if_refresh)
(ip_address_install) Use MTYPE for ifc label.
* ioctl_solaris.c: (if_mangle_up) New function. Hackery to make
IFF_UP reflect whether any addresses are left on the
interface, as we get signalled for IFF_UP flags change on the
primary interface only. Logical interfaces dont generate
IFINFO, but we do get an RTM_DELADDR.
(if_get_flags) Call if_mangle_up before return.
* kernel_socket.c: (ifam_read) Fixup calls to
connected_{add,delete} to match above changes. Rename gate
variable to brd, less confusing.
Pass the interface name as a label, if it is not same name
as ifp->name.
|
|
* rt_netlink.c: (netlink_request) Use memset to clear structure
before calling sendto (eliminates a valgrind error message about
uninitialized data).
|
|
rib_add_ipv6() function so that IPv6 routes in RIB can have correct
metric. No IPv6 routing daemon uses distance yet though.
* zserv.c, connected.c, kernel_socket.c, rt_netlink.c,
rtread_proc.c,zserv.c: Pass metric and distance info to the
rib_add_ipv6().
Forwardport from stable branch.
|
|
* rt_netlink.c (netlink_parse_info): Fix debug messages - nlmsg_pid is
unsigned and one zlog call had swapped arguments.
* rt_netlink.c (netlink_route_multipath): Fix compile with disabled
IPv6 support.
[backport candidate] - with stuff commited to rt_netlink.c before to
fix logging in netlink_route_multipath().
|
|
about IPv6 nexthops.
|
|
status to unsigned here, because we already checked that it isn't
negative or 0.
* rt_netlink.c (netlink_interface_addr): Prefix length belongs to the
address, not to the interface.
* rt_netlink.c (netlink_route_multipath): Fix debug. No useless info
is printed out now and IPv6 info is handeled.
|
|
Fix problems when netlink interfaces are renamed (same ifindex used
for a new interface). Start cleaning up some problems with the way
interface names are handled.
* interface.c: (if_new_intern_ifindex) Remove obsolete function.
(if_delete_update) After distributing the interface deletion message,
set ifp->ifindex to IFINDEX_INTERNAL.
(if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is
IFINDEX_INTERNAL.
(zebra_interface) Check return code from interface_cmd.func.
Do not set internal ifindex values to if_new_intern_ifindex(),
since we now use IFINDEX_INTERNAL for all pseudo interfaces.
* kernel_socket.c: (ifm_read) Fix code and comments to reflect that
all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL.
* rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex.
Detects interface rename events by checking if that ifindex is already
being used. If it is, delete the old interface before assigning
the ifindex to the new interface.
(netlink_interface, netlink_link_change) Call set_ifindex to update
the ifindex.
* if.h: Remove define for IFINDEX_INTERNBASE and add define
IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo-
interfaces should have ifindex set to 0.
(if_new) Remove function.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(ifname2ifindex) New function.
* if.c: (if_new) Remove function (absorb into if_create).
(if_create) Replace function if_new with call to calloc.
Set ifp->ifindex to IFINDEX_INTERNAL. Fix off-by-one error
in assert to check length of interface name. Add error message
if interface with this name already exists.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(if_delete) Implement with help of if_delete_retain.
(ifindex2ifname) Reimplement using if_lookup_by_index.
(ifname2ifindex) New function to complement ifindex2ifname.
(interface) The interface command should check the name length
and fail with a warning message if it is too long.
(no_interface) Fix spelling in warning message.
(if_nametoindex) Reimplement using if_lookup_by_name.
(if_indextoname, ifaddr_ipv4_lookup) Reimplement using
if_lookup_by_index.
* bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
* isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead
of if_delete, since it is generally not safe to remove interface
structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Tighten up code.
* ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function
was commented out. But this is not safe: we should at least update
the ifindex when the interface is deleted. So the new version
updates the interface status and sets ifp->ifindex to
IFINDEX_INTERNAL.
(ospf6_zebra_route_update) Use if_indextoname properly.
* ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface
flags to help with debugging.
* ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Make function static. Tighten up code.
* rip_interface.c: (rip_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
* ripng_interface.c: (ripng_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
|
|
it's not for debug.
* rt_netlink.c (netlink_talk): Don't assume we use netlink_cmd
although we do now actually.
* rt_netlink.c (netlink_route, netlink_route_multipath): Always use
netlink_cmd to send messages to the kernel.
[backport candidate]
|
|
* rt_netlink.c: (netlink_link_change) If the status of an
operative interface changes (e.g. MTU changes), the client
daemons should be notified by calling zebra_interface_up_update.
Previously, the information was being updated in zebra's
interface structure, but the clients were not notified of
changes to an operative interface.
* ospf_zebra.c: (ospf_interface_state_up) If the MTU of an operative
interface changes, print a debug message and call ospf_if_reset()
to simulate down/up on the interface.
* ospf_interface.h: Declare new function ospf_if_reset().
* ospf_interface.c: (ospf_if_reset) New function to call ospf_if_down
and ospf_if_up for all ospf interfaces attached to an interface.
|
|
* rt_netlink.c: (netlink_route_multipath) dont set equalise flag.
No stock Linux kernel has ever supported it, and even if it had
|
|
if we are not debugging.
|
|
* Not all Linux netlink systems have IFLA_WIRELESS
|
|
* rt_netlink.c: (netlink_socket,netlink_request,netlink_parse_info,
netlink_talk) Save errno before calling zserv_privs.change.
[backport candidate]
|
|
* zebra/rt_netlink.c: ignore wireless newlink netlink messages.
|
|
* *.c: Change level of debug messages to LOG_DEBUG.
|
|
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c
needs to include "log.h" to pick up the declaration.
|
|
ripd might need some more testing though.
|
|
|
|
|
|
daemon to change netlink receive buffer size.
|
|
|
|
* ioctl.c: (if_get_mtu) set mtu6 to mtu
* mtu_kvm.c: (if_kvm_get_mtu) set mtu6 to mtu
* rt_netlink.c: (netlink_interface) set mtu6 to mtu
(netlink_link_change) ditto
2004-05-09 Sowmini Varadhan <sowmini.varadhan@sun.com>
* interface.c: (if_delete_update) only used with HAVE_NETLINK
and RTM_IFANNOUNCE.
(if_flag_dump_vty) Solaris IFF_IPV4 and IFF_IPV6 if flags
(if_dump_vty) print mtu6 if not same as mtu
|
|
|
|
|
|
* zebra/rt_netlink.c: netlink_parse_info() ignore messages which are
not from kernel. Reported to RH by Herbert Xu. See
http://rhn.redhat.com/errata/RHSA-2003-307.html and CAN-2003-0858.
|
|
* zebra/connected.c: revert the 'generic PtP' patch as it causes
far too many problems. People who use FreeSWAN should investigate
native linux ipsec.
* zebra/rt_netlink.c: ditto
* lib/if.c: ditto
* ripd/ripd.h: ditto
* ripd/ripd.c: ditto
* ripd/rip_interface.c: ditto
* ospfd/ospfd.c: ditto
* ospfd/ospf_snmp.c: ditto
* bgpd/bgp_nexthop.c: ditto
|
|
* lib/version.h: add ZEBRA_URL (unused for now)
* lib/vty.c: CMD_ERR_NOTHING_TODO when reading conf file should not
be fatal. slight reformating.
* ospfd/ospf_zebra.c: ignore reject/blackhole routes if zebra sends
these type of routes. probably should be a new type of route to
allow daemons to more easily choose whether to redistribute them
- rathen than just a flag (eg for reject/blackhole).
reorder the is_prefix_default test for ZEBRA_IPV4_ROUTE_DELETE to
avoid the inverted test - slightly more readable.
* redhat/zebra.spec.in: Add ospfapi port to services file, if
with_ospfapi.
* zebra/rib.h: Change nexthop types to an enum.
* zebra/rt_netlink.c: run it through indent -nut.
Add nexthop_types_desc[] descriptive array for nexthop types.
(netlink_route_multipath) debug statements indicate which branch
they are in and print out nexthop type.
* zebra/zebra_rib.c: slight reformatting.
* zebra/zebra_vty.c: Pass ZEBRA_FLAG_BLACKHOLE flag to
static_add_ipv4() if Null0 route is configured. print out Null0 if
STATIC_IPV4_BLACKHOLE route, and ignore flags (shouldnt be
possible to set flags from vty) for config and show route.
|
|
* zebra/rt_netlink.c: Debug statements added to
netlink_route_multipath()
* zebra/zebra_rib.c: If route has a gateway, delete only existing
route with that specified gateway.
|
|
* lib/vty.{c,h}: Remove vty layer depending on a 'master' global,
pass the thread master in explicitly to vty_init. Sort out some
header dependency problems with lib/command.h
* zebra/: Move globals to struct zebrad. Update vty_init().
* (.*)/\1_main.c: update call to vty_init().
|
|
* Merge of zebra privileges
|
|
|
|
|
|
Subject: [zebra 18677] zebra initialisation bug and patch
Hi All,
I have found a bug in zebra that prevents its routing table and
interface database from being initialised properly. The problem occurs
when a request is made via the netlink socket but the kernel produces a
EWOULDBLOCK/EAGAIN when the result is trying to be retrieved via a
recvmsg(). Zebra does not do anything about this and continues to
function (with an empty routing table and interface list) as if nothing
has happened. With no such information the routing protocol dosn't work!
Two functions are called during the initialisation of Zebra:
interface_lookup_netlink() and netlink_route_read() - obtaining the
interfaces and routing table from the kernel respectively. These are the
only time these functions are called.
These functions, interface_lookup_netlink() and netlink_route_read(),
use netlink_parse_info() to recieve the data from the netlink socket.
The problem is, netlink_parse_info() returns (without error) when its
call to recvmsg() results in an errno EWOULDBLOCK/EAGAIN. This behaviour
is expected by other funtions calling netlink_parse_info() -
netlink_parse_info is simply recalled at a later stage. However, on
initialisation it is never recalled.
Since zebra is expected to nothing else during initialisation it was
easiest to temporarily change the netlink socket to BLOCK and wait
indefinently until the kernel responds with the required information.
Attached is a patch with these changes.
Comments and questions are welcome.
Please inform me if this patch is added to the Zebra source.
--israel
|
|
|
|
Subject: [zebra 17290] [PATCHES] - Fixes for problems in 0.93b
Added ifupstaticfix
|
|
addresses.
It seems so far that netlink only ever returns IFA_ADDRESS for IPv6 interfaces
and never IFA_LOCAL, regardless of whether it is PtP or not. Need to investigate
precisely how IPv6 and netlink are supposed to behave wrt broadcast vs
PtP links.
|
|
Date: Sat, 11 Jan 2003 23:26:28 +0100 (CET)
From: Yon Uriarte <havanna_moon@gmx.net>
To: "the list(tm) Zebra" <zebra@zebra.org>
Subject: [zebra 17217] [PATCH] show thread CPU
Hi,
a little patch from the 'stupid preprocessor tricks' collection to record
thread statistics.
Usage: "show thread cpu [r][w][t][e][x]"
Output Fields: self explaining I hope. Type is one of RWTEX for:
Read, Write (fd threads), Timer, Event, Execute.
Overhead vs. vanilla zebra: almost nothing. Vanilla CVS zebra already
collects thread run times.
Caveats: Under linux getrusage has a granularity of 10ms, which is almost
useless in this case. Run ./configure, edit config.h and comment out
"#define HAVE_RUSAGE", this way it will use getimeofday which has a much
better granularity. IMHO this is better, as cooperative threads are
effectively running during all that wall time (dont care if CPU
utilization was 3% or 99% during the time the thread was running (an
effective rusage combined with getimeofday could give that info)).
Maybe someone can give tips for other platforms on API granularity.
TODO: change some of the calls to thread_add_$KIND to
funcname_thread_add_$KIND with a meaningfull funcname, so users will get a
better idea of what's going on.
F.ex. (AFAIK):
ospf_spf_calculate_timer -> "Routes Step 1, areas SPF"
ospf_ase_calculate_timer -> "Routes Step 2, externals"
Could this be added to the unofficial patch collection?
Could someone with BGP keepalive problems run their bgpd with this patch
and post the results?
TIA, HTH, HAND, regards
yon
Example output:
--------------------------------
ospfd# show thread cpu
Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread
14.829 31 478 585 T ospf_ase_calculate_timer
82.132 9838 8 291 EX ospf_nsm_event
0.029 1 29 29 E ospf_default_originate_timer
0.254 9 28 34 T ospf_db_desc_timer
0.026 7 3 11 T ospf_wait_timer
669.015 523 1279 490696 R vty_read
4.415 45 98 173 TE ospf_network_lsa_refresh_timer
15.026 31 484 588 T ospf_spf_calculate_timer
29.478 1593 18 122 E ospf_ls_upd_send_queue_event
0.173 1 173 173 T vty_timeout
4.173 242 17 58 E ospf_ls_ack_send_event
637.767 121223 5 55 T ospf_ls_ack_timer
39.373 244 161 2691 R zclient_read
12.169 98 124 726 EX ospf_ism_event
0.226 2 113 125 R vty_accept
537.776 14256 37 3813 W ospf_write
4.967 41 121 250 T ospf_router_lsa_timer
0.672 1 672 672 E zclient_connect
7.901 1658 4 26 T ospf_ls_req_timer
0.459 2 229 266 E ospf_external_lsa_originate_timer
3.203 60 53 305 T ospf_maxage_lsa_remover
108.341 9772 11 65 T ospf_ls_upd_timer
33.302 525 63 8628 W vty_flush
0.101 1 101 101 T ospf_router_lsa_update_timer
0.016 1 16 16 T ospf_router_id_update_timer
26.970 407 66 176 T ospf_lsa_maxage_walker
381.949 12244 31 69 T ospf_hello_timer
0.114 22 5 14 T ospf_inactivity_timer
34.290 1223 28 310 T ospf_lsa_refresh_walker
470.645 6592 71 665 R ospf_read
3119.791 180693 17 490696 RWTEX TOTAL
ospfd#
bgpd# sh t c TeX
Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread
21.504 476 45 71 T bgp_keepalive_timer
17.784 1157 15 131 T bgp_reuse_timer
29.080 193 150 249 T bgp_scan
23.606 995 23 420 E bgp_event
317.734 28572 11 69 T bgp_routeadv_timer
0.084 1 84 84 E zlookup_connect
0.526 1 526 526 E zclient_connect
1.348 13 103 147 T bgp_start_timer
19.443 142 136 420 T bgp_connect_timer
16.032 772 20 27 T bgp_import
447.141 32322 13 526 TEX TOTAL
bgpd#
bgpd# show thread cpu rw
Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread
155.043 7 22149 150659 R bgp_accept
129.638 180 720 53844 R vty_read
1.734 56 30 129 R zclient_read
0.255 2 127 148 R vty_accept
58.483 983 59 340 R bgp_read
171.495 29190 5 245 W bgp_write
13.884 181 76 2542 W vty_flush
530.532 30599 17 150659 RW TOTAL
bgpd#
--------------------------------
|
|
|
|
|
|
|