Bug 18741

Summary: [PATCH] Multicast loopback interface not receiving packets; checksum errors
Product: Base System Reporter: jgibbons <jgibbons>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jgibbons 2000-05-22 07:50:01 UTC
	The loopback IP interface does not receive multicast packets
	which are sent by the local machine; instead each packet
	is counted as a checksum error.  This problem began sometime
	between about 01 April, 2000 and 20 May, 2000; the problem
	does not occur in 4-STABLE prior to 01 April, 2000.  I
	believe the problem is related to the new "delayed checksum"
	code which has been MFCed into the IP and UDP network
	routines (ip_input.c, ip_output.c, udp_usrreq.c, etc.).
	This problem also probably occurs on current, but I have
	not tested that, nor have I tested the fix on any version
	of FreeBSD except 4-STABLE.

Fix: The following code, when added to src/sys/netinet/ip_output.c,
	cures the problem.  It is in the ip_mloopback() routine,
	which calls if_simloop() to put a packet onto an input
	queue so that it will later be retrieved and processed by
	ip_input().  ip_mloopback() is only called when sending a
	multicast packet on an interface which belongs to the
	destination multicast group.  The added code sets flags so
	that the udp_input() routine (which eventually receives
	and handles the packet) will not attempt to verify the UDP
	checksum field.

	Note that this may not be the best fix -- someone who
	understands the delayed checksum processing should review
	this.  In particular, I do not know if the added "if"
	statement is necessary or desirable; it may be better just
	to _always_ set the flags here, since it should never be
	necessary to check the checksum of a looped-back packet.
How-To-Repeat: 
	Join a multicast address on an fxp Ethernet interface, then
	send packets through that interface to that multicast
	address.  Your machine (the machine which is sending the
	packets) will not receive those packets.  Use "netstat -p udp"
        before and after sending the packets, and you will see the
        number of packets "with bad checksum" increasing for every
        packet you send.
Comment 1 jlemon freebsd_committer freebsd_triage 2000-05-25 03:34:06 UTC
State Changed
From-To: open->closed

Patch applied, thanks!