udp: do not expect udp headers on ioctl SIOCINQ
authorWillem de Bruijn <willemb@google.com>
Thu, 7 Apr 2016 22:12:58 +0000 (18:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Apr 2016 02:24:52 +0000 (22:24 -0400)
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>
net/ipv4/udp.c

index 3563788d064fb2dd1a34398ae1dd90766d7f4f1d..d2d294b0a1f1587c4290379d3c78ba9a4a8e281c 100644 (file)
@@ -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);
        }