mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* patch for cisco client for Linux-2.6.22-rc1
@ 2007-05-14  1:13 Jeff Chua
  2007-05-14 17:50 ` Jan Engelhardt
  2007-05-14 19:48 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Chua @ 2007-05-14  1:13 UTC (permalink / raw)
  To: lkml

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

Attached is my patch for vpnclient-linux-x86_64-4.8.00.0490-k9 to make
it run on Linux-2.6.22-rc1.

Thanks,
Jeff.

[-- Attachment #2: patch-2.6.22-vpn --]
[-- Type: application/octet-stream, Size: 5252 bytes --]

--- vpn/linuxcniapi.c.org	2007-05-13 21:03:09 +0800
+++ vpn/linuxcniapi.c	2007-05-13 22:43:39 +0800
@@ -291,13 +291,9 @@
     /* move the data into the packet */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
     {
-        struct timeval timestamp;
-
-        __net_timestamp(skb);
-        skb_set_timestamp(skb,&timestamp);
+        skb->tstamp.tv64 = 0;
     }
 #else
-    __net_timestamp(skb);
 #endif
 
     pIP = skb_put(skb, lpPacketDescriptor->uiPacketSize);
@@ -328,8 +324,8 @@
 
     skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-    skb->nh.iph = (struct iphdr *) skb->data;
-    skb->mac.raw = pMac;
+    skb_reset_network_header(skb);
+    skb_reset_mac_header(skb);
 
     pBinding->recv_stat.called = TRUE;
 
@@ -440,22 +436,18 @@
     /* put the mac header on */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
     {
-        struct timeval timestamp;
-
-        __net_timestamp(skb);
-        skb_set_timestamp(skb,&timestamp);
+        skb->tstamp.tv64 = 0;
     }
 #else
-    __net_timestamp(skb);
 #endif
 
     skb->dev = pBinding->pDevice;
 
-    skb->mac.raw = pMac;
-    skb->nh.raw = pIP;
+    skb_reset_mac_header(skb);
+    skb_reset_network_header(skb);
 
     /*ip header length is in 32bit words */
-    skb->h.raw = pIP + (skb->nh.iph->ihl * 4);
+    skb->transport_header = skb->network_header + (ip_hdr(skb)->ihl * 4);
     skb->protocol = htons(ETH_P_IP);
 
     /* send this packet up the NIC driver */
--- vpn/frag.c.org	2007-05-13 21:24:50 +0800
+++ vpn/frag.c	2007-05-13 21:24:14 +0800
@@ -37,13 +37,10 @@
     int ret=FALSE;
     struct frag_queue_entry *cur=NULL,*n=NULL,*prev=NULL;
 
-    id = ntohs(skb->nh.iph->id);
+    const struct iphdr *ih = ip_hdr(skb);
+    id = ntohs(ih->id);
+
     /* look for an entry with the same id as this packet*/
-    if (frag_queue_head && id != ntohs(frag_queue_head->skb->nh.iph->id))
-    {
-        printk(KERN_INFO "%s: incomplete fragment set destroyed",__FUNCTION__);
-        cleanup_frag_queue();
-    }  
     /*allocate a new entry*/
     n = kmalloc(sizeof(struct frag_queue_entry),GFP_ATOMIC);
     if (!n)
@@ -57,10 +54,10 @@
     cur = frag_queue_head;
 
     prev = NULL;
-    skb_offset = ntohs(skb->nh.iph->frag_off) & IP_OFFSET;
+    skb_offset = ntohs(ip_hdr(skb)->frag_off) & IP_OFFSET;
     while (cur)
     {
-        cur_offset = ntohs(cur->skb->nh.iph->frag_off) & IP_OFFSET;
+        cur_offset = ntohs(ip_hdr(cur->skb)->frag_off) & IP_OFFSET;
         /*sanity check*/
         if (cur_offset < prev_offset)
         {
@@ -113,7 +110,7 @@
     }
     cur = frag_queue_head;
     /*first in queue must be first frag.*/
-    if ((ntohs(cur->skb->nh.iph->frag_off) & IP_OFFSET) != 0)
+    if ((ntohs(ip_hdr(cur->skb)->frag_off) & IP_OFFSET) != 0)
     {
         goto done_with_tests;
     }
@@ -121,19 +118,19 @@
        by comparing adjacent offset values and packet lengths*/
     while (cur)
     {
-        cur_offset = (ntohs(cur->skb->nh.iph->frag_off) & IP_OFFSET)*8;
+        cur_offset = (ntohs(ip_hdr(cur->skb)->frag_off) & IP_OFFSET)*8;
         if (cur_offset != prev_end_offset)
         { 
             goto done_with_tests;
         }
         prev = cur;
         prev_offset = cur_offset;
-        prev_end_offset = prev_offset + ntohs(prev->skb->nh.iph->tot_len)
-                          - (prev->skb->nh.iph->ihl*4);
+        prev_end_offset = prev_offset + ntohs(ip_hdr(prev->skb)->tot_len)
+                          - (ip_hdr(prev->skb)->ihl*4);
         cur = cur->next;
     } 
     /*last in queue must not have more frags set*/
-    if (ntohs(prev->skb->nh.iph->frag_off) & IP_MF)
+    if (ntohs(ip_hdr(prev->skb)->frag_off) & IP_MF)
     {
         goto done_with_tests;
     }
@@ -185,7 +182,7 @@
         /*not an IP packet*/
         goto done_with_tests;
     }
-    iph = skb->nh.iph;
+    iph = ip_hdr(skb);
     if (!iph)
     {
         printk(KERN_DEBUG "%s: skb->nh is NULL.", __FUNCTION__);
--- vpn/interceptor.c.org	2007-05-13 21:42:11 +0800
+++ vpn/interceptor.c	2007-05-13 21:40:22 +0800
@@ -339,7 +339,7 @@
 
     dp = NULL;
     num_target_devices = 0;
-    for (dp = dev_base; dp != NULL; dp = dp->next)
+    for_each_netdev(dp)
     {
         if (add_netdev(dp) == 0)
         {
@@ -569,9 +569,9 @@
     }
 
     reset_inject_status(&pBinding->recv_stat);
-    if (skb->mac.raw)
+    if (skb_mac_header(skb))
     {
-        hard_header_len = skb->data - skb->mac.raw;
+        hard_header_len = skb->data - skb_mac_header(skb);
         if ((hard_header_len < 0) || (hard_header_len > skb_headroom(skb)))
         {
             printk(KERN_DEBUG "bad hh len %d\n", hard_header_len);
@@ -588,7 +588,7 @@
     switch (hard_header_len)
     {
     case ETH_HLEN:
-        CniNewFragment(ETH_HLEN, skb->mac.raw, &MacHdr, CNI_USE_BUFFER);
+        CniNewFragment(ETH_HLEN, skb_mac_header(skb), &MacHdr, CNI_USE_BUFFER);
         break;
     case IPPP_MAX_HEADER:
     case 0:
@@ -692,7 +692,7 @@
     }
 #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     reset_inject_status(&pBinding->send_stat);
-    hard_header_len = skb->nh.raw - skb->data;
+    hard_header_len = skb_network_header(skb) - skb->data;
     pBinding->send_real_hh_len = hard_header_len;
     switch (hard_header_len)
     {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-14 19:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-14  1:13 patch for cisco client for Linux-2.6.22-rc1 Jeff Chua
2007-05-14 17:50 ` Jan Engelhardt
2007-05-14 19:48 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®