Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71285
b: refs/heads/master
c: 33b5ecb
h: refs/heads/master
i:
  71283: 4287a40
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 18, 2007
1 parent d2e42f3 commit 1a9a321
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4541b41c0e4b75b11125fed16db642fc03cb31c
refs/heads/master: 33b5ecb8f64706d1ed472dcb44162ab3a7345724
2 changes: 1 addition & 1 deletion trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi)
extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi);
extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
extern int xfrm6_rcv(struct sk_buff *skb);
extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
xfrm_address_t *saddr, u8 proto);
Expand Down
9 changes: 4 additions & 5 deletions trunk/net/ipv6/xfrm6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
#include <net/ipv6.h>
#include <net/xfrm.h>

int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi)
{
int err;
__be32 seq;
struct xfrm_state *xfrm_vec[XFRM_MAX_DEPTH];
struct xfrm_state *x;
int xfrm_nr = 0;
int decaps = 0;
int nexthdr;
unsigned int nhoff;

nhoff = IP6CB(skb)->nhoff;
nexthdr = skb_network_header(skb)[nhoff];

seq = 0;
if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
Expand All @@ -41,7 +39,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
goto drop;

x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi,
nexthdr != IPPROTO_IPIP ? nexthdr : IPPROTO_IPV6, AF_INET6);
nexthdr, AF_INET6);
if (x == NULL)
goto drop;
spin_lock(&x->lock);
Expand Down Expand Up @@ -135,7 +133,8 @@ EXPORT_SYMBOL(xfrm6_rcv_spi);

int xfrm6_rcv(struct sk_buff *skb)
{
return xfrm6_rcv_spi(skb, 0);
return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff],
0);
}

EXPORT_SYMBOL(xfrm6_rcv);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/xfrm6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb)
__be32 spi;

spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&iph->saddr);
return xfrm6_rcv_spi(skb, spi) > 0 ? : 0;
return xfrm6_rcv_spi(skb, IPPROTO_IPV6, spi) > 0 ? : 0;
}

static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
Expand Down

0 comments on commit 1a9a321

Please sign in to comment.