Commit a2efcfa0 authored by David S. Miller's avatar David S. Miller

[AF_PACKET]: Kill bogus CONFIG_PACKET_MULTICAST

It is unconditionally set by af_packet.c, not by the Kconfig
subsystem, so just kill it off.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ddc31ce3
...@@ -85,20 +85,6 @@ ...@@ -85,20 +85,6 @@
#define CONFIG_SOCK_PACKET 1 #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: 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
...@@ -159,7 +145,6 @@ static atomic_t packet_socks_nr; ...@@ -159,7 +145,6 @@ static atomic_t packet_socks_nr;
/* Private packet socket structures. */ /* Private packet socket structures. */
#ifdef CONFIG_PACKET_MULTICAST
struct packet_mclist struct packet_mclist
{ {
struct packet_mclist *next; struct packet_mclist *next;
...@@ -179,7 +164,7 @@ struct packet_mreq_max ...@@ -179,7 +164,7 @@ struct packet_mreq_max
unsigned short mr_alen; unsigned short mr_alen;
unsigned char mr_address[MAX_ADDR_LEN]; unsigned char mr_address[MAX_ADDR_LEN];
}; };
#endif
#ifdef CONFIG_PACKET_MMAP #ifdef CONFIG_PACKET_MMAP
static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing); static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing);
#endif #endif
...@@ -205,9 +190,7 @@ struct packet_sock { ...@@ -205,9 +190,7 @@ struct packet_sock {
origdev:1; origdev:1;
int ifindex; /* bound device */ int ifindex; /* bound device */
__be16 num; __be16 num;
#ifdef CONFIG_PACKET_MULTICAST
struct packet_mclist *mclist; struct packet_mclist *mclist;
#endif
#ifdef CONFIG_PACKET_MMAP #ifdef CONFIG_PACKET_MMAP
atomic_t mapped; atomic_t mapped;
unsigned int pg_vec_order; unsigned int pg_vec_order;
...@@ -851,9 +834,7 @@ static int packet_release(struct socket *sock) ...@@ -851,9 +834,7 @@ static int packet_release(struct socket *sock)
__sock_put(sk); __sock_put(sk);
} }
#ifdef CONFIG_PACKET_MULTICAST
packet_flush_mclist(sk); packet_flush_mclist(sk);
#endif
#ifdef CONFIG_PACKET_MMAP #ifdef CONFIG_PACKET_MMAP
if (po->pg_vec) { if (po->pg_vec) {
...@@ -1221,7 +1202,6 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -1221,7 +1202,6 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
return 0; return 0;
} }
#ifdef CONFIG_PACKET_MULTICAST
static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what) static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int what)
{ {
switch (i->type) { switch (i->type) {
...@@ -1349,7 +1329,6 @@ static void packet_flush_mclist(struct sock *sk) ...@@ -1349,7 +1329,6 @@ static void packet_flush_mclist(struct sock *sk)
} }
rtnl_unlock(); rtnl_unlock();
} }
#endif
static int static int
packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
...@@ -1362,7 +1341,6 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv ...@@ -1362,7 +1341,6 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
return -ENOPROTOOPT; return -ENOPROTOOPT;
switch(optname) { switch(optname) {
#ifdef CONFIG_PACKET_MULTICAST
case PACKET_ADD_MEMBERSHIP: case PACKET_ADD_MEMBERSHIP:
case PACKET_DROP_MEMBERSHIP: case PACKET_DROP_MEMBERSHIP:
{ {
...@@ -1383,7 +1361,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv ...@@ -1383,7 +1361,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
ret = packet_mc_drop(sk, &mreq); ret = packet_mc_drop(sk, &mreq);
return ret; return ret;
} }
#endif
#ifdef CONFIG_PACKET_MMAP #ifdef CONFIG_PACKET_MMAP
case PACKET_RX_RING: case PACKET_RX_RING:
{ {
...@@ -1506,11 +1484,10 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void ...@@ -1506,11 +1484,10 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
switch (msg) { switch (msg) {
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
#ifdef CONFIG_PACKET_MULTICAST
if (po->mclist) if (po->mclist)
packet_dev_mclist(dev, po->mclist, -1); packet_dev_mclist(dev, po->mclist, -1);
// fallthrough /* fallthrough */
#endif
case NETDEV_DOWN: case NETDEV_DOWN:
if (dev->ifindex == po->ifindex) { if (dev->ifindex == po->ifindex) {
spin_lock(&po->bind_lock); spin_lock(&po->bind_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment