patch-1.3.42 linux/net/ipv4/ip_sockglue.c

Next file: linux/net/ipv4/rarp.c
Previous file: linux/net/ipv4/ip_output.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.41/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -283,10 +283,12 @@
 				/*
 				 *	Not set so scan.
 				 */
-				if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,NULL, &route_src))!=NULL)
+				if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
 				{
 					dev=rt->rt_dev;
-					rt->rt_use--;
+					route_src = rt->rt_src;
+					ATOMIC_DECR(&rt->rt_use);
+					ip_rt_put(rt);
 				}
 			}
 			else
@@ -335,10 +337,12 @@
  
 			if(mreq.imr_interface.s_addr==INADDR_ANY) 
 			{
-				if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,NULL, &route_src))!=NULL)
+				if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
 			        {
 					dev=rt->rt_dev;
-					rt->rt_use--;
+					ATOMIC_DECR(&rt->rt_use);
+					route_src = rt->rt_src;
+					ip_rt_put(rt);
 				}
 			}
 			else 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this