[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1443021322-48621-6-git-send-email-dsa@cumulusnetworks.com>
Date: Wed, 23 Sep 2015 08:15:18 -0700
From: David Ahern <dsa@...ulusnetworks.com>
To: netdev@...r.kernel.org
Cc: David Ahern <dsa@...ulusnetworks.com>
Subject: [PATCH net-next 5/9] net: Move martian_destination to helper
Move stat and logging for martian_destination error into helper function
similar to ip_handle_martian_source. Code move only; no functional change.
Signed-off-by: David Ahern <dsa@...ulusnetworks.com>
---
net/ipv4/route.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 35a19d15232a..8e0fb1e4de72 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1531,6 +1531,20 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
return err;
}
+/*
+ * Do not cache martian addresses: they should be logged (RFC1812)
+ */
+static void ip_handle_martian_dest(struct net_device *dev,
+ struct in_device *in_dev,
+ __be32 daddr, __be32 saddr)
+{
+ RT_CACHE_STAT_INC(in_martian_dst);
+#ifdef CONFIG_IP_ROUTE_VERBOSE
+ if (IN_DEV_LOG_MARTIANS(in_dev))
+ net_warn_ratelimited("martian destination %pI4 from %pI4, dev %s\n",
+ &daddr, &saddr, dev->name);
+#endif
+}
static void ip_handle_martian_source(struct net_device *dev,
struct in_device *in_dev,
@@ -1855,17 +1869,9 @@ out: return err;
res.table = NULL;
goto local_input;
- /*
- * Do not cache martian addresses: they should be logged (RFC1812)
- */
martian_destination:
err = -EINVAL;
- RT_CACHE_STAT_INC(in_martian_dst);
-#ifdef CONFIG_IP_ROUTE_VERBOSE
- if (IN_DEV_LOG_MARTIANS(in_dev))
- net_warn_ratelimited("martian destination %pI4 from %pI4, dev %s\n",
- &daddr, &saddr, dev->name);
-#endif
+ ip_handle_martian_dest(dev, in_dev, daddr, saddr);
goto out;
martian_source:
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists