Moved serializing of forwarding address to conform tlv order 02/15402/3
authorDana Kutenicsova <dkutenic@cisco.com>
Tue, 17 Feb 2015 09:51:38 +0000 (10:51 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 19 Feb 2015 00:00:19 +0000 (00:00 +0000)
- adjusting also the tests

Change-Id: Ib2857f0f3f0ec90252d21c19ed4a1b4075837321
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/attribute/PrefixAttributesParser.java
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java

index b62b3d2fce811a27eba78a393224712881148564..f02ff597637c3e3e8526e0d18425629f2cf201d4 100644 (file)
@@ -147,10 +147,10 @@ final class PrefixAttributesParser {
             }
             TlvUtil.writeTLV(EXTENDED_ROUTE_TAG, extendedBuf, byteAggregator);
         }
+        serializeForwardingAddress(prefixAtrributes.getOspfForwardingAddress(), byteAggregator);
         if (prefixAtrributes.getPrefixMetric() != null) {
             TlvUtil.writeTLV(PREFIX_METRIC, Unpooled.copyInt(prefixAtrributes.getPrefixMetric().getValue().intValue()), byteAggregator);
         }
-        serializeForwardingAddress(prefixAtrributes.getOspfForwardingAddress(), byteAggregator);
     }
 
     private static void serializeForwardingAddress(final IpAddress forwardingAddress, final ByteBuf byteAggregator) {
index e5b60860be835661984946bdf498df216a01c2e9..3b4f6e8e006d7ce1821da733e56e60bf0f5b218a 100644 (file)
@@ -64,8 +64,8 @@ public class LinkstateAttributeParserTest {
         0x29, 0x29, 0x29, 0x29};
 
     private static final byte[] P4_ATTR = { 0x04, (byte) 0x80, 0, 0x01, (byte) 0x80, 0x04, (byte) 0x81, 0, 0x08, 0x12, 0x34, 0x56, 0x78,
-        0x10, 0x30, 0x50, 0x70, 0x04, (byte) 0x82, 0, 0x08, 0x12, 0x34, 0x56, 0x78, 0x10, 0x30, 0x50, 0x70, 0x04, (byte) 0x83, 0, 0x04,
-        0, 0, 0, 0x0a, 0x04, (byte) 0x84, 0, 0x04, 0x0a, 0x19, 0x02, 0x1b, 0x04, (byte) 0x88, 0, 0x01, 0x0a };
+        0x10, 0x30, 0x50, 0x70, 0x04, (byte) 0x82, 0, 0x08, 0x12, 0x34, 0x56, 0x78, 0x10, 0x30, 0x50, 0x70, 0x04, (byte) 0x84, 0, 0x04, 0x0a, 0x19, 0x02, 0x1b,
+        0x04, (byte) 0x83, 0, 0x04, 0, 0, 0, 0x0a, 0x04, (byte) 0x88, 0, 0x01, 0x0a };
 
     private final LinkstateAttributeParser parser = new LinkstateAttributeParser(false);