Dan McDonald writes:
 > On Tue, May 09, 2006 at 04:02:27PM -0400, Andrew Gallatin wrote:
 > <SNIP!>
 > > If yes, then is there a simple, fast way to determine if a packet
 > > which winds up in the transmit routine of a GLDv2 device driver is a
 > > UDP over IPv6 packet?  The IPv6 test is simple enough, but is there
 > > already code I can access in a driver to walk the IPv6 headers to see
 > > if the packet is UDP?
 > 
 > I believe it's a private interface, so it's not stable:
 > 
 > extern boolean_t        ip_hdr_length_nexthdr_v6(mblk_t *, ip6_t *,
 >     uint16_t *, uint8_t **);
 > 
 > Where the uint8_t ** gets pointed to the byte indicating the terminal IPv6
 > header.
 > 
 > You should probably treat those as slow-path, optimizing for ip6_nexthdr ==
 > UDP.  (I'm sure you knew that already, though!)

Hmm.. Here is another tactic:  What protocols will Solaris offload
partial (GLD_CAP_CKSUM_PARTIAL) checksums for?  Just TCP and UDP, right?

If so, then I can tell TCP from UDP just by looking at the difference
between the start and stuff that hcksum_retrieve() gives me.  If stuff
- start == 6, then it must be UDP.

This sounds too good to be true.. what is the flaw in this?

Thanks,

Drew

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to