summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-03-05 14:09:56 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-03-05 14:09:56 +0000
commit65e810ca6bbdaa3a67d2bad43afc6540f515aefb (patch)
tree6c26f360df0c4eaf12cd8d8896ab50d8cb65f74f /usr.sbin
parent1832088ad0c0b55db49d57affa1f4308c54cdcc2 (diff)
improve logging when we are unhappy with an OPEN message, claudio ok
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index b8aba012e50..bf6ba8426b4 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.124 2004/03/05 13:30:01 henning Exp $ */
+/* $OpenBSD: session.c,v 1.125 2004/03/05 14:09:55 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1425,6 +1425,8 @@ parse_open(struct peer *peer)
p += sizeof(optparamlen);
if (optparamlen > msglen - MSGSIZE_OPEN_MIN) {
+ log_peer_warnx(&peer->conf,
+ "corrupt OPEN message received: length mismatch");
session_notification(peer, ERR_OPEN, 0, NULL, 0);
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
return (-1);
@@ -1433,6 +1435,8 @@ parse_open(struct peer *peer)
plen = optparamlen;
while (plen > 0) {
if (plen < 2) {
+ log_peer_warnx(&peer->conf,
+ "corrupt OPEN message received, len wrong");
session_notification(peer, ERR_OPEN, 0, NULL, 0);
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
return (-1);
@@ -1445,6 +1449,8 @@ parse_open(struct peer *peer)
plen--;
if (op_len > 0) {
if (plen < op_len) {
+ log_peer_warnx(&peer->conf,
+ "corrupt OPEN message received, len wrong");
session_notification(peer, ERR_OPEN, 0,
NULL, 0);
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
@@ -1465,6 +1471,9 @@ parse_open(struct peer *peer)
* How the peer should know _which_ optional parameter
* we don't support is beyond me.
*/
+ log_peer_warnx(&peer->conf,
+ "received OPEN message with unsupported optional "
+ "parameter: type %u", op_type);
session_notification(peer, ERR_OPEN, ERR_OPEN_OPT,
NULL, 0);
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);