Branch oldpackages for 14.07
[14.07/packages.git] / net / pepperspot / patches / 102-no_warnings.patch
1 --- a/src/pepper.c
2 +++ b/src/pepper.c
3 @@ -389,7 +389,7 @@ static int set_env(char *name, char *val
4    }
5    else if(mac != NULL)
6    {
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",
9                      mac[0], mac[1],
10                      mac[2], mac[3],
11                      mac[4], mac[5]);
12 @@ -447,7 +447,7 @@ static int set_envv6(char *name, char *v
13    }
14    else if(mac != NULL)
15    {
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",
18                      mac[0], mac[1],
19                      mac[2], mac[3],
20                      mac[4], mac[5]);
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;
24  
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
31      }
32      if(options.debug & DEBUG_CONF)
33      {
34 -      printf("Macallowed address #%d: %.2X-%.2X-%.2X-%.2X-%.2X-%.2X\n",
35 +      printf("Macallowed address #%d: %.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX-%.2hhX\n",
36               options.macoklen,
37               options.macok[options.macoklen][0],
38               options.macok[options.macoklen][1],
39 --- a/src/redir.c
40 +++ b/src/redir.c
41 @@ -178,7 +178,7 @@ static int redir_hextochar(char *src, in
42  {
43    char x[3];
44    int n = 0;
45 -  int y = 0;
46 +  unsigned int y = 0;
47    int nb = len / 2;
48  
49    for(n = 0 ; n < nb ; n++)
50 --- a/src/radius.c
51 +++ b/src/radius.c
52 @@ -971,7 +971,7 @@ int radius_getattr(struct radius_packet_
53        }
54        offset +=  t->l;
55      }
56 -    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
57 +    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
58    }
59    else       /* Need to check pack -> length */
60    {
61 @@ -992,7 +992,7 @@ int radius_getattr(struct radius_packet_
62        }
63        offset +=  t->l;
64      }
65 -    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
66 +    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
67    }
68  
69    return -1; /* Not found */
70 @@ -1040,7 +1040,7 @@ int radius_getattrv6(struct radius_packe
71        }
72        offset +=  t->l;
73      }
74 -    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
75 +    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
76    }
77    else       /* Need to check pack -> length */
78    {
79 @@ -1061,7 +1061,7 @@ int radius_getattrv6(struct radius_packe
80        }
81        offset +=  t->l;
82      }
83 -    while(offset < (ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
84 +    while(offset < ((int)ntohs(pack->length) - RADIUS_HDRSIZE)); /* TODO */
85    }
86  
87    return -1; /* Not found */
88 @@ -1090,7 +1090,7 @@ int radius_getattrv6(struct radius_packe
89      }
90      offset +=  2 + t->l;
91    }
92 -  while(offset < ntohs(pack->length));
93 +  while(offset < (int)ntohs(pack->length));
94  
95    if(0) printf("Count %d\n", count);
96    return count;
97 @@ -1903,7 +1903,7 @@ int radius_decaps(struct radius_t *this)
98      return -1;
99    }
100  
101 -  if(ntohs(pack.length) != status)
102 +  if((int)ntohs(pack.length) != status)
103    {
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
107      return -1;
108    }
109  
110 -  if(ntohs(pack.length) != status)
111 +  if((int)ntohs(pack.length) != status)
112    {
113      sys_err(LOG_WARNING, __FILE__, __LINE__, 0,
114              "Received radius packet with wrong length field %d != %d!",
115 --- a/src/dhcp.c
116 +++ b/src/dhcp.c
117 @@ -240,7 +240,7 @@ static int dhcp_tcp_checkv6(struct dhcp_
118    struct dhcp_tcphdr_t *tcph = NULL;
119    int tcp_len = 0;
120  
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 */
124  
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;
128    int tcp_len = 0;
129  
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 */
133  
134    tcp_len = ntohs(pack->iph.tot_len) - pack->iph.ihl * 4;