lkml.org 
[lkml]   [2007]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch for Apani Nortel VPN Client to build against kernel 2.6.22 help/review
I haven't read too much into the patch, but some quick comments.  Most applies
throughout:

> +#if (LINUX_VERSION_CODE >= 0x020616)
KERNEL_VERSION(2,6,22) is much more readable than 0x020616.

> + return (struct iphdr*) skb->network_header;
Should be return ip_hdr(skb);

> + skb->network_header = skb->data;
Should be skb_reset_network_header(skb);

> + iph = skb->network_header.iph;
Probably meant skb->nh.iph.

> + if ( iph->protocol == 17 ) /* if UDP, */
(snip)
> + if ( iph->protocol == 6 ) /* if TCP, */
Could use IPPROTO_UDP and IPPROTO_TCP instead of 17 and 6, respectively.

Instead of littering the code with #if blah #else blah, you could also simply
provide implementations for the 2.6.22 functions #if LINUX_VERSION_CODE <
KERNEL_VERSION(2,6,22).

--
Nick Bowler, Elliptic Semiconductor (http://www.ellipticsemi.com/)

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

\
 
 \ /
  Last update: 2007-08-22 18:21    [W:0.037 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site