Skip to contentSkip to conversation

l3num is u_int16_t

DISCUSSION Pablo Neira Ayuso 2 participants 2 messages Dec 19, 2005 – Dec 20, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Yasuyuki,

/* The manipulable part of the tuple. */
struct nf_conntrack_man

{
        union nf_conntrack_man_l3proto u3;
        union nf_conntrack_man_proto u;
        /* Layer 3 protocol */
        u_int16_t l3num;
};

struct nfgenmsg {

        u_int8_t  nfgen_family;         /* AF_xxx */
        u_int8_t  version;              /* nfnetlink version */
        u_int16_t res_id;               /* resource id */

} __attribute__ ((packed));

There's some inconsistency here: why l3num is u_int16_t but nfgen_family in u_int8_t? AFAIK, both designates the same thing, the layer 3 protocol number.

Signature · 1 line
Pablo
#1 lore raw

From: Pablo Neira Ayuso <[email protected]>
Date: Mon, 19 Dec 2005 19:13:29 +0100

Quoted 12 lines

Hi Yasuyuki,

/* The manipulable part of the tuple. */
struct nf_conntrack_man

{
        union nf_conntrack_man_l3proto u3;
        union nf_conntrack_man_proto u;
        /* Layer 3 protocol */
        u_int16_t l3num;
};

struct nfgenmsg {

Quoted 8 lines
        u_int8_t  nfgen_family;         /* AF_xxx */
        u_int8_t  version;              /* nfnetlink version */
        u_int16_t res_id;               /* resource id */

} __attribute__ ((packed));

There's some inconsistency here: why l3num is u_int16_t but nfgen_family in u_int8_t? AFAIK, both designates the same thing, the layer 3 protocol number.

I just copied protonum, in old nf_conntrack ;)
I think we can change it to u_int8_t because this definition is for only kernel. The my remaind concern is alignment. Is there any reason that we need to add "u_int8_t pad" after l3num ?

-- Yasuyuki Kozakai