Go to file
paul 5f37d86f83 From: Israel Keys <ikeys@agile.tv>
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
2003-04-19 00:11:28 +00:00
bgpd Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
doc Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
guile Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
init Removed out of date init/redhat. 2003-01-18 01:46:14 +00:00
lib Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
ospf6d Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
ospfclient Author: ralph 2003-04-09 07:26:33 +00:00
ospfd From: Sergey Vyshnevetskiy <serg@vostok.net> 2003-04-18 23:59:35 +00:00
ports renamed ports/redhat to redhat/ 2003-01-18 02:08:50 +00:00
redhat define localstatedir for configure 2003-04-07 08:14:11 +00:00
ripd Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
ripngd Add Makefile.in to the remaining .cvsignore's 2003-04-09 06:37:27 +00:00
tools Initial revision 2002-12-13 20:15:29 +00:00
vtysh Fix up vtysh.c compile warnings 2003-04-18 23:55:29 +00:00
zebra From: Israel Keys <ikeys@agile.tv> 2003-04-19 00:11:28 +00:00
.cvsignore Updated to reflect removal of auto-built files 2003-04-09 06:34:28 +00:00
acconfig.h Initial revision 2002-12-13 20:15:29 +00:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
ChangeLog From: Hasso Tepper <hasso@estpak.ee> 2003-04-13 21:42:11 +00:00
config.guess Initial revision 2002-12-13 20:15:29 +00:00
config.sub Initial revision 2002-12-13 20:15:29 +00:00
configure.ac [zebra 18626] move zebra socket paths to configure.ac 2003-04-07 06:11:09 +00:00
configure.in Copy configure.ac to configure.in. 2003-04-07 06:15:02 +00:00
COPYING Initial revision 2002-12-13 20:15:29 +00:00
COPYING.LIB Initial revision 2002-12-13 20:15:29 +00:00
depcomp Initial revision 2002-12-13 20:15:29 +00:00
INSTALL Initial revision 2002-12-13 20:15:29 +00:00
install-sh Initial revision 2002-12-13 20:15:29 +00:00
Makefile.am Fix make dist 2003-03-31 19:02:41 +00:00
missing Initial revision 2002-12-13 20:15:29 +00:00
mkinstalldirs Revert to zebra.org automake files 2003-02-17 23:54:05 +00:00
NEWS Initial revision 2002-12-13 20:15:29 +00:00
README Initial revision 2002-12-13 20:15:29 +00:00
REPORTING-BUGS Initial revision 2002-12-13 20:15:29 +00:00
SERVICES Initial revision 2002-12-13 20:15:29 +00:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
TODO Initial revision 2002-12-13 20:15:29 +00:00
update-autotools Initial revision 2002-12-13 20:15:29 +00:00

GNU Zebra is free software that manages various IPv4 and IPv6 routing
protocols.

Currently GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1,
RIPv2, and RIPng.
  
See the file INSTALL for building and installation instructions.
  
See the file REPORTING-BUGS to report bugs.
  
GNU Zebra is free software. See the file COPYING for copying conditions.