提交 898f7358 编写于 作者: D David S. Miller

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: NDavid S. Miller <davem@davemloft.net>
上级 fa17a019
...@@ -474,10 +474,11 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, ...@@ -474,10 +474,11 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct rtable *rt; struct rtable *rt;
const struct iphdr *iph = ip_hdr(skb);
struct flowi4 fl4 = { struct flowi4 fl4 = {
.flowi4_oif = skb_rtable(skb)->rt_iif, .flowi4_oif = skb_rtable(skb)->rt_iif,
.daddr = ip_hdr(skb)->saddr, .daddr = iph->saddr,
.saddr = ip_hdr(skb)->daddr, .saddr = iph->daddr,
.flowi4_tos = RT_CONN_FLAGS(sk), .flowi4_tos = RT_CONN_FLAGS(sk),
.flowi4_proto = sk->sk_protocol, .flowi4_proto = sk->sk_protocol,
.fl4_sport = dccp_hdr(skb)->dccph_dport, .fl4_sport = dccp_hdr(skb)->dccph_dport,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册