* [RFC] inet_opt space saving?
@ 2004-09-14 22:12 Stephen Hemminger
2004-09-16 20:44 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-09-14 22:12 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
It looks like there are lots of wasted bytes in the inet information
per socket. Does this look right?
diff -Nru a/include/linux/ip.h b/include/linux/ip.h
--- a/include/linux/ip.h 2004-09-14 15:13:14 -07:00
+++ b/include/linux/ip.h 2004-09-14 15:13:14 -07:00
@@ -114,18 +114,18 @@
__u16 dport; /* Destination port */
__u16 num; /* Local port */
__u32 saddr; /* Sending source */
- int uc_ttl; /* Unicast TTL */
- int tos; /* TOS */
- unsigned cmsg_flags;
struct ip_options *opt;
__u16 sport; /* Source port */
- unsigned char hdrincl; /* Include headers ? */
- __u8 mc_ttl; /* Multicasting TTL */
- __u8 mc_loop; /* Loopback */
- __u8 pmtudisc;
__u16 id; /* ID counter for DF pkts */
- unsigned recverr : 1,
- freebind : 1;
+ __s16 uc_ttl; /* Unicast TTL */
+ __u8 mc_ttl; /* Multicasting TTL */
+ __u8 tos; /* TOS */
+ unsigned mc_loop: 1, /* Loopback */
+ hdrincl: 1, /* Include headers ? */
+ recverr: 1,
+ freebind: 1,
+ cmsg_flags: 4,
+ pmtudisc: 2;
int mc_index; /* Multicast device index */
__u32 mc_addr;
struct ip_mc_socklist *mc_list; /* Group array */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] inet_opt space saving?
2004-09-14 22:12 [RFC] inet_opt space saving? Stephen Hemminger
@ 2004-09-16 20:44 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-09-16 20:44 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
On Tue, 14 Sep 2004 15:12:32 -0700
Stephen Hemminger <shemminger@osdl.org> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-16 20:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-14 22:12 [RFC] inet_opt space saving? Stephen Hemminger
2004-09-16 20:44 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).