RFC 950, page 11:
A gateway receiving an address mask request should return it with the address mask field set to the 32-bit mask of the bits identifying the subnet and network, for the subnet on which the request was received.
I want to fetch a host address mask and build a ICMP address mask request packet to local gateway, and other IP. I use tcpdump -i eth0 icmp
and find ICMP address mask request
packet has been sent.But I haven't found any reponse. Is anything wrong? The main code is:
struct icmp *picmp;
/* ICMP header */
picmp = (icmp_t *)send_buf;
picmp->icmp_type = ICMP_MASKREQ; // Address Mask Request
picmp->icmp_code = 0;
picmp->icmp_id = pid;
picmp->icmp_seq = npkt++;
len = 12; // ICMP header length
picmp->icmp_cksum = 0;
picmp->icmp_cksum = in_cksum((u_short *)picmp, len);
sendto(sock_fd, send_buf, len, 0, pr->p_addr, pr->addr_len);