lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] byte order, packing, optimizations


From: address@hidden
Subject: Re: [lwip-devel] byte order, packing, optimizations
Date: Sun, 14 Feb 2010 14:58:40 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

Stéphane Lesage wrote:
Yeah that's more elegant when having 1 byte packing...
The problem is that people who optimize will use 2 bytes or no packing,
and it won't work for them.
Oh, you're right, these structs aren't aligned, I didn't think of that... However, that's an example of what can go wrong when "optimizing" and using pack(2): you'd need some kind check (e.g. LWIP_ASSERT for alignment) to make sure that future changes don't break the alignment assumptions.
I was preparing another patch for
- combine load/stores and ntohX/htonX (lwip packing)
Could you explain that? I'd like to make sure it's OK before you actually do the work to prepare a patch.
- other macros for reading/writing unaligned words for such protocols
Hmm, I'm not sure I understand you correctly, but we already discussed such macros (for processors/compilers that can't do struct packing) and decided we don't want to support this...
  >  >  - change ip_addr_is_broadcast to a more efficient macro
  >  >
  >  That change actually changes the behaviour of ip_addr_is_broadcast().
  >  Was that intended? I don't think the change is correct, or is it?

I removed:
- the broadcast with 0.0.0.0 "old style comment", is it really used ?
It is! DHCP/Bootp is allowed to use this.
- comparison to netif address, useful only when mask=255.255.255.255 ->
the netif should not support broadcast
Don't know about that...

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]