summaryrefslogtreecommitdiffstats
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-12-14 03:26:51 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-12-14 03:26:51 +0100
commit7a03ded81bf2d07331d8fb87c2c7613cb4dd518e (patch)
tree50e5ca2856f97d1e0c875c02bf2cb8887815c4ab /proto/bgp/packets.c
parente91f6960bae16314e9429719c2c2321edb484a44 (diff)
downloadbird-7a03ded81bf2d07331d8fb87c2c7613cb4dd518e.tar
bird-7a03ded81bf2d07331d8fb87c2c7613cb4dd518e.zip
BGP: Added support for peering with link-local IPv6 addresses
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index bf98640..356d8bd 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -324,6 +324,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
struct bgp_proto *p = conn->bgp;
struct bgp_bucket *buck;
int size, second, rem_stored;
+ int class;
int remains = BGP_MAX_PACKET_LENGTH - BGP_HEADER_LENGTH - 4;
byte *w, *w_stored, *tmp, *tstart;
ip_addr *ipp, ip, ip_ll;
@@ -434,7 +435,8 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
*tmp++ = BGP_AF_IPV6;
*tmp++ = 1;
- if (ipa_nonzero(ip_ll))
+ class = ipa_classify(ip);
+ if (ipa_nonzero(ip_ll) && ((class & IADDR_SCOPE_MASK) != SCOPE_LINK))
{
*tmp++ = 32;
ipa_hton(ip);