If I build ICMP echo request header and put it in char array by copying it with bcopy(&icmp_h, buf, sizeof(icmp_h)),then server won't send back echo reply.
I know there are other ways to put icmp header in char array,but I'd like to know why I can't use bcopy().From what I understand,it copies number of bytes and it doesn't care what type those bytes represent(it just stores them in same format to destination).
I don't see any difference between the way the following code stores bytes into buf and how bcopy() stores them,but this seems to do the trick while bcopy() causes server to not send back reply
thank youPHP Code:
struct icmp *ICMP=(struct icmp *) buf;