• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NKEs on Intel-based Macs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NKEs on Intel-based Macs


  • Subject: Re: NKEs on Intel-based Macs
  • From: David A Rowland <email@hidden>
  • Date: Wed, 16 Aug 2006 12:45:36 -0700

Title: Re: NKEs on Intel-based Macs
At 11:33 AM -0400 8/16/06, Peter Sichel wrote:
On 8/15/06, Josh Graessley wrote:

> The problem is that mbuf_outbound_finalize calls a function that
>expects the IP header to be in host byte order to calculate the
>checksums (in_delayed_cksum_offset). It looks like the best solution is
>to swap the bytes in the IP header to host byte order before
>calling mbuf_outbound_finalize and swapping them back
>after mbuf_outbound_finalize returns.

As I understand it the code has to do this:

err = mbuf_pullup(mbufPtr, 12); //get the first part of the ip header in one place
ipheaderPtr = mbuf_data(mbufPtr);
NTOHS(ipheaderPtr->ip_len);
NTOHS(ipheaderPtr->ip_id);
NTOHS(ipheaderPtr->ip_off);

mbuf_outbound_finalize(mbufPtr, AF_INET, 0);

err = mbuf_pullup(mbufPtr,
12);
ipheaderPtr = mbuf_data(mbufPtr);
HTONS(ipheaderPtr->ip_len);
HTONS(ipheaderPtr->ip_id);
HTONS(ipheaderPtr->ip_off);
HTONS(ipheaderPtr->ip_sum);



That is, put the 2-byte items in host order for mbuf_outbound_finalize and then back in network order for transmission.

What Ron said about the checksum calculation is correct, but all the 2-byte items, including the checksum, must agree about the order they are in. You can't have some host and some network.

David
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NKEs on Intel-based Macs
      • From: "Peter Sichel" <email@hidden>
References: 
 >NKEs on Intel-based Macs (From: "Peter Lovell" <email@hidden>)
 >Re: NKEs on Intel-based Macs (From: Josh Graessley <email@hidden>)
 >Re: NKEs on Intel-based Macs (From: David A Rowland <email@hidden>)
 >Re: NKEs on Intel-based Macs (From: David A Rowland <email@hidden>)
 >Re: NKEs on Intel-based Macs (From: Josh Graessley <email@hidden>)
 >Re: NKEs on Intel-based Macs (From: "Peter Sichel" <email@hidden>)

  • Prev by Date: Re: NKEs on Intel-based Macs
  • Next by Date: Re: NKEs on Intel-based Macs
  • Previous by thread: Re: NKEs on Intel-based Macs
  • Next by thread: Re: NKEs on Intel-based Macs
  • Index(es):
    • Date
    • Thread