Skip to content

Commit

Permalink
Fix mixed declarations and code
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed May 2, 2024
1 parent 0dfed62 commit defeb55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/pf_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2559,10 +2559,12 @@ static int parse_raw_pkt(u_char *data, u_int32_t data_len,
}
}
} else if(hdr->extended_hdr.parsed_pkt.l3_proto == IPPROTO_GRE /* 0x47 */) { /* GRE */
if(data_len < hdr->extended_hdr.parsed_pkt.offset.l4_offset + sizeof(struct gre_header)) return(1);
struct gre_header *gre = (struct gre_header*)(&data[hdr->extended_hdr.parsed_pkt.offset.l4_offset]);
struct gre_header *gre;
int gre_offset;

if(data_len < hdr->extended_hdr.parsed_pkt.offset.l4_offset + sizeof(struct gre_header)) return(1);
gre = (struct gre_header*)(&data[hdr->extended_hdr.parsed_pkt.offset.l4_offset]);

gre->flags_and_version = ntohs(gre->flags_and_version);
gre->proto = ntohs(gre->proto);
gre_offset = sizeof(struct gre_header);
Expand Down

0 comments on commit defeb55

Please sign in to comment.