trafgen: Get packet from proto_hdr if possible
commitd55874b960a8663cc86284fad4d0472ff37b7a7e
authorVadim Kochan <vadim4j@gmail.com>
Sat, 29 Jul 2017 09:46:07 +0000 (29 12:46 +0300)
committerTobias Klauser <tklauser@distanz.ch>
Thu, 10 Aug 2017 07:03:29 +0000 (10 09:03 +0200)
tree986e609f494dc1047d6b50b6ffc10da17b03f370
parenta5a6c39b90b1d12d67b5c166cf873a99faf0a05a
trafgen: Get packet from proto_hdr if possible

Replace using current_packet() by new proto_hdr_packet(hdr)
function to obtain packet directly from header. This is more
generic and flexible way, because it guarantees that packet really
belongs to the header, which in case in current_packet() is not right
because it means getting of last allocated packet.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen_l3.c
trafgen_l4.c
trafgen_proto.c
trafgen_proto.h