l3num is u_int16_t

Yasuyuki KOZAKAI yasuyuki.kozakai at toshiba.co.jp
Tue Dec 20 06:25:34 CET 2005


From: Pablo Neira Ayuso <pablo at eurodev.net>
Date: Mon, 19 Dec 2005 19:13:29 +0100

> 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.

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



More information about the netfilter-devel mailing list