git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
net
/
ipv6
/
xfrm6_input.c
diff --git
a/net/ipv6/xfrm6_input.c
b/net/ipv6/xfrm6_input.c
index
c679a3c
..
28c29d7
100644
(file)
--- a/
net/ipv6/xfrm6_input.c
+++ b/
net/ipv6/xfrm6_input.c
@@
-9,7
+9,9
@@
* IPv6 support
*/
* IPv6 support
*/
+#include <linux/module.h>
#include <linux/string.h>
#include <linux/string.h>
+#include <net/dsfield.h>
#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/ipv6.h>
@@
-20,28
+22,27
@@
static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
struct ipv6hdr *outer_iph = skb->nh.ipv6h;
struct ipv6hdr *inner_iph = skb->h.ipv6h;
struct ipv6hdr *outer_iph = skb->nh.ipv6h;
struct ipv6hdr *inner_iph = skb->h.ipv6h;
- if (INET_ECN_is_ce(ip6_get_dsfield(outer_iph)) &&
- INET_ECN_is_not_ce(ip6_get_dsfield(inner_iph)))
+ if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
IP6_ECN_set_ce(inner_iph);
}
IP6_ECN_set_ce(inner_iph);
}
-int xfrm6_rcv
(struct sk_buff **pskb, unsigned int *nhoffp
)
+int xfrm6_rcv
_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi
)
{
struct sk_buff *skb = *pskb;
int err;
{
struct sk_buff *skb = *pskb;
int err;
- u32 s
pi, s
eq;
+ u32 seq;
struct sec_decap_state xfrm_vec[XFRM_MAX_DEPTH];
struct xfrm_state *x;
int xfrm_nr = 0;
int decaps = 0;
struct sec_decap_state xfrm_vec[XFRM_MAX_DEPTH];
struct xfrm_state *x;
int xfrm_nr = 0;
int decaps = 0;
- int nexthdr
= 0
;
- u
8 *prevhdr = NULL
;
+ int nexthdr;
+ u
nsigned int nhoff
;
- ip6_find_1stfragopt(skb, &prevhdr);
- nexthdr = *prevhdr;
- *nhoffp = prevhdr - skb->nh.raw;
+ nhoff = *nhoffp;
+ nexthdr = skb->nh.raw[nhoff];
- if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
+ seq = 0;
+ if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
goto drop;
do {
goto drop;
do {
@@
-67,6
+68,8
@@
int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
if (nexthdr <= 0)
goto drop_unlock;
if (nexthdr <= 0)
goto drop_unlock;
+ skb->nh.raw[nhoff] = nexthdr;
+
if (x->props.replay_window)
xfrm_replay_advance(x, seq);
if (x->props.replay_window)
xfrm_replay_advance(x, seq);
@@
-85,6
+88,8
@@
int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
if (skb_cloned(skb) &&
pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
goto drop;
if (skb_cloned(skb) &&
pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
goto drop;
+ if (x->props.flags & XFRM_STATE_DECAP_DSCP)
+ ipv6_copy_dscp(skb->nh.ipv6h, skb->h.ipv6h);
if (!(x->props.flags & XFRM_STATE_NOECN))
ipip6_ecn_decapsulate(skb);
skb->mac.raw = memmove(skb->data - skb->mac_len,
if (!(x->props.flags & XFRM_STATE_NOECN))
ipip6_ecn_decapsulate(skb);
skb->mac.raw = memmove(skb->data - skb->mac_len,
@@
-136,3
+141,10
@@
drop:
kfree_skb(skb);
return -1;
}
kfree_skb(skb);
return -1;
}
+
+EXPORT_SYMBOL(xfrm6_rcv_spi);
+
+int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
+{
+ return xfrm6_rcv_spi(pskb, nhoffp, 0);
+}