Commit a88478b2 authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by David S. Miller

[IPSEC]: ah/esp, 0 was used as tunnels protocol.

parent d489276e
...@@ -189,7 +189,7 @@ int ah_output(struct sk_buff *skb) ...@@ -189,7 +189,7 @@ int ah_output(struct sk_buff *skb)
top_iph->saddr = x->props.saddr.xfrm4_addr; top_iph->saddr = x->props.saddr.xfrm4_addr;
top_iph->daddr = x->id.daddr.xfrm4_addr; top_iph->daddr = x->id.daddr.xfrm4_addr;
ah = (struct ip_auth_hdr*)(top_iph+1); ah = (struct ip_auth_hdr*)(top_iph+1);
ah->nexthdr = IPPROTO_IP; ah->nexthdr = IPPROTO_IPIP;
} else { } else {
memcpy(&tmp_iph, skb->data, iph->ihl*4); memcpy(&tmp_iph, skb->data, iph->ihl*4);
top_iph = (struct iphdr*)skb_push(skb, x->props.header_len); top_iph = (struct iphdr*)skb_push(skb, x->props.header_len);
......
...@@ -370,7 +370,7 @@ int esp_output(struct sk_buff *skb) ...@@ -370,7 +370,7 @@ int esp_output(struct sk_buff *skb)
if (x->props.mode) { if (x->props.mode) {
top_iph = (struct iphdr*)skb_push(skb, x->props.header_len); top_iph = (struct iphdr*)skb_push(skb, x->props.header_len);
esph = (struct ip_esp_hdr*)(top_iph+1); esph = (struct ip_esp_hdr*)(top_iph+1);
*(u8*)(trailer->tail - 1) = IPPROTO_IP; *(u8*)(trailer->tail - 1) = IPPROTO_IPIP;
top_iph->ihl = 5; top_iph->ihl = 5;
top_iph->version = 4; top_iph->version = 4;
top_iph->tos = iph->tos; /* DS disclosed */ top_iph->tos = iph->tos; /* DS disclosed */
......
...@@ -91,7 +91,7 @@ int xfrm4_rcv(struct sk_buff *skb) ...@@ -91,7 +91,7 @@ int xfrm4_rcv(struct sk_buff *skb)
iph = skb->nh.iph; iph = skb->nh.iph;
if (x->props.mode) { if (x->props.mode) {
if (iph->protocol != IPPROTO_IP) if (iph->protocol != IPPROTO_IPIP)
goto drop; goto drop;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
iph = skb->nh.iph; iph = skb->nh.iph;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment