summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-11-06 10:59:52 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-11-07 09:09:03 +0000
commit472f13d6bf3f681d4ba575baa0bc03583d1d6f20 (patch)
treed135a325d8fe559e1fed7de5047108b66bc0dbad /v3po/v3po2vpp/src/main/java/io/fd
parentbaee9a73ebcf4db04d80f454094496a24595e142 (diff)
Fix operational read for interface's MAC address
Hc2vpp supports 48-bit addresses. VPP returns 64-bits, so ignore extended part. This patch updates MAC address handling broken by https://gerrit.fd.io/r/#/c/9090/ Change-Id: I7cc8d75e19f1f56e1f1adc23848a4a9baef87206 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java
index 01adefee1..9f788afc6 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java
@@ -99,7 +99,11 @@ public interface InterfaceDataTranslator extends ByteDataTranslator, JvppReplyCo
final int endIndex = PHYSICAL_ADDRESS_LENGTH;
checkArgument(endIndex <= vppPhysAddress.length,
"Invalid physical address size (%s), expected >= %s", vppPhysAddress.length, endIndex);
- return printHexBinary(vppPhysAddress);
+ // Extended (64-bit) MAC addresses are currently not supported , so use first 48-bits.
+ // Adding support for extended MAC addresses might require yang model change.
+ // Also VPP is not consistent (e.g. for TAP it allows to configure MAC of 6 bytes, but sw_interface_details
+ // contains 8 bytes.
+ return printHexBinary(vppPhysAddress, 0, PHYSICAL_ADDRESS_LENGTH);
}
/**