[<prev] [next>] [day] [month] [year] [list]
Message-ID: <aSd4Xj8rHrh-krjy@4944566b5c925f79>
Date: Wed, 26 Nov 2025 22:59:58 +0100
From: Clara Engler <cve@....cx>
To: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: davem@...emloft.net, dsahern@...nel.org, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, horms@...nel.org, cve@....cx
Subject: [PATCH] ipv4: Fix log message for martian source
From: Clara Engler <cve@....cx>
At the current moment, the log message for packets with a martian source
IP address is wrong. In fact, the current syntax looks as follows:
```
martian source <DESTINATION> from <SOURCE>, on dev <DEV>
```
This is wrong because `<SOURCE>` and `<DESTINATION>` need to be swapped.
Another verification for this claim can be seen when looking at the
(correct) implementation for logging packets with a martian destination
IP address, which happens to be identical, as it can be seen in line
2477 on the same file.
Signed-off-by: Clara Engler <cve@....cx>
---
net/ipv4/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index b549d6a57307..913de56d2c2d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1796,7 +1796,7 @@ static void ip_handle_martian_source(struct net_device *dev,
* the only hint is MAC header.
*/
pr_warn("martian source %pI4 from %pI4, on dev %s\n",
- &daddr, &saddr, dev->name);
+ &saddr, &daddr, dev->name);
if (dev->hard_header_len && skb_mac_header_was_set(skb)) {
print_hex_dump(KERN_WARNING, "ll header: ",
DUMP_PREFIX_OFFSET, 16, 1,
--
2.50.1 (Apple Git-155)
Powered by blists - more mailing lists