Skip to content

MPLS implementation #99

@juanan95mh

Description

@juanan95mh

There are errors at MPLS implementation, mosty related to packet/header sizes. I have made a fork with the corrections.

MAIN ERRORS:
-When zodiac POP a label suposes that the new payload have a (Packet Size - 16)bytes size, but the new payload is (Packet Size - ethHdr(14) - MPLS(4) )bytes, so the correct size is (Packet Size - 18) bytes

-Pushing a label the code move the payload pointer to the next byte to first MPLS header and this is an error, the payload had to stay next to the ethernet header. So if we push another label, it will be placed between ETHERNET hdr and 1st MPLS label(the correct way).

-The same error with pointer but decrementing it at POP

-When you move the old payload and leave space to a new MPLS label you have to move payload size, and payload size is = PacketSize-14(eth hdr size)
so:
memmove(fields.payload + 4, fields.payload, packet_size - 14);
and not:
memmove(fields.payload + 4, fields.payload, packet_size - 12);

Greetings.

Fork URL -> https://github.com/juanan95mh/ZodiacFX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions