site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com On Aug 2, 2009, at 6:22 AM, Jan Deng wrote: The whole sequence looks something like this: I hope this helps. - Peter Sichel Sustainable Softworks _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists.... I have a emergency problem. This solution works fine on most platform. But recently, I tried PPC G4 with 10.5.7. The connection always be reset by client( such as browser ).
From TCP dump, I can see the TCP checksum of packet from local proxy to client( browser ) is aways wrong with number 0xb5d0.
Some machines do hardware checksum computation in the device driver, so for outbound packets, it is important that you "finalize" the mbuf before you attempt to modify it. For inbound packets, the ip input processing may believe the driver has computed the checksum based on the mbuf flags. if (packet->direction == kDirectionInbound) { mbuf_inbound_modified(mbuf_ref); // mbuf->m_pkthdr.csum_flags = 0; mbuf_clear_csum_requested(mbuf_ref); // mbuf->m_pkthdr.csum_data = 0; } else { // Convert header fields back to network byte order for mbuf_outbound_finalize checksum computation KFT_htonPacket(packet, kOptionFinalize); mbuf_outbound_finalize(mbuf_ref, AF_INET, packet->ipOffset); // might have done m_pullup packet->datagram = (u_int8_t*)mbuf_data(*packet->mbuf_ptr); packet->datagram = &packet->datagram[packet->ipOffset]; // clear csum flags mbuf_inbound_modified(mbuf_ref); // mbuf->m_pkthdr.csum_flags = 0; mbuf_clear_csum_requested(mbuf_ref); // mbuf->m_pkthdr.csum_data = 0; // Convert header fields back to host byte order for further processing KFT_ntohPacket(packet, kOptionFinalize); This email sent to site_archiver@lists.apple.com