summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/bgpd.h3
-rw-r--r--usr.sbin/bgpd/parse.y3
-rw-r--r--usr.sbin/bgpd/session.c26
-rw-r--r--usr.sbin/bgpd/session.h5
4 files changed, 32 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index b860d8390cd..fff515b8a79 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.207 2006/08/27 13:40:21 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.208 2006/08/27 16:11:04 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -213,6 +213,7 @@ struct capabilities {
u_int8_t mp_v4; /* multiprotocol extensions, RFC 2858 */
u_int8_t mp_v6;
u_int8_t refresh; /* route refresh, RFC 2918 */
+ u_int8_t restart; /* draft-ietf-idr-restart */
};
struct peer_config {
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 0225345d5ef..98a9c706f19 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.192 2006/08/04 12:01:48 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.193 2006/08/27 16:11:05 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2172,6 +2172,7 @@ alloc_peer(void)
p->conf.capabilities.mp_v4 = SAFI_UNICAST;
p->conf.capabilities.mp_v6 = SAFI_NONE;
p->conf.capabilities.refresh = 1;
+ p->conf.capabilities.restart = 0;
p->conf.softreconfig_in = 1;
p->conf.softreconfig_out = 1;
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index e8f058e76cc..7b06191dcb1 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.259 2006/08/27 14:00:15 henning Exp $ */
+/* $OpenBSD: session.c,v 1.260 2006/08/27 16:11:05 henning Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -1192,6 +1192,7 @@ session_capa_ann_none(struct peer *peer)
peer->capa.ann.mp_v4 = SAFI_NONE;
peer->capa.ann.mp_v4 = SAFI_NONE;
peer->capa.ann.refresh = 0;
+ peer->capa.ann.restart = 0;
}
u_int8_t
@@ -1332,6 +1333,20 @@ session_open(struct peer *p)
optparamlen += op_len;
}
+ /* End-of-RIB marker, draft-ietf-idr-restart */
+ if (p->capa.ann.refresh) { /* 4 bytes data */
+ if ((op_len = session_capa_add(p, opb, CAPA_RESTART, 4)) == 0)
+ errs++;
+ else {
+ u_char c[4];
+
+ bzero(&c, 4);
+ c[0] = 0x01;
+ errs += buf_add(opb, &c, 4);
+ optparamlen += op_len;
+ }
+ }
+
if (errs > 0) {
buf_free(opb);
bgp_fsm(p, EVNT_CON_FATAL);
@@ -2056,6 +2071,11 @@ parse_notification(struct peer *peer)
log_peer_warnx(&peer->conf,
"disabling route refresh capability");
break;
+ case CAPA_RESTART:
+ peer->capa.ann.restart = 0;
+ log_peer_warnx(&peer->conf,
+ "disabling restart capability");
+ break;
default: /* should not happen... */
log_peer_warnx(&peer->conf, "received "
"\"unsupported capability\" notification "
@@ -2152,6 +2172,10 @@ parse_capabilities(struct peer *peer, u_char *d, u_int16_t dlen)
case CAPA_REFRESH:
peer->capa.peer.refresh = 1;
break;
+ case CAPA_RESTART:
+ peer->capa.peer.restart = 1;
+ /* we don't care about the further restart capas yet */
+ break;
default:
break;
}
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index e1dc302c2cb..fac94d5966c 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.85 2006/07/28 15:04:34 henning Exp $ */
+/* $OpenBSD: session.h,v 1.86 2006/08/27 16:11:05 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -103,7 +103,8 @@ enum opt_params {
enum capa_codes {
CAPA_NONE,
CAPA_MP,
- CAPA_REFRESH
+ CAPA_REFRESH,
+ CAPA_RESTART = 64
};
struct bgp_msg {