summaryrefslogtreecommitdiffstats
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-04-25 23:13:25 +0200
committerMartin Mares <mj@ucw.cz>2000-04-25 23:13:25 +0200
commitefcece2da3054d9a0e5b5d2233549b3323428023 (patch)
tree835c92c6f7c6691c22cc998607251ce12431dcbd /proto/bgp/bgp.c
parenta47a01083b6ff9196f39136d68ed32ac70b31d15 (diff)
downloadbird-efcece2da3054d9a0e5b5d2233549b3323428023.tar
bird-efcece2da3054d9a0e5b5d2233549b3323428023.zip
Better reporting of both local and remote errors.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 27ade8e..403d858 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -94,7 +94,7 @@ bgp_graceful_close_conn(struct bgp_conn *c)
case BS_OPENSENT:
case BS_OPENCONFIRM:
case BS_ESTABLISHED:
- bgp_error(c, 6, 0, 0, 0);
+ bgp_error(c, 6, 0, NULL, 0);
return 1;
default:
bug("bgp_graceful_close_conn: Unknown state %d", c->state);
@@ -160,7 +160,7 @@ bgp_hold_timeout(timer *t)
struct bgp_conn *conn = t->data;
DBG("BGP: Hold timeout, closing connection\n");
- bgp_error(conn, 4, 0, 0, 0);
+ bgp_error(conn, 4, 0, NULL, 0);
}
static void
@@ -408,16 +408,16 @@ bgp_init(struct proto_config *C)
}
void
-bgp_error(struct bgp_conn *c, unsigned code, unsigned subcode, unsigned data, unsigned len)
+bgp_error(struct bgp_conn *c, unsigned code, unsigned subcode, byte *data, int len)
{
- DBG("BGP: Error %d,%d,%d,%d\n", code, subcode, data, len); /* FIXME: Better messages */
if (c->error_flag)
return;
+ bgp_log_error(c->bgp, "Error", code, subcode, data, (len > 0) ? len : -len);
c->error_flag = 1;
c->notify_code = code;
c->notify_subcode = subcode;
- c->notify_arg = data;
- c->notify_arg_size = len;
+ c->notify_data = data;
+ c->notify_size = (len > 0) ? len : 0;
if (c->primary)
proto_notify_state(&c->bgp->p, PS_STOP);
bgp_schedule_packet(c, PKT_NOTIFICATION);