Trivial diff to scale send buffer on socket.

Index: interface.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospf6d/interface.c,v
retrieving revision 1.25
diff -u -p -r1.25 interface.c
--- interface.c 28 Jun 2019 13:32:49 -0000      1.25
+++ interface.c 22 Dec 2019 14:09:20 -0000
@@ -708,7 +708,7 @@ if_to_ctl(struct iface *iface)
 
 /* misc */
 void
-if_set_recvbuf(int fd)
+if_set_sockbuf(int fd)
 {
        int     bsize;
 
@@ -718,7 +718,15 @@ if_set_recvbuf(int fd)
                bsize /= 2;
 
        if (bsize != 256 * 1024)
-               log_warnx("if_set_recvbuf: recvbuf size only %d", bsize);
+               log_warnx("if_set_sockbuf: recvbuf size only %d", bsize);
+
+       bsize = 64 * 1024;
+       while (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bsize,
+           sizeof(bsize)) == -1)
+               bsize /= 2;
+
+       if (bsize != 64 * 1024)
+               log_warnx("if_set_sockbuf: sendbuf size only %d", bsize);
 }
 
 int
Index: ospfe.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospf6d/ospfe.c,v
retrieving revision 1.56
diff -u -p -r1.56 ospfe.c
--- ospfe.c     11 Jun 2019 05:00:09 -0000      1.56
+++ ospfe.c     22 Dec 2019 14:09:20 -0000
@@ -99,7 +99,7 @@ ospfe(struct ospfd_conf *xconf, int pipe
                fatal("if_set_ipv6_checksum");
        if (if_set_ipv6_pktinfo(xconf->ospf_socket, 1) == -1)
                fatal("if_set_ipv6_pktinfo");
-       if_set_recvbuf(xconf->ospf_socket);
+       if_set_sockbuf(xconf->ospf_socket);
 
        oeconf = xconf;
        if (oeconf->flags & OSPFD_FLAG_NO_FIB_UPDATE)
Index: ospfe.h
===================================================================
RCS file: /cvs/src/usr.sbin/ospf6d/ospfe.h,v
retrieving revision 1.20
diff -u -p -r1.20 ospfe.h
--- ospfe.h     11 Dec 2019 21:33:56 -0000      1.20
+++ ospfe.h     22 Dec 2019 14:09:20 -0000
@@ -142,7 +142,7 @@ struct ctl_iface    *if_to_ctl(struct iface
 int     if_join_group(struct iface *, struct in6_addr *);
 int     if_leave_group(struct iface *, struct in6_addr *);
 int     if_set_mcast(struct iface *);
-void    if_set_recvbuf(int);
+void    if_set_sockbuf(int);
 int     if_set_mcast_loop(int);
 int     if_set_ipv6_pktinfo(int, int);
 int     if_set_ipv6_checksum(int);

Reply via email to