Skip to content

Commit

Permalink
satisfy Section 2 of draft-ietf-idr-large-community-01
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Oct 10, 2016
1 parent b89a290 commit 541f0ee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def unpack (data, negotiated):
while data:
if data and len(data) < 12:
raise Notify(3,1,'could not decode large community %s' % str([hex(ord(_)) for _ in data]))
large_communities.add(LargeCommunity.unpack(data[:12],negotiated))
lc = LargeCommunity.unpack(data[:12],negotiated)
data = data[12:]
if lc in large_communities.communities:
continue
large_communities.add(lc)
return large_communities
5 changes: 4 additions & 1 deletion lib/exabgp/configuration/static/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ def large_community (tokeniser):
value = tokeniser()
if value == ']':
break
large_communities.add(_large_community(value))
lc = _large_community(value)
if lc in large_communities.communities:
continue
large_communities.add(lc)
else:
large_communities.add(_large_community(value))

Expand Down
3 changes: 2 additions & 1 deletion qa/conf/largecommunity.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ neighbor 127.0.0.1 {
}

static {
route 9.9.9.10/32 next-hop 192.0.2.1 large-community [ 2914:0:666 2914:3320:123 ];
route 8.8.8.10/32 next-hop 192.0.2.1 large-community [ 2914:0:666 2914:3320:123 ];
route 9.9.9.10/32 next-hop 192.0.2.1 large-community [ 2914:0:666 2914:3320:123 2914:3320:123 ];
}
}
3 changes: 2 additions & 1 deletion qa/conf/largecommunity.sequence
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:004C02:0000003040010100400200400304C000020140050400000064C0291800000B62000000000000029A00000B6200000CF80000007B200909090A
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:004C02:0000003040010100400200400304C000020140050400000064C01E1800000B62000000000000029A00000B6200000CF80000007B200808080A
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:004C02:0000003040010100400200400304C000020140050400000064C01E1800000B62000000000000029A00000B6200000CF80000007B200909090A
1:raw:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:0017:02:00000000

0 comments on commit 541f0ee

Please sign in to comment.