All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: Allow any address multicast join for IP sockets
@ 2021-07-06  1:15 Callum Sinclair
  2021-07-06  1:15 ` Callum Sinclair
  2021-07-06 13:28 ` Andrew Lunn
  0 siblings, 2 replies; 10+ messages in thread
From: Callum Sinclair @ 2021-07-06  1:15 UTC (permalink / raw)
  To: dsahern, nikolay; +Cc: netdev, linux-kernel, linus.luessing, Callum Sinclair

For an application to receive all multicast packets in a range such as
224.0.0.1 - 239.255.255.255 each multicast IP address has to be joined
explicitly one at a time.

Allow the any address to be passed to the IP_ADD_MEMBERSHIP and
IPV6_ADD_MEMBERSHIP socket option per interface. By joining the any
address the socket will receive all multicast packets that are received
on the interface. 

This allows any IP socket to be used for IGMP or MLD snooping.

Callum Sinclair (1):
  net: Allow any address multicast join for IP sockets

 net/ipv4/igmp.c  | 40 ++++++++++++++++++++++++++++++++--------
 net/ipv6/mcast.c | 20 ++++++++++++++------
 2 files changed, 46 insertions(+), 14 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH] net: Allow any address multicast join for IP sockets
  2021-07-06  1:15 ` Callum Sinclair
  2021-07-06  5:18     ` kernel test robot
@ 2021-07-07  7:26 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-07-06 19:01 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3005 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210706011548.2201-2-callum.sinclair@alliedtelesis.co.nz>
References: <20210706011548.2201-2-callum.sinclair@alliedtelesis.co.nz>
TO: Callum Sinclair <callum.sinclair@alliedtelesis.co.nz>
TO: dsahern(a)kernel.org
TO: nikolay(a)nvidia.com
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: linus.luessing(a)c0d3.blue
CC: Callum Sinclair <callum.sinclair@alliedtelesis.co.nz>

Hi Callum,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.13 next-20210706]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Callum-Sinclair/net-Allow-any-address-multicast-join-for-IP-sockets/20210706-091734
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 79160a603bdb51916226caf4a6616cc4e1c58a58
:::::: branch date: 18 hours ago
:::::: commit date: 18 hours ago
compiler: m68k-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/ipv4/igmp.c:1432:9: warning: Uninitialized variable: im [uninitvar]
    return im;
           ^

vim +1432 net/ipv4/igmp.c

e9897071350bd9 Eric Dumazet    2013-06-07  1415  
b05967ad8bde7d Callum Sinclair 2021-07-06  1416  static struct ip_mc_list *ip_mc_hash_lookup(struct ip_mc_list __rcu **mc_hash,
b05967ad8bde7d Callum Sinclair 2021-07-06  1417  					    __be32 mc_addr)
b05967ad8bde7d Callum Sinclair 2021-07-06  1418  {
b05967ad8bde7d Callum Sinclair 2021-07-06  1419  	struct ip_mc_list *im;
b05967ad8bde7d Callum Sinclair 2021-07-06  1420  	u32 hash;
b05967ad8bde7d Callum Sinclair 2021-07-06  1421  
b05967ad8bde7d Callum Sinclair 2021-07-06  1422  	if (mc_hash) {
b05967ad8bde7d Callum Sinclair 2021-07-06  1423  		hash = hash_32((__force u32)mc_addr, MC_HASH_SZ_LOG);
b05967ad8bde7d Callum Sinclair 2021-07-06  1424  		for (im = rcu_dereference(mc_hash[hash]);
b05967ad8bde7d Callum Sinclair 2021-07-06  1425  		     im != NULL;
b05967ad8bde7d Callum Sinclair 2021-07-06  1426  		     im = rcu_dereference(im->next_hash)) {
b05967ad8bde7d Callum Sinclair 2021-07-06  1427  			if (im->multiaddr == mc_addr)
b05967ad8bde7d Callum Sinclair 2021-07-06  1428  				break;
b05967ad8bde7d Callum Sinclair 2021-07-06  1429  			}
b05967ad8bde7d Callum Sinclair 2021-07-06  1430  	}
b05967ad8bde7d Callum Sinclair 2021-07-06  1431  
b05967ad8bde7d Callum Sinclair 2021-07-06 @1432  	return im;
b05967ad8bde7d Callum Sinclair 2021-07-06  1433  }
b05967ad8bde7d Callum Sinclair 2021-07-06  1434  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-07 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  1:15 [PATCH] net: Allow any address multicast join for IP sockets Callum Sinclair
2021-07-06  1:15 ` Callum Sinclair
2021-07-06  5:18   ` kernel test robot
2021-07-06  5:18     ` kernel test robot
2021-07-06 13:28 ` Andrew Lunn
2021-07-07  2:00   ` Callum Sinclair
2021-07-07 14:56     ` Andrew Lunn
2021-07-06 19:01 kernel test robot
2021-07-07  7:26 ` [kbuild] " Dan Carpenter
2021-07-07  7:26 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.