android_kernel_xiaomi_sm8350/net
David L Stevens ca9b907d14 [IPV4]: multicast API "join" issues
This patch corrects a few problems with the IP_ADD_MEMBERSHIP
socket option:

1) The existing code makes an attempt at reference counting joins when
   using the ip_mreqn/imr_ifindex interface. Joining the same group
   on the same socket is an error, whatever the API. This leads to
   unexpected results when mixing ip_mreqn by index with ip_mreqn by
   address, ip_mreq, or other API's. For example, ip_mreq followed by
   ip_mreqn of the same group will "work" while the same two reversed
   will not.
           Fixed to always return EADDRINUSE on a duplicate join and
   removed the (now unused) reference count in ip_mc_socklist.

2) The group-search list in ip_mc_join_group() is comparing a full 
   ip_mreqn structure and all of it must match for it to find the
   group. This doesn't correctly match a group that was joined with
   ip_mreq or ip_mreqn with an address (with or without an index). It
   also doesn't match groups that are joined by different addresses on
   the same interface. All of these are the same multicast group,
   which is identified by group address and interface index.
           Fixed the check to correctly match groups so we don't get
   duplicate group entries on the ip_mc_socklist.

3) The old code allocates a multicast address before searching for
   duplicates requiring it to free in various error cases. This
   patch moves the allocate until after the search and
   igmp_max_memberships check, so never a need to allocate, then free
   an entry.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-07-08 17:38:07 -07:00
..
802
8021q
appletalk [ATALK] aarp: replace schedule_timeout() with msleep() 2005-06-22 22:11:44 -07:00
atm
ax25
bluetooth [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
bridge [NETFILTER]: Fix connection tracking bug in 2.6.12 2005-06-28 16:04:44 -07:00
core [NET]: Fix sparse warnings 2005-07-08 14:57:47 -07:00
decnet [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
econet
ethernet [NET]: Micro optimization in eth_header() 2005-06-28 15:49:06 -07:00
ipv4 [IPV4]: multicast API "join" issues 2005-07-08 17:38:07 -07:00
ipv6 [TCP]: Move to new TSO segmenting scheme. 2005-07-05 15:24:38 -07:00
ipx
irda [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
key
lapb
llc [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
netlink [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
netrom
packet
rose
rxrpc [PATCH] Cleanup patch for process freezing 2005-06-25 17:10:13 -07:00
sched [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
sctp [SCTP] Make init & delayed sack timeouts configurable by user. 2005-06-28 13:24:23 -07:00
sunrpc [PATCH] coverity: sunrpc/xprt task null check 2005-07-07 18:23:47 -07:00
unix [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
wanrouter
x25 [X25]: Fast select with no restriction on response 2005-06-22 22:16:17 -07:00
xfrm
compat.c
Kconfig
Makefile
nonet.c
socket.c [NET]: dont use strlen() but the result from a prior sprintf() 2005-06-22 14:32:51 -07:00
sysctl_net.c
TUNABLE