diff --git a/ZodiacFX/src/openflow/openflow_13.c b/ZodiacFX/src/openflow/openflow_13.c index d1f6ed7..236c16a 100644 --- a/ZodiacFX/src/openflow/openflow_13.c +++ b/ZodiacFX/src/openflow/openflow_13.c @@ -355,14 +355,13 @@ void nnOF13_tablelookup(uint8_t *p_uc_data, uint32_t *ul_size, int port) mpls[2] &= 0xFE; // clear bottom stack bit } struct ofp13_action_push *push = (struct ofp13_action_push*)act_hdr; - memmove(fields.payload + 4, fields.payload-2, packet_size - 12); + memmove(fields.payload + 4, fields.payload, packet_size - 12); memcpy(fields.payload - 2, &push->ethertype, 2); memcpy(fields.payload, mpls, 4); - fields.payload += 6; - packet_size += 6; - *ul_size += 6; - fields.eth_prot = push->ethertype; - fields.isMPLSTag = true; + fields.payload += 4; + packet_size += 4; + *ul_size += 4; + packet_fields_parser(p_uc_data, &fields); } break; @@ -370,10 +369,11 @@ void nnOF13_tablelookup(uint8_t *p_uc_data, uint32_t *ul_size, int port) case OFPAT13_POP_MPLS: if(fields.isMPLSTag){ struct ofp13_action_pop_mpls *pop = (struct ofp13_action_pop_mpls*)act_hdr; - memmove(p_uc_data+12, p_uc_data+18, packet_size-18); - fields.payload -= 6; - packet_size -= 6; - *ul_size -= 6; + memmove(p_uc_data+14, p_uc_data+18, packet_size-16); + fields.payload -= 4; + memcpy(fields.payload - 2, &pop->ethertype, 2); + packet_size -= 4; + *ul_size -= 4; packet_fields_parser(p_uc_data, &fields); } break;