Re: unused in_cksum_update() ?

看板FB_current作者時間12年前 (2014/01/10 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/6 (看更多)
On Thu, Jan 09, 2014 at 01:27:52PM -0800, Adrian Chadd wrote: > It's likely used elsewhere; it's the kind of thing you abuse when > doing header rewriting and reinjection. So, what's the NAT and such > code using? natd/libalias has its own code with a DifferentialChecksum() function in sys/netinet/libalias/alias_util.c which adds and subtracts the chunks in the old and new packet. ip_fastfwd.c does it inline: /* * Decrement the TTL and incrementally change the IP header checksum. * Don't bother doing this with hw checksum offloading, it's faster * doing it right here. */ ip->ip_ttl -= IPTTLDEC; if (ip->ip_sum >= (u_int16_t) ~htons(IPTTLDEC << 8)) ip->ip_sum -= ~htons(IPTTLDEC << 8); else ip->ip_sum += htons(IPTTLDEC << 8); ip_forward() relies on the recomputation done in ip_output(). And there is no trace of in_cksum_update() in the entire source tree apart from its definition. cheers luigi _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1IpnmU8R (FB_current)
文章代碼(AID): #1IpnmU8R (FB_current)