2004-09-17 Paul Jakma <paul@dishone.st>

        * ripngd/ripngd.c: move setsockopt_so_recvbuf to lib.
        * lib/sockopt.{c,h}: Add setsockopt_so_recvbuf, for ripd and ripngd.
        * ripd/ripd.c: set receive buffer to a decent size, some systems
          have low defaults. Problem noted and fix suggested by Stephan
          Schweizer in [zebra 20967].
diff --git a/lib/sockopt.c b/lib/sockopt.c
index d0b034f..dbd5df5 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -23,6 +23,18 @@
 #include "log.h"
 #include "sockopt.h"
 
+int
+setsockopt_so_recvbuf (int sock, int size)
+{
+  int ret;
+  
+  if ( (ret = setsockopt (sock, SOL_SOCKET, SO_RCVBUF, (char *) 
+                          &size, sizeof (int)) < 0);
+    zlog_err ("can't setsockopt SO_RCVBUF");
+
+  return ret;
+}
+
 static void *
 getsockopt_cmsg_data (struct msghdr *msgh, int level, int type)
 {