patch-2.2.4 linux/net/ipv4/ipmr.c

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

diff -u --recursive --new-file v2.2.3/linux/net/ipv4/ipmr.c linux/net/ipv4/ipmr.c
@@ -9,7 +9,7 @@
  *	as published by the Free Software Foundation; either version
  *	2 of the License, or (at your option) any later version.
  *
- *	Version: $Id: ipmr.c,v 1.38 1999/01/12 14:34:40 davem Exp $
+ *	Version: $Id: ipmr.c,v 1.39 1999/03/21 05:22:44 davem Exp $
  *
  *	Fixes:
  *	Michael Chastain	:	Incorrect size of copying.
@@ -138,6 +138,8 @@
 
 static int reg_vif_xmit(struct sk_buff *skb, struct device *dev)
 {
+	((struct net_device_stats*)dev->priv)->tx_bytes += skb->len;
+	((struct net_device_stats*)dev->priv)->tx_packets++;
 	ipmr_cache_report(skb, reg_vif_num, IGMPMSG_WHOLEPKT);
 	kfree_skb(skb);
 	return 0;
@@ -449,6 +451,9 @@
 	struct igmpmsg *msg;
 	int ret;
 
+	if (mroute_socket==NULL)
+		return -EINVAL;
+
 #ifdef CONFIG_IP_PIMSM
 	if (assert == IGMPMSG_WHOLEPKT)
 		skb = skb_realloc_headroom(pkt, sizeof(struct iphdr));
@@ -656,7 +661,9 @@
 {
 	if (sk == mroute_socket) {
 		ipv4_devconf.mc_forwarding = 0;
+		net_serialize_enter();
 		mroute_socket=NULL;
+		net_serialize_leave();
 		mroute_close(sk);
 	}
 }
@@ -1045,7 +1052,7 @@
 
 	dev = rt->u.dst.dev;
 
-	if (skb->len+encap > rt->u.dst.pmtu /* && (ntohs(iph->frag_off) & IP_DF) */) {
+	if (skb->len+encap > rt->u.dst.pmtu && (ntohs(iph->frag_off) & IP_DF)) {
 		/* Do not fragment multicasts. Alas, IPv4 does not
 		   allow to send ICMP, so that packets will disappear
 		   to blackhole.
@@ -1119,7 +1126,10 @@
 	 * not mrouter) cannot join to more than one interface - it will
 	 * result in receiving multiple packets.
 	 */
-	skb2->dst->output(skb2);
+	if (skb2->len <= rt->u.dst.pmtu)
+		skb2->dst->output(skb2);
+	else
+		ip_fragment(skb2, skb2->dst->output);
 }
 
 int ipmr_find_vif(struct device *dev)

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