3 @@ -389,7 +389,7 @@ static int set_env(char *name, char *val
7 - (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X",
8 + (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX",
12 @@ -447,7 +447,7 @@ static int set_envv6(char *name, char *v
16 - (void) snprintf(s, sizeof(s) - 1, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X",
17 + (void) snprintf(s, sizeof(s) - 1, "%.2hX-%.2hX-%.2hX-%.2hX-%.2hX-%.2hX",
21 @@ -958,7 +958,7 @@ static int set_macallowed(char *macallow
22 for(i = 0; i < strlen(p1); i++)
23 if(!isxdigit(p1[i])) p1[i] = 0x20;
25 - if(sscanf(p1, "%2x %2x %2x %2x %2x %2x",
26 + if(sscanf(p1, "%2hhx %2hhx %2hhx %2hhx %2hhx %2hhx",
27 &options.macok[options.macoklen][0],
28 &options.macok[options.macoklen][1],
29 &options.macok[options.macoklen][2],
30 @@ -973,7 +973,7 @@ static int set_macallowed(char *macallow
32 if(options.debug & DEBUG_CONF)
34 - printf("Macallowed address #%d: %.2X-%.2X-%.2X-%.2X-%.2X-%.2X\n",
35 + printf("Macallowed address #%d: %.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX\n",
37 options.macok[options.macoklen][0],
38 options.macok[options.macoklen][1],
41 @@ -178,7 +178,7 @@ static int redir_hextochar(char *src, in
49 for(n = 0 ; n < nb ; n++)
52 @@ -971,7 +971,7 @@ int radius_getattr(struct radius_packet_
56 - while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
57 + while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
59 else /* Need to check pack -> length */
61 @@ -992,7 +992,7 @@ int radius_getattr(struct radius_packet_
65 - while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
66 + while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
69 return -1; /* Not found */
70 @@ -1040,7 +1040,7 @@ int radius_getattrv6(struct radius_packe
74 - while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
75 + while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
77 else /* Need to check pack -> length */
79 @@ -1061,7 +1061,7 @@ int radius_getattrv6(struct radius_packe
83 - while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
84 + while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
87 return -1; /* Not found */
88 @@ -1090,7 +1090,7 @@ int radius_getattrv6(struct radius_packe
92 - while(offset < ntohs(pack->length));
93 + while(offset < (int)ntohs(pack->length));
95 if(0) printf("Count %d\n", count);
97 @@ -1903,7 +1903,7 @@ int radius_decaps(struct radius_t *this)
101 - if(ntohs(pack.length) != status)
102 + if((int)ntohs(pack.length) != status)
104 sys_err(LOG_WARNING, __FILE__, __LINE__, errno,
105 "Received radius packet with wrong length field %d != %d!",
106 @@ -2107,7 +2107,7 @@ int radius_proxy_ind(struct radius_t *th
110 - if(ntohs(pack.length) != status)
111 + if((int)ntohs(pack.length) != status)
113 sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
114 "Received radius packet with wrong length field %d != %d!",
117 @@ -240,7 +240,7 @@ static int dhcp_tcp_checkv6(struct dhcp_
118 struct dhcp_tcphdr_t *tcph = NULL;
121 - if(ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN))
122 + if((int)ntohs(pack->ip6h.payload_length) > (length - DHCP_ETH_HLEN))
123 return -1; /* Wrong length of packet */
125 tcp_len = ntohs(pack->ip6h.payload_length);
126 @@ -347,7 +347,7 @@ static int dhcp_tcp_check(struct dhcp_ip
127 struct dhcp_tcphdr_t *tcph;
130 - if(ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN))
131 + if((int)ntohs(pack->iph.tot_len) > (length - DHCP_ETH_HLEN))
132 return -1; /* Wrong length of packet */
134 tcp_len = ntohs(pack->iph.tot_len) - pack->iph.ihl * 4;