我真的不明白写这篇文章的兴趣
struct iphdr *ip;
struct icmphdr *icmp;
char *packet;
packet = malloc(sizeof(struct iphdr) + sizeof(struct icmphdr));
ip = (struct iphdr *)packet;
为什么要packet
作为char
, 并且,假设为什么不写packet = malloc(sizeof(struct iphdr));
或者更简单ip = malloc(sizeof(struct iphdr));
呢?