|
|
* since p->iph will be pointing to this inner IP | * since p->iph will be pointing to this inner IP |
*/ | */ |
if (p->greh != NULL) | if (p->greh != NULL) |
|
{ |
p->ip_options_data = NULL; | p->ip_options_data = NULL; |
|
p->ip_options_len = 0; |
|
memset(&(p->ip_options[0]), 0, sizeof(p->ip_options)); |
|
p->ip_lastopt_bad = 0; |
|
} |
|
|
#endif | #endif |
| |
p->ip_option_count = 0; | p->ip_option_count = 0; |
|
|
u_int16_t uhlen; | u_int16_t uhlen; |
struct pseudoheader ph; | struct pseudoheader ph; |
| |
if(len < sizeof(UDPHdr)) |
if(len < GRE_HEADER_LEN) |
{ | { |
if(pv.verbose_flag) | if(pv.verbose_flag) |
{ | { |
|
|
} | } |
} | } |
| |
payload_len = len - hlen; |
if (hlen > len) |
|
|
if (payload_len < 0) |
|
{ | { |
if(pv.verbose_flag) | if(pv.verbose_flag) |
ErrorMessage("GRE header length > rest of packet length"); | ErrorMessage("GRE header length > rest of packet length"); |
|
|
return; | return; |
} | } |
| |
|
payload_len = len - hlen; |
|
|
/* send to next protocol decoder */ | /* send to next protocol decoder */ |
/* As described in RFC 2784 the possible protocols are listed in | /* As described in RFC 2784 the possible protocols are listed in |
* RFC 1700 under "ETHER TYPES" | * RFC 1700 under "ETHER TYPES" |