linux/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 [TOKENRING]: net/802/tr.c: s/struct rif_cache_s/struct rif_cache/ 2005-05-26 12:59:42 -07:00
8021q [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
appletalk [ATALK] aarp: replace schedule_timeout() with msleep() 2005-06-22 22:11:44 -07:00
atm [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
ax25 [AX25] Introduce ax25_type_trans 2005-04-24 18:53:06 -07:00
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 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irda [NET]: Transform skb_queue_len() binary tests into skb_queue_empty() 2005-07-08 14:57:23 -07:00
key [IPSEC]: Add XFRM_STATE_NOPMTUDISC flag 2005-06-20 13:21:43 -07:00
lapb Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
packet [PATCH] update Ross Biro bouncing email address 2005-05-05 16:36:49 -07:00
rose Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
x25 [X25]: Fast select with no restriction on response 2005-06-22 22:16:17 -07:00
xfrm [IPSEC]: Add xfrm_state_afinfo->init_flags 2005-06-20 13:19:41 -07:00
Kconfig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
TUNABLE Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
nonet.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
socket.c [NET]: dont use strlen() but the result from a prior sprintf() 2005-06-22 14:32:51 -07:00
sysctl_net.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00