Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287507
b: refs/heads/master
c: e6b4524
h: refs/heads/master
i:
  287505: c2da7aa
  287503: 97b9307
v: v3
  • Loading branch information
Julian Anastasov authored and David S. Miller committed Feb 5, 2012
1 parent 12aaaf6 commit 058187a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2446eaab5585555a38ea0df4e01ff313dbb4ac9
refs/heads/master: e6b45241c57a83197e5de9166b3b0d32ac562609
10 changes: 10 additions & 0 deletions trunk/include/net/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
fl4->fl4_dport = dport;
fl4->fl4_sport = sport;
}

/* Reset some input parameters after previous lookup */
static inline void flowi4_update_output(struct flowi4 *fl4, int oif, __u8 tos,
__be32 daddr, __be32 saddr)
{
fl4->flowi4_oif = oif;
fl4->flowi4_tos = tos;
fl4->daddr = daddr;
fl4->saddr = saddr;
}


struct flowi6 {
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
if (IS_ERR(rt))
return rt;
ip_rt_put(rt);
flowi4_update_output(fl4, oif, tos, fl4->daddr, fl4->saddr);
}
security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
return ip_route_output_flow(net, fl4, sk);
Expand All @@ -284,6 +285,9 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
fl4->fl4_dport = dport;
fl4->fl4_sport = sport;
ip_rt_put(rt);
flowi4_update_output(fl4, sk->sk_bound_dev_if,
RT_CONN_FLAGS(sk), fl4->daddr,
fl4->saddr);
security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
return ip_route_output_flow(sock_net(sk), fl4, sk);
}
Expand Down

0 comments on commit 058187a

Please sign in to comment.