On Sun, 2012-04-22 at 14:48 -0700, Dave Täht wrote:
> 
> + 
> +-#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
> ++#define tcp_flag_word2(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
> ++#define tcp_flag_word(tp) ( __get_unaligned_cpu32(&(((union tcp_word_hdr 
> *)(tp))->words [3])))

Ewww. And didn't you already make that union __packed anyway? 

> +diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> +index 22ef5f9..bf3f773 100644
> +--- a/net/ipv4/tcp.c
> ++++ b/net/ipv4/tcp.c
> +@@ -2834,7 +2834,7 @@ found:
> + 
> +       p = *head;
> +       th2 = tcp_hdr(p);
> +-      tcp_flag_word(th2) |= flags & (TCP_FLAG_FIN | TCP_FLAG_PSH);
> ++      tcp_flag_word2(th2) = tcp_flag_word(th2) | flags & (TCP_FLAG_FIN | 
> TCP_FLAG_PSH);

net/ipv4/tcp.c: In function 'tcp_gro_receive':
net/ipv4/tcp.c:2837:82: warning: suggest parentheses around arithmetic in 
operand of '|' [-Wparentheses]

Have you posted these patches to the netdev list? And is the response
going to be "just make sure your network devices are receiving packets
into sensibly-aligned buffers, and none of this is necessary"?

There's a reason a lot of Ethernet drivers pad the start of their skb by
2 bytes before receiving the packet... 

-- 
dwmw2

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to