diff options
author | Paul Jakma <paul@quagga.net> | 2012-03-05 11:55:53 +0000 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2012-03-05 11:55:53 +0000 |
commit | 9fc75742397cf942ca9d684815ce63058b2576ff (patch) | |
tree | 3655b28f06ac2bdf9639b86e2df7c3abc525cd73 /bgpd/bgp_open.c | |
parent | 543fb49c316df9af2d25f08ba7e0da0305c36b5e (diff) | |
parent | 5861739f8c38bc36ea9955e5cb2be2bf2f482d70 (diff) |
Merge remote-tracking branch 'quagga-gnu.org/master'
Diffstat (limited to 'bgpd/bgp_open.c')
-rw-r--r-- | bgpd/bgp_open.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 82deb3d0..b5b50bb5 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -421,13 +421,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; } @@ -689,9 +696,6 @@ 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); |