Skip to contentSkip to conversation

fix two more udp pull header issues

PATCH Applied Willem de Bruijn 2 participants 4 messages Apr 7, 2016 – Apr 14, 2016

Subsystems (3)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/2 udp: do not expect udp headers on ioctl SIOCINQ

In reply to Willem de Bruijn

From: Willem de Bruijn <[email protected]>

On udp sockets, ioctl SIOCINQ returns the payload size of the first packet. Since commit e6afc8ace6dd pulled the headers, the result is incorrect when subtracting header length. Remove that operation.

Fixes e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")
---
 net/ipv4/udp.c | 2 --
 1 file changed, 2 deletions(-)
net/ipv4/udp.c +0 -2
index 3563788d..d2d294b 100644
@@ -1282,8 +1282,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 			 * of this packet since that is all
 			 * that will be read.
 			 */
-			amount -= sizeof(struct udphdr);
-
 		return put_user(amount, (int __user *)arg);
 	}
 
Signature · 1 line
2.8.0.rc3.226.g39d4020

Willem de Bruijn

author maintainer
#0 lore raw

cover fix two more udp pull header issues

From: Willem de Bruijn <[email protected]>

Follow up patches to the fixes to RxRPC and SunRPC. A scan of the code showed two other interfaces that expect UDP packets to have a udphdr when queued: read packet length with ioctl SIOCINQ and receive payload checksum with socket option IP_CHECKSUM.

Willem de Bruijn (2):
udp: do not expect udp headers on ioctl SIOCINQ
udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM

 net/ipv4/ip_sockglue.c | 3 ++-
 net/ipv4/udp.c         | 4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.8.0.rc3.226.g39d4020
maintainer Applied
#2 lore raw

From: Willem de Bruijn <[email protected]>
Date: Thu, 7 Apr 2016 18:12:57 -0400

Quoted 4 lines

Follow up patches to the fixes to RxRPC and SunRPC. A scan of the code showed two other interfaces that expect UDP packets to have a udphdr when queued: read packet length with ioctl SIOCINQ and receive payload checksum with socket option IP_CHECKSUM.

As we are seeing, lots of places depend upon the old way of queueing up UDP frames. :-/

Applied, thanks for mopping all of this up.

author maintainer
#3 lore raw
Quoted 10 lines · David Miller

From: Willem de Bruijn <[email protected]>
Date: Thu, 7 Apr 2016 18:12:57 -0400

Quoted 4 lines

Follow up patches to the fixes to RxRPC and SunRPC. A scan of the code showed two other interfaces that expect UDP packets to have a udphdr when queued: read packet length with ioctl SIOCINQ and receive payload checksum with socket option IP_CHECKSUM.

As we are seeing, lots of places depend upon the old way of queueing up UDP frames. :-/

Yes, I greatly underestimated that. I should have done a much more thorough scan before submitting. Hopefully we've caught them all now.

Quoted 1 line

Applied, thanks for mopping all of this up.

Apologies for breaking it in the first place!