ipv4: sendto/hdrincl: don't use destination address found in header
authorChris Clark <chris.clark@alcatel-lucent.com>
Tue, 27 Aug 2013 18:02:15 +0000 (12:02 -0600)
committerDanny Wood <danwood76@gmail.com>
Tue, 28 Jul 2020 08:47:01 +0000 (09:47 +0100)
commit322f496d0fa2ea9cb0afb1a35c84d0292fd64894
treecbcab66740c262811fcda86bbc46ff79f5a22f64
parent773724a38d7e0120f49673d9e497f2fc8c038e1a
ipv4: sendto/hdrincl: don't use destination address found in header

ipv4: raw_sendmsg: don't use header's destination address

A sendto() regression was bisected and found to start with commit
f8126f1d5136be1 (ipv4: Adjust semantics of rt->rt_gateway.)

The problem is that it tries to ARP-lookup the constructed packet's
destination address rather than the explicitly provided address.

Fix this using FLOWI_FLAG_KNOWN_NH so that given nexthop is used.

cf. commit 2ad5b9e4bd314fc685086b99e90e5de3bc59e26b

Reported-by: Chris Clark <chris.clark@alcatel-lucent.com>
Bisected-by: Chris Clark <chris.clark@alcatel-lucent.com>
Tested-by: Chris Clark <chris.clark@alcatel-lucent.com>
Suggested-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Chris Clark <chris.clark@alcatel-lucent.com>
Change-Id: I06c9f3a0bca97a4b190e31543345e5accbf73a6d
net/ipv4/raw.c