All of lore.kernel.org
 help / color / mirror / Atom feed
* Something like a bug
@ 2008-04-14  7:27 Rick Xu
  2008-04-15 15:47 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 7+ messages in thread
From: Rick Xu @ 2008-04-14  7:27 UTC (permalink / raw)
  To: netfilter-devel

-- 
Thanks,
Rick
Hi, I found something strange in libnfnetlink.c, have a look at the
following function:

int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
               const void *data, int alen)
{
 ......

    if ((NFA_OK(nfa, nfa->nfa_len) + len) > maxlen) {
        errno = ENOSPC;
        return -1;
    }

    subnfa = (struct nfattr *)(((char *)nfa) + NFA_OK(nfa, nfa->nfa_len));

.....
}

NFA_OK looks so weird here. I think it should be:
int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
               const void *data, int alen)
{
 ......

    if ( NFA_ALIGN(nfa->nfa_len) + NFA_LENGTH(len) > maxlen) {
        errno = ENOSPC;
        return -1;
    }

    subnfa = (struct nfattr *)(((char *)nfa) + NFA_ALIGN( nfa->nfa_len));

.....
}

Please kindly correct me if I made a mistake.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-16 15:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14  7:27 Something like a bug Rick Xu
2008-04-15 15:47 ` Pablo Neira Ayuso
2008-04-15 16:00   ` Rick Xu
2008-04-15 17:21     ` Jan Engelhardt
2008-04-16 13:47       ` Pablo Neira Ayuso
2008-04-16 14:48         ` Jan Engelhardt
2008-04-16 15:00         ` remove deprecated use of AC_INIT_AUTOMAKE [was Re: Something like a bug] Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.