aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-12-01 13:28:34 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-01 13:28:34 -0500
commit898f73585bbe4bdbb471636ecdede071f7473e51 (patch)
tree73a587dbc21e397737984808bfa9c8594f06210d /net/dccp
parentfa17a019c87e2ed25b653844f668f111ee059e56 (diff)
dccp: Evaluate ip_hdr() only once in dccp_v4_route_skb().
This also works around a bogus gcc warning generated by an upcoming patch from Eric Dumazet that rearranges the layout of struct flowi4. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/ipv4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 3f4e5414c8e5..1c67fe8ff90d 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -474,10 +474,11 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
474 struct sk_buff *skb) 474 struct sk_buff *skb)
475{ 475{
476 struct rtable *rt; 476 struct rtable *rt;
477 const struct iphdr *iph = ip_hdr(skb);
477 struct flowi4 fl4 = { 478 struct flowi4 fl4 = {
478 .flowi4_oif = skb_rtable(skb)->rt_iif, 479 .flowi4_oif = skb_rtable(skb)->rt_iif,
479 .daddr = ip_hdr(skb)->saddr, 480 .daddr = iph->saddr,
480 .saddr = ip_hdr(skb)->daddr, 481 .saddr = iph->daddr,
481 .flowi4_tos = RT_CONN_FLAGS(sk), 482 .flowi4_tos = RT_CONN_FLAGS(sk),
482 .flowi4_proto = sk->sk_protocol, 483 .flowi4_proto = sk->sk_protocol,
483 .fl4_sport = dccp_hdr(skb)->dccph_dport, 484 .fl4_sport = dccp_hdr(skb)->dccph_dport,