Skip to content

Commit

Permalink
ipf: Handle non-zero L2 padding for first fragments.
Browse files Browse the repository at this point in the history
Fixes: 4ea9669 ("Userspace datapath: Add fragmentation handling.")
Signed-off-by: Darrell Ball <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
darball1 authored and blp committed Feb 22, 2019
1 parent 1630b26 commit 0caac1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ipf.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ ipf_reassemble_v4_frags(struct ipf_list *ipf_list)
{
struct ipf_frag *frag_list = ipf_list->frag_list;
struct dp_packet *pkt = dp_packet_clone(frag_list[0].pkt);
dp_packet_set_size(pkt, dp_packet_size(pkt) - dp_packet_l2_pad_size(pkt));
struct ip_header *l3 = dp_packet_l3(pkt);
int len = ntohs(l3->ip_tot_len);

Expand Down Expand Up @@ -451,6 +452,7 @@ ipf_reassemble_v6_frags(struct ipf_list *ipf_list)
{
struct ipf_frag *frag_list = ipf_list->frag_list;
struct dp_packet *pkt = dp_packet_clone(frag_list[0].pkt);
dp_packet_set_size(pkt, dp_packet_size(pkt) - dp_packet_l2_pad_size(pkt));
struct ovs_16aligned_ip6_hdr *l3 = dp_packet_l3(pkt);
int pl = ntohs(l3->ip6_plen) - sizeof(struct ovs_16aligned_ip6_frag);

Expand Down

0 comments on commit 0caac1e

Please sign in to comment.