ipcomp6.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) ipcomp6.c (b71d1d426d263b0b6cb5760322efebbfc89d4463)
1/*
2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173
3 *
4 * Copyright (C)2003 USAGI/WIDE Project
5 *
6 * Author Mitsuru KANDA <mk@linux-ipv6.org>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

50#include <linux/icmpv6.h>
51#include <linux/mutex.h>
52
53static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
54 u8 type, u8 code, int offset, __be32 info)
55{
56 struct net *net = dev_net(skb->dev);
57 __be32 spi;
1/*
2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173
3 *
4 * Copyright (C)2003 USAGI/WIDE Project
5 *
6 * Author Mitsuru KANDA <mk@linux-ipv6.org>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

50#include <linux/icmpv6.h>
51#include <linux/mutex.h>
52
53static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
54 u8 type, u8 code, int offset, __be32 info)
55{
56 struct net *net = dev_net(skb->dev);
57 __be32 spi;
58 struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
58 const struct ipv6hdr *iph = (const struct ipv6hdr *)skb->data;
59 struct ip_comp_hdr *ipcomph =
60 (struct ip_comp_hdr *)(skb->data + offset);
61 struct xfrm_state *x;
62
63 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
64 return;
65
66 spi = htonl(ntohs(ipcomph->cpi));
59 struct ip_comp_hdr *ipcomph =
60 (struct ip_comp_hdr *)(skb->data + offset);
61 struct xfrm_state *x;
62
63 if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
64 return;
65
66 spi = htonl(ntohs(ipcomph->cpi));
67 x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6);
67 x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
68 spi, IPPROTO_COMP, AF_INET6);
68 if (!x)
69 return;
70
71 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI6\n",
72 spi, &iph->daddr);
73 xfrm_state_put(x);
74}
75

--- 142 unchanged lines hidden ---
69 if (!x)
70 return;
71
72 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI6\n",
73 spi, &iph->daddr);
74 xfrm_state_put(x);
75}
76

--- 142 unchanged lines hidden ---