summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2003-02-22 11:40:35 +0100
committerMartin Mares <mj@ucw.cz>2003-02-22 11:40:35 +0100
commit8c92bf6a0ddc21f2fa19c195a73d43837f60fc23 (patch)
treea5cf41133160eca030c5bea8d4e58728134a71b9 /proto
parent60a72ed49b36aea732d3584527040a7b3b0e72e0 (diff)
downloadbird-8c92bf6a0ddc21f2fa19c195a73d43837f60fc23.tar
bird-8c92bf6a0ddc21f2fa19c195a73d43837f60fc23.zip
Temporary fix for BGP protocol capability announcement for IPv6 mode.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/packets.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index ea980d1..bf89343 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -41,8 +41,22 @@ bgp_create_open(struct bgp_conn *conn, byte *buf)
put_u16(buf+1, p->local_as);
put_u16(buf+3, p->cf->hold_time);
put_u32(buf+5, p->local_id);
+#ifndef IPV6
buf[9] = 0; /* No optional parameters */
return buf+10;
+#else
+ buf += 9;
+ *buf++ = 8; /* Optional params len */
+ *buf++ = 2; /* Option: Capability list */
+ *buf++ = 6; /* Option length */
+ *buf++ = 1; /* Capability 1: Multiprotocol extensions */
+ *buf++ = 4; /* Capability data length */
+ *buf++ = 0; /* We support AF IPv6 */
+ *buf++ = BGP_AF_IPV6;
+ *buf++ = 0; /* RFU */
+ *buf++ = 1; /* and SAFI 1 */
+ return buf;
+#endif
}
static unsigned int