summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-17 14:40:17 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-17 14:40:17 +0000
commit702683a1d4b10d5288762fe29cdd853ed3de4552 (patch)
tree0a5755e87af5246baa2396f2b1f74c6f7b69ece2 /usr.sbin
parent20e8412ded310b1f505273cc43fdc6b05bac041e (diff)
init len for getsockname and getpeername, found and ok claudio
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index e908a9ee0cd..f46c42acc6f 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.110 2004/02/16 13:17:31 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.111 2004/02/17 14:40:16 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -873,9 +873,11 @@ session_tcp_established(struct peer *peer)
socklen_t len;
session_socket_blockmode(peer->sock, BM_NORMAL);
+ len = sizeof(peer->sa_local);
if (getsockname(peer->sock, (struct sockaddr *)&peer->sa_local,
&len) == -1)
log_warn("getsockname");
+ len = sizeof(peer->sa_remote);
if (getpeername(peer->sock, (struct sockaddr *)&peer->sa_remote,
&len) == -1)
log_warn("getpeername");