summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-19 21:06:47 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-19 21:06:47 +0000
commitdeeb2e41c046562a06993f0a627be8074a31cb67 (patch)
treee0b27140253491cab13b01c1d628b847cd5f5c36 /usr.sbin/bgpd/session.c
parent8ececc2d421af6c85493e483a36dfa9f068bc57b (diff)
when sending a notification things actually work better if you copy error code
and suberr code into the message... really
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 4df08e76ffe..bef259f6640 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.10 2003/12/19 20:34:53 henning Exp $ */
+/* $OpenBSD: session.c,v 1.11 2003/12/19 21:06:46 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -834,24 +834,27 @@ void
session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode,
u_char *data, size_t datalen)
{
- struct msg_notification msg;
+ struct msg_header msg;
struct buf *buf;
size_t len;
int errs = 0;
len = MSGSIZE_NOTIFICATION_MIN + datalen;
- memset(&msg.header.marker, 0xff, sizeof(msg.header.marker));
- msg.header.len = htons(len);
- msg.header.type = NOTIFICATION;
+ memset(&msg.marker, 0xff, sizeof(msg.marker));
+ msg.len = htons(len);
+ msg.type = NOTIFICATION;
if ((buf = buf_open(peer, peer->sock, len)) == NULL)
bgp_fsm(peer, EVNT_CON_FATAL);
- errs += buf_add(buf, (u_char *)&msg.header.marker,
- sizeof(msg.header.marker));
- errs += buf_add(buf, (u_char *)&msg.header.len, sizeof(msg.header.len));
- errs += buf_add(buf, (u_char *)&msg.header.type,
- sizeof(msg.header.type));
+ errs += buf_add(buf, (u_char *)&msg.marker,
+ sizeof(msg.marker));
+ errs += buf_add(buf, (u_char *)&msg.len, sizeof(msg.len));
+ errs += buf_add(buf, (u_char *)&msg.type,
+ sizeof(msg.type));
+ errs += buf_add(buf, (u_char *)&errcode, sizeof(errcode));
+ errs += buf_add(buf, (u_char *)&subcode, sizeof(subcode));
+
if (datalen > 0)
errs += buf_add(buf, data, datalen);