Bug 77221

Summary: Clear tx_flags when transhdrlen == 0 in ip_append_data without checking?
Product: Networking Reporter: yangzhe1990
Component: IPV4Assignee: Stephen Hemminger (stephen)
Status: NEW ---    
Severity: normal CC: willemb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.14 Subsystem:
Regression: No Bisected commit-id:

Description yangzhe1990 2014-06-03 07:46:12 UTC
Hi,

While I was tracing why TX_TIMESTAMP won't work with RAW socket and Non-privileged ICMP socket, I found that both raw.c and ping.c call ip_append_data with transhdrlen set to 0, and in ip_append_data, there are timestamp specific 

924                                 else
925                                         /* only the initial fragment is
926                                            time stamped */
927                                         cork->tx_flags = 0;

To my understanding in ping.c transhdrlen should be set to sizeof(struct icmphdr) just like what icmp.c did.

And for RAW socket, since there are no concept of fragmentation, should we check the protocol and only set cork->tx_flags = 0 when the socket_type != SOCK_RAW
Comment 1 Willem de Bruijn 2014-07-17 14:30:40 UTC
http://patchwork.ozlabs.org/patch/369771/ should fix this issue. It was applied to net-next, so is expected in 3.17-rc1. Please test it if you can. Thanks for the report.