esp4.c (f94f3cb37a1c4d44dd2070cc4a6165689bda9c92) esp4.c (b71d1d426d263b0b6cb5760322efebbfc89d4463)
1#include <crypto/aead.h>
2#include <crypto/authenc.h>
3#include <linux/err.h>
4#include <linux/module.h>
5#include <net/ip.h>
6#include <net/xfrm.h>
7#include <net/esp.h>
8#include <linux/scatterlist.h>

--- 262 unchanged lines hidden (view full) ---

271 kfree(tmp);
272
273error:
274 return err;
275}
276
277static int esp_input_done2(struct sk_buff *skb, int err)
278{
1#include <crypto/aead.h>
2#include <crypto/authenc.h>
3#include <linux/err.h>
4#include <linux/module.h>
5#include <net/ip.h>
6#include <net/xfrm.h>
7#include <net/esp.h>
8#include <linux/scatterlist.h>

--- 262 unchanged lines hidden (view full) ---

271 kfree(tmp);
272
273error:
274 return err;
275}
276
277static int esp_input_done2(struct sk_buff *skb, int err)
278{
279 struct iphdr *iph;
279 const struct iphdr *iph;
280 struct xfrm_state *x = xfrm_input_state(skb);
281 struct esp_data *esp = x->data;
282 struct crypto_aead *aead = esp->aead;
283 int alen = crypto_aead_authsize(aead);
284 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
285 int elen = skb->len - hlen;
286 int ihl;
287 u8 nexthdr[2];

--- 191 unchanged lines hidden (view full) ---

479 }
480
481 return mtu - 2;
482}
483
484static void esp4_err(struct sk_buff *skb, u32 info)
485{
486 struct net *net = dev_net(skb->dev);
280 struct xfrm_state *x = xfrm_input_state(skb);
281 struct esp_data *esp = x->data;
282 struct crypto_aead *aead = esp->aead;
283 int alen = crypto_aead_authsize(aead);
284 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
285 int elen = skb->len - hlen;
286 int ihl;
287 u8 nexthdr[2];

--- 191 unchanged lines hidden (view full) ---

479 }
480
481 return mtu - 2;
482}
483
484static void esp4_err(struct sk_buff *skb, u32 info)
485{
486 struct net *net = dev_net(skb->dev);
487 struct iphdr *iph = (struct iphdr *)skb->data;
487 const struct iphdr *iph = (const struct iphdr *)skb->data;
488 struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2));
489 struct xfrm_state *x;
490
491 if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH ||
492 icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
493 return;
494
488 struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2));
489 struct xfrm_state *x;
490
491 if (icmp_hdr(skb)->type != ICMP_DEST_UNREACH ||
492 icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
493 return;
494
495 x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET);
495 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
496 esph->spi, IPPROTO_ESP, AF_INET);
496 if (!x)
497 return;
498 NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
499 ntohl(esph->spi), ntohl(iph->daddr));
500 xfrm_state_put(x);
501}
502
503static void esp_destroy(struct xfrm_state *x)

--- 227 unchanged lines hidden ---
497 if (!x)
498 return;
499 NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
500 ntohl(esph->spi), ntohl(iph->daddr));
501 xfrm_state_put(x);
502}
503
504static void esp_destroy(struct xfrm_state *x)

--- 227 unchanged lines hidden ---