Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256629
b: refs/heads/master
c: 415b333
h: refs/heads/master
i:
  256627: 45e1325
v: v3
  • Loading branch information
David S. Miller committed Jul 22, 2011
1 parent cc4d7e2 commit 651a888
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: ace62dd1a805ab9de9ef8d67585d0588cb379653
refs/heads/master: 415b3334a21aa67806c52d1acf4e72e14f7f402f
14 changes: 8 additions & 6 deletions trunk/net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static struct rtable *icmp_route_lookup(struct net *net,
struct icmp_bxm *param)
{
struct rtable *rt, *rt2;
struct flowi4 fl4_dec;
int err;

memset(fl4, 0, sizeof(*fl4));
Expand Down Expand Up @@ -408,27 +409,27 @@ static struct rtable *icmp_route_lookup(struct net *net,
} else
return rt;

err = xfrm_decode_session_reverse(skb_in, flowi4_to_flowi(fl4), AF_INET);
err = xfrm_decode_session_reverse(skb_in, flowi4_to_flowi(&fl4_dec), AF_INET);
if (err)
goto relookup_failed;

if (inet_addr_type(net, fl4->saddr) == RTN_LOCAL) {
rt2 = __ip_route_output_key(net, fl4);
if (inet_addr_type(net, fl4_dec.saddr) == RTN_LOCAL) {
rt2 = __ip_route_output_key(net, &fl4_dec);
if (IS_ERR(rt2))
err = PTR_ERR(rt2);
} else {
struct flowi4 fl4_2 = {};
unsigned long orefdst;

fl4_2.daddr = fl4->saddr;
fl4_2.daddr = fl4_dec.saddr;
rt2 = ip_route_output_key(net, &fl4_2);
if (IS_ERR(rt2)) {
err = PTR_ERR(rt2);
goto relookup_failed;
}
/* Ugh! */
orefdst = skb_in->_skb_refdst; /* save old refdst */
err = ip_route_input(skb_in, fl4->daddr, fl4->saddr,
err = ip_route_input(skb_in, fl4_dec.daddr, fl4_dec.saddr,
RT_TOS(tos), rt2->dst.dev);

dst_release(&rt2->dst);
Expand All @@ -440,10 +441,11 @@ static struct rtable *icmp_route_lookup(struct net *net,
goto relookup_failed;

rt2 = (struct rtable *) xfrm_lookup(net, &rt2->dst,
flowi4_to_flowi(fl4), NULL,
flowi4_to_flowi(&fl4_dec), NULL,
XFRM_LOOKUP_ICMP);
if (!IS_ERR(rt2)) {
dst_release(&rt->dst);
memcpy(fl4, &fl4_dec, sizeof(*fl4));
rt = rt2;
} else if (PTR_ERR(rt2) == -EPERM) {
if (rt)
Expand Down

0 comments on commit 651a888

Please sign in to comment.