[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t)
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t) |
Date: |
Fri, 29 Jan 2010 15:57:35 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2) Gecko/20100115 Firefox/3.6 |
Follow-up Comment #10, bug #27352 (project lwip):
> Or I'm missing your point?
I guess so: when receiving UDP or RAW packets, we are passing the pointer to
a struct ip_addr and this pointer points into the pbuf. Now if the address is
unaligned in that packet, the information to access it packed is gone once we
use a normal pointer:
See this code from udp_input():
pcb->recv(pcb->recv_arg, pcb, p, &iphdr->src, src);
The application recv callback gets a 'struct ip_addr*' and wouldn't know that
this pointer has to be accessed packed!
> Doesn't everyone using 32-bit aligned processors use ETH_PAD 2
> to align everything?
That doesn't work for me as the DMA of the MAC would have to handle copying
from 32-bit aligned (internal buffer of the MAC) to 16-bit aligned (pbuf,
because of the 2-byte ETH_PAD).
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?27352>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Simon Goldschmidt, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Bill Auerbach, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Simon Goldschmidt, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Bill Auerbach, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t),
Simon Goldschmidt <=
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Bill Auerbach, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Simon Goldschmidt, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Mike Kleshov, 2010/01/29
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Kieran Mansley, 2010/01/31
- [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t), Simon Goldschmidt, 2010/01/31