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/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]