summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-01 18:21:00 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-01 18:21:00 +0000
commita121fef54f1a2b1079ec32d0e4f53a904f3a2567 (patch)
tree4101c35fa4184dd840d817dc1da75f527d21f226
parentbb6d717863c2fd64c6d927f4f282a1bd581f374e (diff)
put v6 cruft into session_up() while beeing there... claudio ok
-rw-r--r--usr.sbin/bgpd/session.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index cdd7dee33c7..bf568de72e3 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.106 2004/01/31 21:09:15 henning Exp $ */
+/* $OpenBSD: session.c,v 1.107 2004/02/01 18:20:59 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1619,14 +1619,26 @@ session_up(struct peer *peer)
switch (peer->sa_local.ss_family) {
case AF_INET:
sup.local_addr.af = AF_INET;
- sup.local_addr.v4 =
- ((struct sockaddr_in *)&peer->sa_local)->sin_addr;
+ memcpy(&sup.local_addr.v4,
+ &((struct sockaddr_in *)&peer->sa_local)->sin_addr,
+ sizeof(sup.local_addr.v4));
sup.remote_addr.af = AF_INET;
- sup.remote_addr.v4 =
- ((struct sockaddr_in *)&peer->sa_remote)->sin_addr;
+ memcpy(&sup.remote_addr.v4,
+ &((struct sockaddr_in *)&peer->sa_remote)->sin_addr,
+ sizeof(sup.remote_addr.v4));
+ break;
+ case AF_INET6:
+ sup.local_addr.af = AF_INET6;
+ memcpy(&sup.local_addr.v6,
+ &((struct sockaddr_in6 *)&peer->sa_local)->sin6_addr,
+ sizeof(sup.local_addr.v6));
+ sup.remote_addr.af = AF_INET6;
+ memcpy(&sup.remote_addr.v6,
+ &((struct sockaddr_in6 *)&peer->sa_remote)->sin6_addr,
+ sizeof(sup.remote_addr.v6));
break;
default:
- fatalx("session_up: only AF_INET supported");
+ fatalx("session_up: unsupported address family");
}
peer->stats.last_updown = time(NULL);