This patch fixes the warning related to signed and unsigned comparaison.
Signed-off-by: Eric Leblond <eric@inl.fr>
GET_VALUE(pi->input.keys, INKEY_RAW_PCKT).ptr;
void *nexthdr = (u_int32_t *)iph + iph->ihl;
- if (len < sizeof(struct iphdr) || len <= iph->ihl * 4)
+ if (len < sizeof(struct iphdr) || len <= (u_int32_t)(iph->ihl * 4))
return ULOGD_IRET_OK;
len -= iph->ihl * 4;
if (pp_is_valid(inp, KEY_CT_MARK)) {
if ((GET_VALUE(inp, KEY_CT_MARK).ui32 &
pi->config_kset->ces[MARK_MASK].u.value) !=
- pi->config_kset->ces[MARK_MARK].u.value
+ (u_int32_t) pi->config_kset->ces[MARK_MARK].u.value
) {
return ULOGD_IRET_STOP;
}
} else if (pp_is_valid(inp, KEY_OOB_MARK)) {
if ((GET_VALUE(inp, KEY_OOB_MARK).ui32 &
pi->config_kset->ces[MARK_MASK].u.value) !=
- pi->config_kset->ces[MARK_MARK].u.value
+ (u_int32_t) pi->config_kset->ces[MARK_MARK].u.value
) {
return ULOGD_IRET_STOP;
}
struct tcphdr *tcph;
unsigned int tcplen;
unsigned char *ptr, *begp, *pw_begp, *endp, *pw_endp;
- int len, pw_len, i, cont = 0;
+ int len, pw_len, cont = 0;
+ unsigned int i;
if (!IS_VALID(pi->input.keys[0]))
return ULOGD_IRET_STOP;
return -1;
}
nlh = (struct nlmsghdr *)buf;
- if (nlh->nlmsg_flags & MSG_TRUNC || status > len) {
+ if (nlh->nlmsg_flags & MSG_TRUNC || (size_t) status > len) {
ipulog_errno = IPULOG_ERR_TRUNC;
return -1;
}
char *args;
int err = 0;
int found = 0;
- int i;
+ unsigned int i;
char linebuf[LINE_LEN+1];
char *line = linebuf;
/* Parse this section until next section */
while (fgets(line, LINE_LEN, cfile))
{
- int i;
+ unsigned int i;
char wordbuf[LINE_LEN];
char *wordend;
/* second pass: copy key names */
llist_for_each_entry(pi_cur, &stack->list, list) {
- int i;
+ unsigned int i;
for (i = 0; i < pi_cur->plugin->output.num_keys; i++)
upi->input.keys[index++] = pi_cur->output.keys[i];
void get_plugin_infos(struct ulogd_plugin *me)
{
- int i;
+ unsigned int i;
printf("Name: %s\n", me->name);
if (me->config_kset) {
printf("Config options:\n");
/* iterate through plugin stack */
llist_for_each_entry(cur, &pi->stack->list, list) {
- int i;
+ unsigned int i;
/* iterate through input keys of pluginstance */
for (i = 0; i < cur->output.num_keys; i++) {
struct ulogd_pluginstance *pi;
llist_for_each_entry_reverse(pi, &start->list, list) {
- int i;
+ unsigned int i;
if ((void *)&pi->list == &stack->list)
return NULL;
}
/* no need to match keys */
} else {
- int j;
+ unsigned int j;
/* not the last one in the stack */
if (!(pi_cur->plugin->input.type &
{
struct db_instance *mi = (struct db_instance *) upi->private;
unsigned int size;
- int i;
+ unsigned int i;
char *table = table_ce(upi->config_kset).u.string;
char *procedure = procedure_ce(upi->config_kset).u.string;
static int __interp_db(struct ulogd_pluginstance *upi)
{
struct db_instance *di = (struct db_instance *) &upi->private;
- int i;
+ unsigned int i;
di->stmt_ins = di->stmt_val;