diff options
author | denis <denis@cvs.openbsd.org> | 2019-12-22 15:34:53 +0000 |
---|---|---|
committer | denis <denis@cvs.openbsd.org> | 2019-12-22 15:34:53 +0000 |
commit | 3ccea97113cbfb95cf357e2656b75d8338c921b1 (patch) | |
tree | 37f031fafca15eba3960e95693467b59a458312b /usr.sbin/ospf6d | |
parent | 1d1fef759d45fef0a65014664cbb6c27bb71be77 (diff) |
Scale send buffer on socket.
OK remi@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r-- | usr.sbin/ospf6d/interface.c | 14 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.h | 4 |
3 files changed, 15 insertions, 7 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c index 9feb8c69e96..c2c34986c88 100644 --- a/usr.sbin/ospf6d/interface.c +++ b/usr.sbin/ospf6d/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.25 2019/06/28 13:32:49 deraadt Exp $ */ +/* $OpenBSD: interface.c,v 1.26 2019/12/22 15:34:52 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -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 diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c index 209c392490c..db7018deadf 100644 --- a/usr.sbin/ospf6d/ospfe.c +++ b/usr.sbin/ospf6d/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.56 2019/06/11 05:00:09 remi Exp $ */ +/* $OpenBSD: ospfe.c,v 1.57 2019/12/22 15:34:52 denis Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -99,7 +99,7 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], 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) diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h index ba011ca0a85..07dce1d20f1 100644 --- a/usr.sbin/ospf6d/ospfe.h +++ b/usr.sbin/ospf6d/ospfe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.h,v 1.20 2019/12/11 21:33:56 denis Exp $ */ +/* $OpenBSD: ospfe.h,v 1.21 2019/12/22 15:34:52 denis Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -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); |