Skip to content

Commit

Permalink
[AF_PACKET]: Kill bogus CONFIG_PACKET_MULTICAST
Browse files Browse the repository at this point in the history
It is unconditionally set by af_packet.c, not by the Kconfig
subsystem, so just kill it off.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 31, 2007
1 parent ddc31ce commit a2efcfa
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,6 @@

#define CONFIG_SOCK_PACKET 1

/*
Proposed replacement for SIOC{ADD,DEL}MULTI and
IFF_PROMISC, IFF_ALLMULTI flags.
It is more expensive, but I believe,
it is really correct solution: reentereble, safe and fault tolerant.
IFF_PROMISC/IFF_ALLMULTI/SIOC{ADD/DEL}MULTI are faked by keeping
reference count and global flag, so that real status is
(gflag|(count != 0)), so that we can use obsolete faulty interface
not harming clever users.
*/
#define CONFIG_PACKET_MULTICAST 1

/*
Assumptions:
- if device has no dev->hard_header routine, it adds and removes ll header
Expand Down Expand Up @@ -159,7 +145,6 @@ static atomic_t packet_socks_nr;

/* Private packet socket structures. */

#ifdef CONFIG_PACKET_MULTICAST
struct packet_mclist
{
struct packet_mclist *next;
Expand All @@ -179,7 +164,7 @@ struct packet_mreq_max
unsigned short mr_alen;
unsigned char mr_address[MAX_ADDR_LEN];
};
#endif

#ifdef CONFIG_PACKET_MMAP
static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing);
#endif
Expand All @@ -205,9 +190,7 @@ struct packet_sock {
origdev:1;
int ifindex; /* bound device */
__be16 num;
#ifdef CONFIG_PACKET_MULTICAST
struct packet_mclist *mclist;
#endif
#ifdef CONFIG_PACKET_MMAP
atomic_t mapped;
unsigned int pg_vec_order;
Expand Down Expand Up @@ -851,9 +834,7 @@ static int packet_release(struct socket *sock)
__sock_put(sk);
}

#ifdef CONFIG_PACKET_MULTICAST
packet_flush_mclist(sk);
#endif

#ifdef CONFIG_PACKET_MMAP
if (po->pg_vec) {
Expand Down Expand Up @@ -1221,7 +1202,6 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
return 0;
}

#ifdef CONFIG_PACKET_MULTICAST
static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what)
{
switch (i->type) {
Expand Down Expand Up @@ -1349,7 +1329,6 @@ static void packet_flush_mclist(struct sock *sk)
}
rtnl_unlock();
}
#endif

static int
packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
Expand All @@ -1362,7 +1341,6 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
return -ENOPROTOOPT;

switch(optname) {
#ifdef CONFIG_PACKET_MULTICAST
case PACKET_ADD_MEMBERSHIP:
case PACKET_DROP_MEMBERSHIP:
{
Expand All @@ -1383,7 +1361,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
ret = packet_mc_drop(sk, &mreq);
return ret;
}
#endif

#ifdef CONFIG_PACKET_MMAP
case PACKET_RX_RING:
{
Expand Down Expand Up @@ -1506,11 +1484,10 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void

switch (msg) {
case NETDEV_UNREGISTER:
#ifdef CONFIG_PACKET_MULTICAST
if (po->mclist)
packet_dev_mclist(dev, po->mclist, -1);
// fallthrough
#endif
/* fallthrough */

case NETDEV_DOWN:
if (dev->ifindex == po->ifindex) {
spin_lock(&po->bind_lock);
Expand Down

0 comments on commit a2efcfa

Please sign in to comment.