瀏覽代碼

udp: do not expect udp headers on ioctl SIOCINQ

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")

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn 9 年之前
父節點
當前提交
9f9a45beaa
共有 1 個文件被更改,包括 0 次插入2 次删除
  1. 0 2
      net/ipv4/udp.c

+ 0 - 2
net/ipv4/udp.c

@@ -1282,8 +1282,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 			 * of this packet since that is all
 			 * of this packet since that is all
 			 * that will be read.
 			 * that will be read.
 			 */
 			 */
-			amount -= sizeof(struct udphdr);
-
 		return put_user(amount, (int __user *)arg);
 		return put_user(amount, (int __user *)arg);
 	}
 	}