Bug 77221 - Clear tx_flags when transhdrlen == 0 in ip_append_data without checking?
Summary: Clear tx_flags when transhdrlen == 0 in ip_append_data without checking?
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 07:46 UTC by yangzhe1990
Modified: 2014-07-17 14:30 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.14
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.