From 686631085227a174ff1ca17239af20720bba0d44 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 18 Sep 2007 13:18:17 -0700 Subject: [PATCH] --- yaml --- r: 65081 b: refs/heads/master c: a14d6abc947a5504e8d0f934da57b5bc4cea59ca h: refs/heads/master i: 65079: 67488d8335d393261bd88971fbd5538640735da5 v: v3 --- [refs] | 2 +- trunk/drivers/net/pppol2tp.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 34c17a5171ae..346816f4c1df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 21d0c83302fb742b7ffb6089d40196166102f5ed +refs/heads/master: a14d6abc947a5504e8d0f934da57b5bc4cea59ca diff --git a/trunk/drivers/net/pppol2tp.c b/trunk/drivers/net/pppol2tp.c index 266e8b38fe10..ed8ead432d77 100644 --- a/trunk/drivers/net/pppol2tp.c +++ b/trunk/drivers/net/pppol2tp.c @@ -1326,12 +1326,14 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id, goto err; } + sk = sock->sk; + /* Quick sanity checks */ - err = -ESOCKTNOSUPPORT; - if (sock->type != SOCK_DGRAM) { + err = -EPROTONOSUPPORT; + if (sk->sk_protocol != IPPROTO_UDP) { PRINTK(-1, PPPOL2TP_MSG_CONTROL, KERN_ERR, - "tunl %hu: fd %d wrong type, got %d, expected %d\n", - tunnel_id, fd, sock->type, SOCK_DGRAM); + "tunl %hu: fd %d wrong protocol, got %d, expected %d\n", + tunnel_id, fd, sk->sk_protocol, IPPROTO_UDP); goto err; } err = -EAFNOSUPPORT; @@ -1343,7 +1345,6 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id, } err = -ENOTCONN; - sk = sock->sk; /* Check if this socket has already been prepped */ tunnel = (struct pppol2tp_tunnel *)sk->sk_user_data;