svn commit: r236955 - head/sys/net

Randall Stewart rrs at lakerest.net
Tue Jun 12 13:19:10 UTC 2012


That actually will not effect things. Since the packet is
on the way out. If the csum_data field gets set on the way in
(not out)… so reusing it here I think is safe.

R
On Jun 12, 2012, at 8:53 AM, Bjoern A. Zeeb wrote:

> 
> On 12. Jun 2012, at 12:44 , Randall Stewart wrote:
> 
>> Author: rrs
>> Date: Tue Jun 12 12:44:17 2012
>> New Revision: 236955
>> URL: http://svn.freebsd.org/changeset/base/236955
>> 
>> Log:
>> Note to self. Have morning coffee *before* committing things.
>> There is no mac_addr in the mbuf for BSD.. cheat like
>> we are supposed to and use the csum field since our friend
>> the gif tunnel itself will never use offload.
> 
> There are cards that can do checksums for IPIP... with drivers in out tree.
> 
> 
>> 
>> Modified:
>> head/sys/net/if_gif.c
>> 
>> Modified: head/sys/net/if_gif.c
>> ==============================================================================
>> --- head/sys/net/if_gif.c	Tue Jun 12 12:40:15 2012	(r236954)
>> +++ head/sys/net/if_gif.c	Tue Jun 12 12:44:17 2012	(r236955)
>> @@ -388,7 +388,8 @@ keep_going:
>> 		/* Now pull back the af in packet that
>> 		 * was saved in the address location.
>> 		 */
>> -		bcopy(m->m_pkthdr.src_mac_addr, &af, sizeof(af));
>> +		af = m->m_pkthdr.csum_data;
>> +		
>> 		if (ifp->if_bridge)
>> 			af = AF_LINK;
>> 
>> @@ -503,10 +504,11 @@ gif_output(ifp, m, dst, ro)
>> 		dst->sa_family = af;
>> 	}
>> 	af = dst->sa_family;
>> -	/* Now save the af in the inbound pkt mac
>> -	 * address location.
>> +	/* Now save the af in the inbound pkt csum
>> +	 * data, this is a cheat since really
>> +	 * gif tunnels don't do offload.
>> 	 */
>> -	bcopy(&af, m->m_pkthdr.src_mac_addr, sizeof(af));
>> +	m->m_pkthdr.csum_data = af;
>> 	if (!(ifp->if_flags & IFF_UP) ||
>> 	    sc->gif_psrc == NULL || sc->gif_pdst == NULL) {
>> 		m_freem(m);
> 
> -- 
> Bjoern A. Zeeb                                 You have to have visions!
>   It does not matter how good you are. It matters what good you do!
> 
> 

------------------------------
Randall Stewart
803-317-4952 (cell)



More information about the svn-src-all mailing list