summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index dad56ae34a6..8f4ba4de1e1 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.85 2004/01/11 18:42:25 henning Exp $ */
+/* $OpenBSD: session.c,v 1.86 2004/01/11 20:13:00 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1528,9 +1528,26 @@ session_down(struct peer *peer)
void
session_up(struct peer *peer)
{
+ struct session_up sup;
+
+ sup.remote_bgpid = peer->remote_bgpid;
+
+ 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;
+ sup.remote_addr.af = AF_INET;
+ sup.remote_addr.v4 =
+ ((struct sockaddr_in *)&peer->sa_remote)->sin_addr;
+ break;
+ default:
+ fatalx("session_up: only AF_INET supported");
+ }
+
peer->stats.last_updown = time(NULL);
if (imsg_compose(&ibuf_rde, IMSG_SESSION_UP, peer->conf.id,
- &peer->remote_bgpid, sizeof(peer->remote_bgpid)) == -1)
+ &sup, sizeof(sup)) == -1)
fatalx("imsg_compose error");
}