Lines 161-167
Link Here
|
161 |
|
161 |
|
162 |
switch(type) { |
162 |
switch(type) { |
163 |
|
163 |
|
164 |
case DLT_NULL: |
164 |
case DLT_NULL: header_len=4; break; |
|
|
165 |
|
165 |
case DLT_SLIP: |
166 |
case DLT_SLIP: |
166 |
case DLT_RAW: break; |
167 |
case DLT_RAW: break; |
167 |
|
168 |
|
Lines 1199-1209
Link Here
|
1199 |
/* Whoops, IP header ends past end_ptr */ |
1200 |
/* Whoops, IP header ends past end_ptr */ |
1200 |
if ((_u8*)(iph + 1) > end_ptr) return; |
1201 |
if ((_u8*)(iph + 1) > end_ptr) return; |
1201 |
|
1202 |
|
1202 |
if ( ((iph->ihl & 0x40) != 0x40) || iph->proto != IPPROTO_TCP) { |
1203 |
if ( iph->proto != IPPROTO_TCP) { |
1203 |
debug("[!] WARNING: Non-IP packet received. Bad header_len!\n"); |
1204 |
debug("[!] WARNING: Non-IP packet received.\n"); |
1204 |
return; |
1205 |
return; |
1205 |
} |
1206 |
} |
1206 |
|
1207 |
|
|
|
1208 |
if ( ((iph->ihl & 0x40) != 0x40) ) { |
1209 |
debug("[!] WARNING: Bad header_len!\n"); |
1210 |
return; |
1211 |
} |
1207 |
/* If the declared length is shorter than the snapshot (etherleak |
1212 |
/* If the declared length is shorter than the snapshot (etherleak |
1208 |
or such), truncate this bad boy. */ |
1213 |
or such), truncate this bad boy. */ |
1209 |
|
1214 |
|