Fix dhcp6Relay
- interfaceIdOption does not proper encode vlanId
- AddHost was not using the actual vlan of the host
Change-Id: I41a639cc4f7efc0c7159f5bab07166d4032fc60a
diff --git a/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java b/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
index 45e94c0..8936cc6 100644
--- a/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
+++ b/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
@@ -452,8 +452,8 @@
byte[] clientSoureMacBytes = clientPacket.getSourceMACAddress();
byte[] inPortStringBytes = inPortString.getBytes();
byte[] vlanIdBytes = new byte[2];
- vlanIdBytes[0] = (byte) (clientPacket.getVlanID() & 0xff);
- vlanIdBytes[1] = (byte) ((clientPacket.getVlanID() >> 8) & 0xff);
+ vlanIdBytes[0] = (byte) ((clientPacket.getVlanID() >> 8) & 0xff);
+ vlanIdBytes[1] = (byte) (clientPacket.getVlanID() & 0xff);
byte[] interfaceIdBytes = new byte[clientSoureMacBytes.length +
inPortStringBytes.length + vlanIdBytes.length];
log.debug("Length: interfaceIdBytes {} clientSoureMacBytes {} inPortStringBytes {} vlan {}",
@@ -468,8 +468,8 @@
vlanIdBytes.length);
interfaceId.setData(interfaceIdBytes);
interfaceId.setLength((short) interfaceIdBytes.length);
- log.debug("interfaceId write srcMac {} portString {}",
- HexString.toHexString(clientSoureMacBytes, ":"), inPortString);
+ log.debug("interfaceId write srcMac {} portString {}, vlanId {}",
+ HexString.toHexString(clientSoureMacBytes, ":"), inPortString, vlanIdBytes);
return interfaceId;
}