diff mbox

[net-next,3/3] tun: Fix copy/paste error in tun_get_user

Message ID 1244230546.1526.78.camel@w-sridhar.beaverton.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sridhar Samudrala June 5, 2009, 7:35 p.m. UTC
Use the right structure while incrementing the offset in tun_get_user.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

 	if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michael S. Tsirkin June 6, 2009, 9:08 p.m. UTC | #1
On Fri, Jun 05, 2009 at 12:35:46PM -0700, Sridhar Samudrala wrote:
> Use the right structure while incrementing the offset in tun_get_user.
> 
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 4cda69b..15cfcb2 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -567,7 +567,7 @@ static __inline__ ssize_t tun_get_user(struct
> tun_struct *tun,
> 
>  		if (gso.hdr_len > len)
>  			return -EINVAL;
> -		offset += sizeof(pi);
> +		offset += sizeof(gso);
>  	}
> 
>  	if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
>
David Miller June 8, 2009, 7:29 a.m. UTC | #2
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Sun, 7 Jun 2009 00:08:33 +0300

> On Fri, Jun 05, 2009 at 12:35:46PM -0700, Sridhar Samudrala wrote:
>> Use the right structure while incrementing the offset in tun_get_user.
>> 
>> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 4cda69b..15cfcb2 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -567,7 +567,7 @@  static __inline__ ssize_t tun_get_user(struct
tun_struct *tun,

 		if (gso.hdr_len > len)
 			return -EINVAL;
-		offset += sizeof(pi);
+		offset += sizeof(gso);
 	}