commit | 40ecb2a34794a31edab7f181e6afe3a80ae935f8 | [log] [tgz] |
---|---|---|
author | Daniel Park <dan.park@sk.com> | Tue Mar 15 23:57:02 2022 +0900 |
committer | Jian Li <pyguni@gmail.com> | Thu Mar 17 12:49:45 2022 +0000 |
tree | 9f35ac13b0b837cfcc2a952a6ef009490beec9ba | |
parent | 14968b521fca069c39e389d997c432621d5712f3 [diff] |
Fix KubevirtNode app to deal with the case that the external network is type VLAN, but the gateway node ovs owns untagged interface. Change-Id: I315114fd2f160749154af60ad47c166398cd199a
diff --git a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtRoutingSnatHandler.java b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtRoutingSnatHandler.java index 517c1ce..7c21b3f 100644 --- a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtRoutingSnatHandler.java +++ b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/KubevirtRoutingSnatHandler.java
@@ -383,12 +383,11 @@ TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder(); TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); + sBuilder.matchEthType(Ethernet.TYPE_IPV4); + if (externalNetwork.type() == VLAN) { - sBuilder.matchEthType(Ethernet.TYPE_VLAN) - .matchVlanId(VlanId.vlanId(externalNetwork.segmentId())); + sBuilder.matchVlanId(VlanId.vlanId(externalNetwork.segmentId())); tBuilder.popVlan(); - } else { - sBuilder.matchEthType(Ethernet.TYPE_IPV4); } sBuilder.matchIPDst(IpPrefix.valueOf(routerSnatIp, 32));