return 0;
}
-static int ah_output(struct sk_buff **pskb)
+static int ah_output(struct sk_buff *skb)
{
int err;
- struct dst_entry *dst = (*pskb)->dst;
+ struct dst_entry *dst = skb->dst;
struct xfrm_state *x = dst->xfrm;
struct iphdr *iph, *top_iph;
struct ip_auth_hdr *ah;
char buf[60];
} tmp_iph;
- top_iph = (*pskb)->nh.iph;
+ top_iph = skb->nh.iph;
iph = &tmp_iph.iph;
iph->tos = top_iph->tos;
ah->nexthdr = top_iph->protocol;
top_iph->tos = 0;
- top_iph->tot_len = htons((*pskb)->len);
+ top_iph->tot_len = htons(skb->len);
top_iph->frag_off = 0;
top_iph->ttl = 0;
top_iph->protocol = IPPROTO_AH;
ah->reserved = 0;
ah->spi = x->id.spi;
ah->seq_no = htonl(++x->replay.oseq);
- ahp->icv(ahp, *pskb, ah->auth_data);
+ ahp->icv(ahp, skb, ah->auth_data);
top_iph->tos = iph->tos;
top_iph->ttl = iph->ttl;
return err;
}
-int ah_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
+static int ah_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
{
int ah_hlen;
struct iphdr *iph;
return -EINVAL;
}
-void ah4_err(struct sk_buff *skb, u32 info)
+static void ah4_err(struct sk_buff *skb, u32 info)
{
struct iphdr *iph = (struct iphdr*)skb->data;
struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+(iph->ihl<<2));
if (x->aalg->alg_key_len > 512)
goto error;
+ if (x->encap)
+ goto error;
+
ahp = kmalloc(sizeof(*ahp), GFP_KERNEL);
if (ahp == NULL)
return -ENOMEM;