lkml.org 
[lkml]   [1999]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Bug in net/ethernet/eth.c ??
From
Date
In article <369ACC40.8E390A0C@cyberhighway.net>,
greear@cyberhighway.net (Ben Greear) writes:

> if (ntohs(eth->h_proto) >= 1536)
> return eth->h_proto;

> ...

> I wonder if that last line should be more like:
> return (ntohs(eth->h_proto);

The line is correct because the kernel internally uses network
order for comparing/storing the protocol number (and most other
network constants like ip addresses . The ntohs() above
is just for the numerical comparison.

If this line was buggy not much would work in networking @)

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.063 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site