diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index e32950e95..031bf09de 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -2612,7 +2612,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) { u32 recv; u32 trans; } *icmptstamp = NULL; - struct icmp_mask{ + struct icmp_amask{ u8 type; u8 code; u16 checksum; @@ -2857,7 +2857,7 @@ const char *ippackethdrinfo(const u8 *packet, u32 len, int detail) { case 17: case 18: Snprintf(icmptype, sizeof(icmptype), "Address mask %s", (icmppkt->type == 17)? "request" : "reply"); - icmpmask = (struct icmp_mask *) icmppkt; + icmpmask = (struct icmp_amask *) icmppkt; inet_ntop(AF_INET, &icmpmask->mask, auxbuff, sizeof(auxbuff)); Snprintf(icmpfields, sizeof(icmpfields), "id=%u seq=%u mask=%s", ntohs(ping->id), ntohs(ping->seq), auxbuff); diff --git a/tcpip.cc b/tcpip.cc index 4359c4886..6c5835b15 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -553,18 +553,18 @@ static u16 ipv6_cksum(const struct in6_addr *src, const struct in6_addr *dst, // fill ip header. no error check. // This function is also changing what's needed from host to network order. static inline int fill_ip_raw(struct ip *ip, int packetlen, const u8 *ipopt, - int ipoptlen, int ip_tos, int ip_id, - int ip_off, int ip_ttl, int ip_p, + int ipoptlen, int tos, int id, + int off, int ttl, int p, const struct in_addr *ip_src, const struct in_addr *ip_dst) { ip->ip_v = 4; ip->ip_hl = 5 + (ipoptlen / 4); - ip->ip_tos = ip_tos; + ip->ip_tos = tos; ip->ip_len = htons(packetlen); - ip->ip_id = htons(ip_id); - ip->ip_off = htons(ip_off); - ip->ip_ttl = ip_ttl; - ip->ip_p = ip_p; + ip->ip_id = htons(id); + ip->ip_off = htons(off); + ip->ip_ttl = ttl; + ip->ip_p = p; ip->ip_src.s_addr = ip_src->s_addr; ip->ip_dst.s_addr = ip_dst->s_addr;