[AF_PACKET]: Kill CONFIG_PACKET_SOCKET.
Always set, but af_packet.c, not by the Kconfig subsystem, so just get rid of it. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8c7fc03e27
commit
be02097cf6
@ -83,8 +83,6 @@
|
|||||||
#include <net/inet_common.h>
|
#include <net/inet_common.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CONFIG_SOCK_PACKET 1
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Assumptions:
|
Assumptions:
|
||||||
- if device has no dev->hard_header routine, it adds and removes ll header
|
- if device has no dev->hard_header routine, it adds and removes ll header
|
||||||
@ -246,7 +244,6 @@ static void packet_sock_destruct(struct sock *sk)
|
|||||||
|
|
||||||
static const struct proto_ops packet_ops;
|
static const struct proto_ops packet_ops;
|
||||||
|
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
static const struct proto_ops packet_ops_spkt;
|
static const struct proto_ops packet_ops_spkt;
|
||||||
|
|
||||||
static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
|
static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
|
||||||
@ -418,7 +415,6 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
|
|||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
|
static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
|
||||||
unsigned int res)
|
unsigned int res)
|
||||||
@ -917,8 +913,6 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
|
|||||||
* Bind a packet socket to a device
|
* Bind a packet socket to a device
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
|
|
||||||
static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||||
{
|
{
|
||||||
struct sock *sk=sock->sk;
|
struct sock *sk=sock->sk;
|
||||||
@ -941,7 +935,6 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
|
|||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||||
{
|
{
|
||||||
@ -993,11 +986,8 @@ static int packet_create(struct socket *sock, int protocol)
|
|||||||
|
|
||||||
if (!capable(CAP_NET_RAW))
|
if (!capable(CAP_NET_RAW))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW
|
if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW &&
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
sock->type != SOCK_PACKET)
|
||||||
&& sock->type != SOCK_PACKET
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
return -ESOCKTNOSUPPORT;
|
return -ESOCKTNOSUPPORT;
|
||||||
|
|
||||||
sock->state = SS_UNCONNECTED;
|
sock->state = SS_UNCONNECTED;
|
||||||
@ -1008,10 +998,9 @@ static int packet_create(struct socket *sock, int protocol)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
sock->ops = &packet_ops;
|
sock->ops = &packet_ops;
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
if (sock->type == SOCK_PACKET)
|
if (sock->type == SOCK_PACKET)
|
||||||
sock->ops = &packet_ops_spkt;
|
sock->ops = &packet_ops_spkt;
|
||||||
#endif
|
|
||||||
sock_init_data(sock, sk);
|
sock_init_data(sock, sk);
|
||||||
|
|
||||||
po = pkt_sk(sk);
|
po = pkt_sk(sk);
|
||||||
@ -1027,10 +1016,10 @@ static int packet_create(struct socket *sock, int protocol)
|
|||||||
|
|
||||||
spin_lock_init(&po->bind_lock);
|
spin_lock_init(&po->bind_lock);
|
||||||
po->prot_hook.func = packet_rcv;
|
po->prot_hook.func = packet_rcv;
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
if (sock->type == SOCK_PACKET)
|
if (sock->type == SOCK_PACKET)
|
||||||
po->prot_hook.func = packet_rcv_spkt;
|
po->prot_hook.func = packet_rcv_spkt;
|
||||||
#endif
|
|
||||||
po->prot_hook.af_packet_priv = sk;
|
po->prot_hook.af_packet_priv = sk;
|
||||||
|
|
||||||
if (proto) {
|
if (proto) {
|
||||||
@ -1150,7 +1139,6 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
|
static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
|
||||||
int *uaddr_len, int peer)
|
int *uaddr_len, int peer)
|
||||||
{
|
{
|
||||||
@ -1171,7 +1159,6 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
|
static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
|
||||||
int *uaddr_len, int peer)
|
int *uaddr_len, int peer)
|
||||||
@ -1833,7 +1820,6 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_SOCK_PACKET
|
|
||||||
static const struct proto_ops packet_ops_spkt = {
|
static const struct proto_ops packet_ops_spkt = {
|
||||||
.family = PF_PACKET,
|
.family = PF_PACKET,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
@ -1854,7 +1840,6 @@ static const struct proto_ops packet_ops_spkt = {
|
|||||||
.mmap = sock_no_mmap,
|
.mmap = sock_no_mmap,
|
||||||
.sendpage = sock_no_sendpage,
|
.sendpage = sock_no_sendpage,
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct proto_ops packet_ops = {
|
static const struct proto_ops packet_ops = {
|
||||||
.family = PF_PACKET,
|
.family = PF_PACKET,
|
||||||
|
Loading…
Reference in New Issue
Block a user