[zebra] Fix mistake in previous commit and further compile warnings/errors.

2005-11-24 Paul Jakma <paul.jakma@sun.com>

	* kernel_socket.h: New header for functions exported to sysctl
	  methods.
	* kernel_socket.c: include previous.
	  Remove static qualifier from couple of functions which are
	  used by sysctl methods, incorrectly added in previous commit.
	  Add a workaround for a bogus gcc warning to the RTA_ macros.
	* Makefile.am: Add kernel_socket.h to noinst_HEADERS
	* if_sysctl.c: include rt.h and kernel_socket.h and remove
	  redundant prototypes.
	* rtread_sysctl.c: ditto.
	  (route_read) fix mismatch of return values.
	* {rt,zserv,rib}.h: Include lib headers depended on.
diff --git a/zebra/rtread_sysctl.c b/zebra/rtread_sysctl.c
index e39d8cb..88527b3 100644
--- a/zebra/rtread_sysctl.c
+++ b/zebra/rtread_sysctl.c
@@ -27,6 +27,7 @@
 
 #include "zebra/zserv.h"
 #include "zebra/rt.h"
+#include "zebra/kernel_socket.h"
 
 /* Kernel routing table read up by sysctl function. */
 void
@@ -35,7 +36,6 @@
   caddr_t buf, end, ref;
   size_t bufsiz;
   struct rt_msghdr *rtm;
-  void rtm_read (struct rt_msghdr *);
   
 #define MIBSIZ 6
   int mib[MIBSIZ] = 
@@ -52,7 +52,7 @@
   if (sysctl (mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0) 
     {
       zlog_warn ("sysctl fail: %s", safe_strerror (errno));
-      return -1;
+      return;
     }
 
   /* Allocate buffer. */
@@ -62,7 +62,7 @@
   if (sysctl (mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0) 
     {
       zlog_warn ("sysctl() fail by %s", safe_strerror (errno));
-      return -1;
+      return;
     }
 
   for (end = buf + bufsiz; buf < end; buf += rtm->rtm_msglen) 
@@ -74,5 +74,5 @@
   /* Free buffer. */
   XFREE (MTYPE_TMP, ref);
 
-  return 0;
+  return;
 }