diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2016-02-01 19:01:37 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-02-02 16:54:47 +0100 |
commit | a7f35557331a283f4064c578f76be6330d54eaf4 (patch) | |
tree | d49ce92fb34fab66e613b70dc2d9dd600ebb14e5 /trafgen_l3.c | |
parent | 826a16efdd760930eb2cb21ae80c49a9d7d096f4 (diff) |
trafgen: eth: Add setting next protocol id
Move setting next protocol id field from higher protocols (ARP, IPv4)
to Ethernet. It makes code little more generic w/o checking each lower
protocol and setting specific field id.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_l3.c')
-rw-r--r-- | trafgen_l3.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/trafgen_l3.c b/trafgen_l3.c index 9e5126a..58eaa01 100644 --- a/trafgen_l3.c +++ b/trafgen_l3.c @@ -37,9 +37,7 @@ static void ipv4_header_init(struct proto_hdr *hdr) lower = proto_lower_default_add(hdr, PROTO_ETH); - if (lower->id == PROTO_ETH) - proto_field_set_default_be16(lower, ETH_TYPE, ETH_P_IP); - else if (lower->id == PROTO_IP4) + if (lower->id == PROTO_IP4) proto_field_set_default_u8(lower, IP4_PROTO, IPPROTO_IPIP); proto_header_fields_add(hdr, ipv4_fields, array_size(ipv4_fields)); |