Module Name:    src
Committed By:   christos
Date:           Fri Mar 27 18:51:08 UTC 2015

Modified Files:
        src/external/bsd/dhcpcd/dist: if-bsd.c

Log Message:
cast htons() args.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/if-bsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/if-bsd.c
diff -u src/external/bsd/dhcpcd/dist/if-bsd.c:1.18 src/external/bsd/dhcpcd/dist/if-bsd.c:1.19
--- src/external/bsd/dhcpcd/dist/if-bsd.c:1.18	Thu Mar 26 06:26:37 2015
+++ src/external/bsd/dhcpcd/dist/if-bsd.c	Fri Mar 27 14:51:08 2015
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: if-bsd.c,v 1.18 2015/03/26 10:26:37 roy Exp $");
+ __RCSID("$NetBSD: if-bsd.c,v 1.19 2015/03/27 18:51:08 christos Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
@@ -388,7 +388,7 @@ if_sendrawpacket(const struct interface 
 
 	memset(&hw, 0, ETHER_HDR_LEN);
 	memset(&hw.ether_dhost, 0xff, ETHER_ADDR_LEN);
-	hw.ether_type = htons(protocol);
+	hw.ether_type = htons((uint16_t)protocol);
 	iov[0].iov_base = &hw;
 	iov[0].iov_len = ETHER_HDR_LEN;
 	iov[1].iov_base = UNCONST(data);
@@ -728,7 +728,7 @@ ifa_scope(struct sockaddr_in6 *sin, unsi
 	/* KAME based systems want to store the scope inside the sin6_addr
 	 * for link local addreses */
 	if (IN6_IS_ADDR_LINKLOCAL(&sin->sin6_addr)) {
-		uint16_t scope = htons(ifindex);
+		uint16_t scope = htons((uint16_t)ifindex);
 		memcpy(&sin->sin6_addr.s6_addr[2], &scope,
 		    sizeof(scope));
 	}

Reply via email to