Skip to content

Commit

Permalink
Address review nit
Browse files Browse the repository at this point in the history
  • Loading branch information
wingo committed Feb 13, 2018
1 parent c55199b commit fe08efb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/program/packetblaster/lwaftr/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ local ether_header_ptr_type = ffi.typeof("$*", ether_header_t)
local ethernet_header_size = ffi.sizeof(ether_header_t)
local OFFSET_ETHERTYPE = 12

-- The ethernet CRC field is not included in the packet as seen by
-- Snabb, but it is part of the frame and therefore a contributor to the
-- frame size.
local ethernet_crc_size = 4

local ether_vlan_header_type = ffi.typeof([[
struct {
uint16_t tag;
Expand Down Expand Up @@ -372,7 +377,6 @@ function Lwaftrgen:pull ()
-- that we don't see in Snabb.

local vlan_size = self.vlan and ether_vlan_header_size or 0
local ethernet_crc_size = 4
local ethernet_total_size = ethernet_header_size + vlan_size
local minimum_size = ethernet_total_size + ipv4_header_size +
udp_header_size + ethernet_crc_size
Expand Down

0 comments on commit fe08efb

Please sign in to comment.