diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-05 17:12:53 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-05 17:12:53 +0000 |
commit | 09d05ec4924d16cf49835603ba84f65588754779 (patch) | |
tree | ba43664aced5ea3cabd7c1df361e8c136f005dd8 /usr.sbin | |
parent | 8f46d0a2534db2b04548ab48df1159ed03f848f8 (diff) |
Double socket receive buffer size; deraadt@ OK
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index c13b527e732..5bce408160e 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.51 2002/05/26 09:25:22 deraadt Exp $ */ +/* $OpenBSD: syslogd.c,v 1.52 2002/06/05 17:12:52 millert Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -static char rcsid[] = "$OpenBSD: syslogd.c,v 1.51 2002/05/26 09:25:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: syslogd.c,v 1.52 2002/06/05 17:12:52 millert Exp $"; #endif #endif /* not lint */ @@ -234,6 +234,7 @@ main(argc, argv) int ch, i, fklog, len, linesize, fdsrmax = 0; struct sockaddr_un sunx, fromunix; struct sockaddr_in sin, frominet; + socklen_t slen; fd_set *fdsr = NULL; char *p, *line; FILE *fp; @@ -324,6 +325,13 @@ main(argc, argv) if (i == 0) die(0); } + /* double socket receive buffer size */ + if (getsockopt(funix[i], SOL_SOCKET, SO_RCVBUF, &len, + &slen) == 0) { + len *= 2; + (void)setsockopt(funix[i], SOL_SOCKET, SO_RCVBUF, &len, + slen); + } } finet = socket(AF_INET, SOCK_DGRAM, 0); if (finet >= 0) { @@ -345,6 +353,13 @@ main(argc, argv) die(0); } else { InetInuse = 1; + /* double socket receive buffer size */ + if (getsockopt(finet, SOL_SOCKET, SO_RCVBUF, &len, + &slen) == 0) { + len *= 2; + (void)setsockopt(funix[i], SOL_SOCKET, + SO_RCVBUF, &len, slen); + } } } if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) < 0) |