Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 898f7358 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parent fa17a019
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -474,10 +474,11 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
					   struct sk_buff *skb)
{
	struct rtable *rt;
	const struct iphdr *iph = ip_hdr(skb);
	struct flowi4 fl4 = {
		.flowi4_oif = skb_rtable(skb)->rt_iif,
		.daddr = ip_hdr(skb)->saddr,
		.saddr = ip_hdr(skb)->daddr,
		.daddr = iph->saddr,
		.saddr = iph->daddr,
		.flowi4_tos = RT_CONN_FLAGS(sk),
		.flowi4_proto = sk->sk_protocol,
		.fl4_sport = dccp_hdr(skb)->dccph_dport,