diff -purN -X /home/mbligh/.diff.exclude 371-qlogic/net/ipv4/esp4.c 380-protocol254/net/ipv4/esp4.c --- 371-qlogic/net/ipv4/esp4.c 2003-10-01 11:41:19.000000000 -0700 +++ 380-protocol254/net/ipv4/esp4.c 2003-12-02 14:58:33.000000000 -0800 @@ -10,6 +10,7 @@ #include #include #include +#include #define MAX_SG_ONSTACK 4 @@ -325,7 +326,15 @@ int esp_input(struct xfrm_state *x, stru skb->h.raw = skb_pull(skb, sizeof(struct ip_esp_hdr) + esp->conf.ivlen); skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen; memcpy(skb->nh.raw, workbuf, iph->ihl*4); - skb->nh.iph->tot_len = htons(skb->len); + iph = skb->nh.iph; + iph->tot_len = htons(skb->len + (skb->data - skb->nh.raw)); + iph->check = 0; + iph->check = ip_fast_csum(skb->nh.raw, iph->ihl); + { + unsigned char *oldmac = skb->mac.raw; + skb->mac.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen; + memmove(skb->mac.raw, oldmac, skb->nh.raw - skb->mac.raw); + } } return 0; diff -purN -X /home/mbligh/.diff.exclude 371-qlogic/net/ipv4/xfrm4_input.c 380-protocol254/net/ipv4/xfrm4_input.c --- 371-qlogic/net/ipv4/xfrm4_input.c 2003-10-01 11:41:20.000000000 -0700 +++ 380-protocol254/net/ipv4/xfrm4_input.c 2003-12-02 14:58:33.000000000 -0800 @@ -93,13 +93,18 @@ int xfrm4_rcv_encap(struct sk_buff *skb, iph = skb->nh.iph; if (x->props.mode) { - if (iph->protocol != IPPROTO_IPIP) + if (iph->protocol == IPPROTO_IPIP) { + skb->nh.raw = skb->data; + if (!(x->props.flags & XFRM_STATE_NOECN)) + ipip_ecn_decapsulate(iph, skb); + iph = skb->nh.iph; + memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); + } else if (iph->protocol == 254) { + skb_push(skb, skb->data - skb->nh.raw); + } + else { goto drop; - skb->nh.raw = skb->data; - if (!(x->props.flags & XFRM_STATE_NOECN)) - ipip_ecn_decapsulate(iph, skb); - iph = skb->nh.iph; - memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); + } decaps = 1; break; }