Skip to content

Commit

Permalink
Fixed MPLS action issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pzanna committed Jul 21, 2019
1 parent 0f3f756 commit f1ba650
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ZodiacFX/src/openflow/openflow_13.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,25 +355,25 @@ 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;

// Pop an MPLS tag
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;
Expand Down

0 comments on commit f1ba650

Please sign in to comment.