[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1477916465-20406-3-git-send-email-nikolay@cumulusnetworks.com>
Date: Mon, 31 Oct 2016 13:21:03 +0100
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: netdev@...r.kernel.org
Cc: roopa@...ulusnetworks.com, dwalton@...ulusnetworks.com,
stephen@...workplumber.org, davem@...emloft.net,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Subject: [PATCH net-next 2/4] net: pim: add a helper to check for IPv4 all pim routers address
Signed-off-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
---
include/linux/pim.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/pim.h b/include/linux/pim.h
index 354235a2691b..1b6c0dbba94e 100644
--- a/include/linux/pim.h
+++ b/include/linux/pim.h
@@ -57,4 +57,10 @@ static inline u8 pim_hdr_type(const struct pimhdr *pimhdr)
{
return pimhdr->type & 0xf;
}
+
+/* check if the address is 224.0.0.13, RFC7761 sec 4.3.1 */
+static inline bool pim_ipv4_all_pim_routers(__be32 addr)
+{
+ return addr == htonl(0xE000000D);
+}
#endif
--
2.1.4
Powered by blists - more mailing lists