X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=natservice%2Fnatservice-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Fnatservice%2Finternal%2FVpnFloatingIpHandler.java;h=46f65b4a121778b550879716bca60e441406299c;hb=HEAD;hp=8974ebb7aa497ede94fa89e4cf9c84bf2cf8db87;hpb=54e6f5fa42b79688f159edbf435c060d441a9100;p=vpnservice.git diff --git a/natservice/natservice-impl/src/main/java/org/opendaylight/vpnservice/natservice/internal/VpnFloatingIpHandler.java b/natservice/natservice-impl/src/main/java/org/opendaylight/vpnservice/natservice/internal/VpnFloatingIpHandler.java index 8974ebb7..46f65b4a 100644 --- a/natservice/natservice-impl/src/main/java/org/opendaylight/vpnservice/natservice/internal/VpnFloatingIpHandler.java +++ b/natservice/natservice-impl/src/main/java/org/opendaylight/vpnservice/natservice/internal/VpnFloatingIpHandler.java @@ -113,11 +113,11 @@ public class VpnFloatingIpHandler implements FloatingIPHandler { actionsInfos.add(new ActionInfo(ActionType.nx_resubmit, new String[] { Integer.toString(NatConstants.PDNAT_TABLE) })); instructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos).buildInstruction(0)); makeTunnelTableEntry(dpnId, label, instructions); - makeLFibTableEntry(dpnId, label, instructions); //Install custom FIB routes List customInstructions = new ArrayList<>(); customInstructions.add(new InstructionInfo(InstructionType.goto_table, new long[] { NatConstants.PDNAT_TABLE }).buildInstruction(0)); + makeLFibTableEntry(dpnId, label, NatConstants.PDNAT_TABLE); CreateFibEntryInput input = new CreateFibEntryInputBuilder().setVpnName(vpnName).setSourceDpid(dpnId).setInstruction(customInstructions) .setIpAddress(externalIp + "/32").setServiceId(label).setInstruction(customInstructions).build(); //Future> createFibEntry(CreateFibEntryInput input); @@ -294,7 +294,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler { mdsalManager.installFlow(dpnId, terminatingServiceTableFlowEntity); } - private void makeLFibTableEntry(BigInteger dpId, long serviceId, List customInstructions) { + private void makeLFibTableEntry(BigInteger dpId, long serviceId, long tableId) { List matches = new ArrayList(); matches.add(new MatchInfo(MatchFieldType.eth_type, new long[] { 0x8847L })); @@ -303,9 +303,9 @@ public class VpnFloatingIpHandler implements FloatingIPHandler { List instructions = new ArrayList(); List actionsInfos = new ArrayList(); actionsInfos.add(new ActionInfo(ActionType.pop_mpls, new String[]{})); - Instruction writeInstruction = new InstructionInfo(InstructionType.write_actions, actionsInfos).buildInstruction(0); + Instruction writeInstruction = new InstructionInfo(InstructionType.apply_actions, actionsInfos).buildInstruction(0); instructions.add(writeInstruction); - instructions.addAll(customInstructions); + instructions.add(new InstructionInfo(InstructionType.goto_table, new long[]{tableId}).buildInstruction(1)); // Install the flow entry in L3_LFIB_TABLE String flowRef = getFlowRef(dpId, NwConstants.L3_LFIB_TABLE, serviceId, "");