Bug #362 is fixed now.
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 55ddfff..26a2517 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-21 Denis Ovsienko
+
+ * sockopt.[ch]: (setsockopt_so_sendbuf, getsockopt_so_sendbuf):
+ new functions to adjust ospfd working socket.
+
2007-08-13 Denis Ovsienko
* zebra.h: introduce ZEBRA_ERR_KERNEL and ZEBRA_ERR_NOERROR
diff --git a/lib/sockopt.c b/lib/sockopt.c
index f5f1a7e..f8fa946 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -36,6 +36,35 @@
return ret;
}
+int
+setsockopt_so_sendbuf (const int sock, int size)
+{
+ int ret = setsockopt (sock, SOL_SOCKET, SO_SNDBUF,
+ (char *)&size, sizeof (int));
+
+ if (ret < 0)
+ zlog_err ("fd %d: can't setsockopt SO_SNDBUF to %d: %s",
+ sock, size, safe_strerror (errno));
+
+ return ret;
+}
+
+int
+getsockopt_so_sendbuf (const int sock)
+{
+ u_int32_t optval;
+ socklen_t optlen = sizeof (optval);
+ int ret = getsockopt (sock, SOL_SOCKET, SO_SNDBUF,
+ (char *)&optval, &optlen);
+ if (ret < 0)
+ {
+ zlog_err ("fd %d: can't getsockopt SO_SNDBUF: %d (%s)",
+ sock, errno, safe_strerror (errno));
+ return ret;
+ }
+ return optval;
+}
+
static void *
getsockopt_cmsg_data (struct msghdr *msgh, int level, int type)
{
diff --git a/lib/sockopt.h b/lib/sockopt.h
index 65ba34f..ebb7143 100644
--- a/lib/sockopt.h
+++ b/lib/sockopt.h
@@ -23,6 +23,8 @@
#define _ZEBRA_SOCKOPT_H
extern int setsockopt_so_recvbuf (int sock, int size);
+extern int setsockopt_so_sendbuf (const int sock, int size);
+extern int getsockopt_so_sendbuf (const int sock);
#ifdef HAVE_IPV6
extern int setsockopt_ipv6_pktinfo (int, int);