patch-2.4.22 linux-2.4.22/net/ipv4/udp.c

Next file: linux-2.4.22/net/ipv4/utils.c
Previous file: linux-2.4.22/net/ipv4/tcp_minisocks.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/net/ipv4/udp.c linux-2.4.22/net/ipv4/udp.c
@@ -271,6 +271,8 @@
 	return sk;
 }
 
+extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif);
+
 static inline struct sock *udp_v4_mcast_next(struct sock *sk,
 					     u16 loc_port, u32 loc_addr,
 					     u16 rmt_port, u32 rmt_addr,
@@ -286,6 +288,8 @@
 		    ipv6_only_sock(s)					||
 		    (s->bound_dev_if && s->bound_dev_if != dif))
 			continue;
+		if (!ip_mc_sf_allow(sk, loc_addr, rmt_addr, dif))
+			continue;
 		break;
   	}
   	return s;
@@ -476,7 +480,7 @@
 			return -EINVAL;
 	} else {
 		if (sk->state != TCP_ESTABLISHED)
-			return -ENOTCONN;
+			return -EDESTADDRREQ;
 		ufh.daddr = sk->daddr;
 		ufh.uh.dest = sk->dport;
 		/* Open fast path for connected socket.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)