7.11 commit

This commit is contained in:
wangyu 2017-07-11 18:05:00 +08:00 committed by wangyu
parent ab2f1bfa93
commit efd8d7378b

@ -682,11 +682,20 @@ int on_raw_recv()
size = recvfrom(raw_recv_fd, buf, buf_len, 0 ,&saddr , &saddr_size);
if(buf[13]!=8||buf[14]!=0)
{
printf("not an ipv4 packet!\n");
fflush(stdout);
return 0;
}
char *ip_data=buf+14;
struct iphdr *iph = (struct iphdr *) (ip_data);
if (!(iph->ihl > 0 && iph->ihl < (MTU)/4)) {
printf("iph ihl error");
fflush(stdout);