Commit 22d2c6b 1 parent f047e0c commit 22d2c6b Copy full SHA for 22d2c6b
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -599,8 +599,8 @@ static int dissect_l4(struct m_pkt *p)
599
599
return -1 ;
600
600
}
601
601
/* Check version. 0 = GRE, 1 = ENHANCED GRE (used for PPTP) */
602
- if ((gre_h -> version != 0 && gre_h -> version != 1 ) ||
603
- (gre_h -> version == 1 && ntohs (gre_h -> protocol ) != 0x880b )) {
602
+ if ((gre_h -> version != 0 && gre_h -> version != 1 ) ||
603
+ (gre_h -> version == 1 && ntohs (gre_h -> protocol ) != 0x880b )) {
604
604
derr ("Unexpected gre version %d\n" , gre_h -> version );
605
605
return -1 ;
606
606
}
@@ -627,12 +627,16 @@ static int dissect_l4(struct m_pkt *p)
627
627
return -1 ;
628
628
}
629
629
630
- if (gre_h -> version == 0 ) {
630
+ if (gre_h -> version == 0 ) {
631
631
p -> l3_proto = ntohs (gre_h -> protocol );
632
- if (p -> l3_proto == 0 && l4_hdr_len == p -> l4_length ) {
632
+ if (p -> l3_proto == 0 && l4_hdr_len == p -> l4_length ) {
633
633
derr ("GRE keepalive\n" );
634
634
return -1 ;
635
635
}
636
+ if (p -> l3_proto != ETH_P_IP && p -> l3_proto != ETH_P_IPV6 ) {
637
+ derr ("Invalid L3 after GRE: 0x%x\n" , p -> l3_proto );
638
+ return -1 ;
639
+ }
636
640
} else {
637
641
ppp_h = & data [l4_hdr_len ];
638
642
You can’t perform that action at this time.
0 commit comments