summaryrefslogtreecommitdiffstats
path: root/kernel/net/atm
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/atm')
-rw-r--r--kernel/net/atm/br2684.c9
-rw-r--r--kernel/net/atm/clip.c3
-rw-r--r--kernel/net/atm/common.c4
-rw-r--r--kernel/net/atm/common.h2
-rw-r--r--kernel/net/atm/pvc.c2
-rw-r--r--kernel/net/atm/svc.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/kernel/net/atm/br2684.c b/kernel/net/atm/br2684.c
index cc78538d1..aa0047c5c 100644
--- a/kernel/net/atm/br2684.c
+++ b/kernel/net/atm/br2684.c
@@ -802,13 +802,10 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
(brdev->payload == p_bridged) ? "bridged" : "routed",
brvcc->copies_failed, brvcc->copies_needed);
#ifdef CONFIG_ATM_BR2684_IPFILTER
-#define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
-#define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
if (brvcc->filter.netmask != 0)
- seq_printf(seq, " filter=%d.%d.%d.%d/"
- "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
-#undef bs
-#undef b1
+ seq_printf(seq, " filter=%pI4/%pI4\n",
+ &brvcc->filter.prefix,
+ &brvcc->filter.netmask);
#endif /* CONFIG_ATM_BR2684_IPFILTER */
}
return 0;
diff --git a/kernel/net/atm/clip.c b/kernel/net/atm/clip.c
index 17e55dfec..e07f551a8 100644
--- a/kernel/net/atm/clip.c
+++ b/kernel/net/atm/clip.c
@@ -317,6 +317,9 @@ static int clip_constructor(struct neighbour *neigh)
static int clip_encap(struct atm_vcc *vcc, int mode)
{
+ if (!CLIP_VCC(vcc))
+ return -EBADFD;
+
CLIP_VCC(vcc)->encap = mode;
return 0;
}
diff --git a/kernel/net/atm/common.c b/kernel/net/atm/common.c
index ed0466637..49a872db7 100644
--- a/kernel/net/atm/common.c
+++ b/kernel/net/atm/common.c
@@ -141,7 +141,7 @@ static struct proto vcc_proto = {
.release_cb = vcc_release_cb,
};
-int vcc_create(struct net *net, struct socket *sock, int protocol, int family)
+int vcc_create(struct net *net, struct socket *sock, int protocol, int family, int kern)
{
struct sock *sk;
struct atm_vcc *vcc;
@@ -149,7 +149,7 @@ int vcc_create(struct net *net, struct socket *sock, int protocol, int family)
sock->sk = NULL;
if (sock->type == SOCK_STREAM)
return -EINVAL;
- sk = sk_alloc(net, family, GFP_KERNEL, &vcc_proto);
+ sk = sk_alloc(net, family, GFP_KERNEL, &vcc_proto, kern);
if (!sk)
return -ENOMEM;
sock_init_data(sock, sk);
diff --git a/kernel/net/atm/common.h b/kernel/net/atm/common.h
index 4d6f5b206..959436b87 100644
--- a/kernel/net/atm/common.h
+++ b/kernel/net/atm/common.h
@@ -10,7 +10,7 @@
#include <linux/poll.h> /* for poll_table */
-int vcc_create(struct net *net, struct socket *sock, int protocol, int family);
+int vcc_create(struct net *net, struct socket *sock, int protocol, int family, int kern);
int vcc_release(struct socket *sock);
int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
diff --git a/kernel/net/atm/pvc.c b/kernel/net/atm/pvc.c
index ae0324021..040207ec3 100644
--- a/kernel/net/atm/pvc.c
+++ b/kernel/net/atm/pvc.c
@@ -136,7 +136,7 @@ static int pvc_create(struct net *net, struct socket *sock, int protocol,
return -EAFNOSUPPORT;
sock->ops = &pvc_proto_ops;
- return vcc_create(net, sock, protocol, PF_ATMPVC);
+ return vcc_create(net, sock, protocol, PF_ATMPVC, kern);
}
static const struct net_proto_family pvc_family_ops = {
diff --git a/kernel/net/atm/svc.c b/kernel/net/atm/svc.c
index 1ba23f501..3fa0a9ee9 100644
--- a/kernel/net/atm/svc.c
+++ b/kernel/net/atm/svc.c
@@ -660,7 +660,7 @@ static int svc_create(struct net *net, struct socket *sock, int protocol,
return -EAFNOSUPPORT;
sock->ops = &svc_proto_ops;
- error = vcc_create(net, sock, protocol, AF_ATMSVC);
+ error = vcc_create(net, sock, protocol, AF_ATMSVC, kern);
if (error)
return error;
ATM_SD(sock)->local.sas_family = AF_ATMSVC;