Skip to content

Commit

Permalink
[AF_PACKET]: Kill CONFIG_PACKET_SOCKET.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed May 31, 2007
1 parent 8c7fc03 commit be02097
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
#include <net/inet_common.h>
#endif

#define CONFIG_SOCK_PACKET 1

/*
Assumptions:
- if device has no dev->hard_header routine, it adds and removes ll header
Expand Down Expand Up @@ -246,7 +244,6 @@ static void packet_sock_destruct(struct sock *sk)

static const struct proto_ops packet_ops;

#ifdef CONFIG_SOCK_PACKET
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)
Expand Down Expand Up @@ -418,7 +415,6 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
dev_put(dev);
return err;
}
#endif

static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
unsigned int res)
Expand Down Expand Up @@ -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
*/

#ifdef CONFIG_SOCK_PACKET

static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk=sock->sk;
Expand All @@ -941,7 +935,6 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
}
return err;
}
#endif

static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
Expand Down Expand Up @@ -993,11 +986,8 @@ static int packet_create(struct socket *sock, int protocol)

if (!capable(CAP_NET_RAW))
return -EPERM;
if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW
#ifdef CONFIG_SOCK_PACKET
&& sock->type != SOCK_PACKET
#endif
)
if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW &&
sock->type != SOCK_PACKET)
return -ESOCKTNOSUPPORT;

sock->state = SS_UNCONNECTED;
Expand All @@ -1008,10 +998,9 @@ static int packet_create(struct socket *sock, int protocol)
goto out;

sock->ops = &packet_ops;
#ifdef CONFIG_SOCK_PACKET
if (sock->type == SOCK_PACKET)
sock->ops = &packet_ops_spkt;
#endif

sock_init_data(sock, sk);

po = pkt_sk(sk);
Expand All @@ -1027,10 +1016,10 @@ static int packet_create(struct socket *sock, int protocol)

spin_lock_init(&po->bind_lock);
po->prot_hook.func = packet_rcv;
#ifdef CONFIG_SOCK_PACKET

if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
#endif

po->prot_hook.af_packet_priv = sk;

if (proto) {
Expand Down Expand Up @@ -1150,7 +1139,6 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
return err;
}

#ifdef CONFIG_SOCK_PACKET
static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
Expand All @@ -1171,7 +1159,6 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,

return 0;
}
#endif

static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
Expand Down Expand Up @@ -1833,7 +1820,6 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
#endif


#ifdef CONFIG_SOCK_PACKET
static const struct proto_ops packet_ops_spkt = {
.family = PF_PACKET,
.owner = THIS_MODULE,
Expand All @@ -1854,7 +1840,6 @@ static const struct proto_ops packet_ops_spkt = {
.mmap = sock_no_mmap,
.sendpage = sock_no_sendpage,
};
#endif

static const struct proto_ops packet_ops = {
.family = PF_PACKET,
Expand Down

0 comments on commit be02097

Please sign in to comment.