Skip to content

Commit

Permalink
ipv6: record frag_max_size in atomic fragments in input path
Browse files Browse the repository at this point in the history
Commit dbd1759 ("ipv6: on reassembly, record frag_max_size")
filled the frag_max_size field in IP6CB in the input path.
The field should also be filled in case of atomic fragments.

Fixes: dbd1759 ('ipv6: on reassembly, record frag_max_size')
Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Francesco Ruggeri authored and davem330 committed May 21, 2021
1 parent 8f03eeb commit e29f011
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/reassembly.c
Original file line number Diff line number Diff line change
@@ -343,14 +343,16 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
hdr = ipv6_hdr(skb);
fhdr = (struct frag_hdr *)skb_transport_header(skb);

if (!(fhdr->frag_off & htons(0xFFF9))) {
if (!(fhdr->frag_off & htons(IP6_OFFSET | IP6_MF))) {
/* It is not a fragmented frame */
skb->transport_header += sizeof(struct frag_hdr);
__IP6_INC_STATS(net,
ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS);

IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb);
IP6CB(skb)->flags |= IP6SKB_FRAGMENTED;
IP6CB(skb)->frag_max_size = ntohs(hdr->payload_len) +
sizeof(struct ipv6hdr);
return 1;
}

0 comments on commit e29f011

Please sign in to comment.