netdev
[Top] [All Lists]

Re: [RFC] inet_opt space saving?

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [RFC] inet_opt space saving?
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Thu, 16 Sep 2004 13:44:05 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040914151232.115c3eca@xxxxxxxxxxxxxxxxxxxxx>
References: <20040914151232.115c3eca@xxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Tue, 14 Sep 2004 15:12:32 -0700
Stephen Hemminger <shemminger@xxxxxxxx> wrote:

> It looks like there are lots of wasted bytes in the inet information
> per socket. Does this look right? 

I see one error at least.

> +                             cmsg_flags: 4,

There are 5 bits, not 4.

#define IP_CMSG_PKTINFO         1
#define IP_CMSG_TTL             2
#define IP_CMSG_TOS             4
#define IP_CMSG_RECVOPTS        8
#define IP_CMSG_RETOPTS         16

This is also the number of right shifts, plus one, made
by ip_cmsg_recv().

The rest of your transformations look perfectly fine.

<Prev in Thread] Current Thread [Next in Thread>