Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/usr.sbin/syslogd Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/123244a77177
branches: netbsd-6
changeset: 776359:123244a77177
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jun 13 07:11:11 2013 +0000
description:
Pull up following revision(s) (requested by pettai in ticket #897):
usr.sbin/syslogd/tls.c: revision 1.11
usr.sbin/syslogd/syslogd.h: revision 1.4
usr.sbin/syslogd/syslogd.c: revision 1.115
PR/47861: Fredrik Pettai: keep track of the address family for each socket
opened and don't send the a message to the wrong family type.
diffstat:
usr.sbin/syslogd/syslogd.c | 7 +++++--
usr.sbin/syslogd/syslogd.h | 3 ++-
usr.sbin/syslogd/tls.c | 5 +++--
3 files changed, 10 insertions(+), 5 deletions(-)
diffs (78 lines):
diff -r c65a62c1e1b9 -r 123244a77177 usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c Thu Jun 13 06:49:08 2013 +0000
+++ b/usr.sbin/syslogd/syslogd.c Thu Jun 13 07:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslogd.c,v 1.105 2011/08/31 16:25:00 plunky Exp $ */
+/* $NetBSD: syslogd.c,v 1.105.4.1 2013/06/13 07:11:11 msaitoh Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-__RCSID("$NetBSD: syslogd.c,v 1.105 2011/08/31 16:25:00 plunky Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.105.4.1 2013/06/13 07:11:11 msaitoh Exp $");
#endif
#endif /* not lint */
@@ -2489,6 +2489,8 @@
for (r = f->f_un.f_forw.f_addr; r; r = r->ai_next) {
retry = 0;
for (j = 0; j < finet->fd; j++) {
+ if (finet[j+1].af != r->ai_family)
+ continue;
sendagain:
lsent = sendto(finet[j+1].fd, line, len, 0,
r->ai_addr, r->ai_addrlen);
@@ -3975,6 +3977,7 @@
logerror("socket() failed");
continue;
}
+ s->af = r->ai_family;
if (r->ai_family == AF_INET6 && setsockopt(s->fd, IPPROTO_IPV6,
IPV6_V6ONLY, &on, sizeof(on)) < 0) {
logerror("setsockopt(IPV6_V6ONLY) failed");
diff -r c65a62c1e1b9 -r 123244a77177 usr.sbin/syslogd/syslogd.h
--- a/usr.sbin/syslogd/syslogd.h Thu Jun 13 06:49:08 2013 +0000
+++ b/usr.sbin/syslogd/syslogd.h Thu Jun 13 07:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslogd.h,v 1.3 2009/04/20 09:56:08 mschuett Exp $ */
+/* $NetBSD: syslogd.h,v 1.3.8.1 2013/06/13 07:11:11 msaitoh Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -302,6 +302,7 @@
/* a pair of a socket and an associated event object */
struct socketEvent {
int fd;
+ int af;
struct event *ev;
};
diff -r c65a62c1e1b9 -r 123244a77177 usr.sbin/syslogd/tls.c
--- a/usr.sbin/syslogd/tls.c Thu Jun 13 06:49:08 2013 +0000
+++ b/usr.sbin/syslogd/tls.c Thu Jun 13 07:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tls.c,v 1.9 2012/02/13 07:40:24 spz Exp $ */
+/* $NetBSD: tls.c,v 1.9.2.1 2013/06/13 07:11:11 msaitoh Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: tls.c,v 1.9 2012/02/13 07:40:24 spz Exp $");
+__RCSID("$NetBSD: tls.c,v 1.9.2.1 2013/06/13 07:11:11 msaitoh Exp $");
#ifndef DISABLE_TLS
#include "syslogd.h"
@@ -851,6 +851,7 @@
logerror("socket() failed: %s", strerror(errno));
continue;
}
+ s->af = r->ai_family;
if (r->ai_family == AF_INET6
&& setsockopt(s->fd, IPPROTO_IPV6, IPV6_V6ONLY,
&on, sizeof(on)) == -1) {
Home |
Main Index |
Thread Index |
Old Index