dp-packet: use dp_packet_reset_offsets during initialisation
authorSimon Horman <simon.horman@netronome.com>
Tue, 1 Dec 2015 06:03:09 +0000 (15:03 +0900)
committerBen Pfaff <blp@ovn.org>
Tue, 1 Dec 2015 18:27:55 +0000 (10:27 -0800)
Use dp_packet_reset_offsets() in dp_packet_init__() to make it
clearer that initialisation includes a reset of packets
packets the same way as callers to dp_packet_reset_offsets() reset packets.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/dp-packet.c

index 098f816..1d166e1 100644 (file)
@@ -27,8 +27,7 @@ dp_packet_init__(struct dp_packet *b, size_t allocated, enum dp_packet_source so
 {
     dp_packet_set_allocated(b, allocated);
     b->source = source;
-    b->l2_pad_size = 0;
-    b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX;
+    dp_packet_reset_offsets(b);
     pkt_metadata_init(&b->md, 0);
 }