summaryrefslogtreecommitdiff
path: root/usr.sbin/mrouted/igmp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-30 22:43:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-30 22:43:18 +0000
commit186e1e82c6eb940fd5ddb8bf8caafaec5e7b7424 (patch)
tree5c17401edb72caf5fb77fcca8cb095042efe0b24 /usr.sbin/mrouted/igmp.c
parent38060a534e240914301c04a72f34e0f3a2e07da5 (diff)
deal with IP_HDRINCL option network byte order change; lidl@va.pubnix.com
Diffstat (limited to 'usr.sbin/mrouted/igmp.c')
-rw-r--r--usr.sbin/mrouted/igmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c
index 1b623ba42ff..2efb6d319b3 100644
--- a/usr.sbin/mrouted/igmp.c
+++ b/usr.sbin/mrouted/igmp.c
@@ -55,7 +55,7 @@ init_igmp()
ip->ip_hl = sizeof(struct ip) >> 2;
ip->ip_v = IPVERSION;
ip->ip_tos = 0;
- ip->ip_off = 0;
+ ip->ip_off = htons(0);
ip->ip_p = IPPROTO_IGMP;
ip->ip_ttl = MAXTTL; /* applies to unicasts only */
@@ -314,7 +314,7 @@ send_igmp(src, dst, type, code, group, datalen)
ip = (struct ip *)send_buf;
ip->ip_src.s_addr = src;
ip->ip_dst.s_addr = dst;
- ip->ip_len = MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen;
+ ip->ip_len = htons(MIN_IP_HEADER_LEN + IGMP_MINLEN + datalen);
igmp = (struct igmp *)(send_buf + MIN_IP_HEADER_LEN);
igmp->igmp_type = type;
@@ -338,7 +338,7 @@ send_igmp(src, dst, type, code, group, datalen)
sdst.sin_len = sizeof(sdst);
#endif
sdst.sin_addr.s_addr = dst;
- if (sendto(igmp_socket, send_buf, ip->ip_len, 0,
+ if (sendto(igmp_socket, send_buf, ntohs(ip->ip_len), 0,
(struct sockaddr *)&sdst, sizeof(sdst)) < 0) {
if (errno == ENETDOWN)
check_vif_state();