summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2012-03-22 16:40:53 +0000
committerChris Hall <chris.hall@highwayman.com>2012-03-22 16:40:53 +0000
commit97f375b3e02e0f4ec18f68fbe36fc5ae16693d26 (patch)
treed0f89e2217723160b33c6632502e4f8eff6c3305 /bgpd
parent508e7f2b7d78b1352e2bc1b282937ef7ab138a18 (diff)
parent87f81eae2a74580e58cd9bed13a4c62306181d04 (diff)
downloadquagga-ex22b.tar.bz2
quagga-ex22b.tar.xz
Merge commit 'quagga_0_99_20_1_release' into euro_ix_bex22b
v0.99.20ex22b Conflicts: bgpd/bgp_open.c bgpd/bgp_packet.c The bpp_open.c code has been replaced by code in bgp_open_state.c, so these changes have no effect on the euro_ix branch, which already rejects invalid OPEN with a NOTIFY. Otherwise: modified: ospfd/ospf_dump.c modified: ospfd/ospf_dump.h modified: ospfd/ospf_lsa.h modified: ospfd/ospf_packet.c modified: ospfd/ospf_packet.h
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_open.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 872e12a2..d9db1c99 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -454,12 +454,20 @@ bgp_capability_restart (struct peer *peer, struct capability_header *caphdr)
static as_t
bgp_capability_as4 (struct peer *peer, struct capability_header *hdr)
{
+ SET_FLAG (peer->cap, PEER_CAP_AS4_RCV);
+
+ if (hdr->length != CAPABILITY_CODE_AS4_LEN)
+ {
+ zlog_err ("%s AS4 capability has incorrect data length %d",
+ peer->host, hdr->length);
+ return 0;
+ }
+
as_t as4 = stream_getl (BGP_INPUT(peer));
if (BGP_DEBUG (as4, AS4))
zlog_debug ("%s [AS4] about to set cap PEER_CAP_AS4_RCV, got as4 %u",
peer->host, as4);
- SET_FLAG (peer->cap, PEER_CAP_AS4_RCV);
return as4;
}
@@ -724,11 +732,9 @@ peek_for_as4_capability (struct peer *peer, u_char length)
if (hdr.code == CAPABILITY_CODE_AS4)
{
- if (hdr.length != CAPABILITY_CODE_AS4_LEN)
- goto end;
-
if (BGP_DEBUG (as4, AS4))
zlog_info ("[AS4] found AS4 capability, about to parse");
+
as4 = bgp_capability_as4 (peer, &hdr);
goto end;