summaryrefslogtreecommitdiffstats
path: root/include/linux/pim.h
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2016-10-31 13:21:03 +0100
committerDavid S. Miller <davem@davemloft.net>2016-10-31 16:18:30 -0400
commit20bb6ce9879e19eee7539329eaa2408d12b00306 (patch)
treef6a5cb2fed87b2e20eaad1a5c2a5815eab6a8caf /include/linux/pim.h
parent556d299fcb4af8f2e8eacf311c4eee352c746788 (diff)
downloadlinux-20bb6ce9879e19eee7539329eaa2408d12b00306.tar.gz
linux-20bb6ce9879e19eee7539329eaa2408d12b00306.tar.bz2
linux-20bb6ce9879e19eee7539329eaa2408d12b00306.zip
net: pim: add a helper to check for IPv4 all pim routers address
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pim.h')
-rw-r--r--include/linux/pim.h6
1 files changed, 6 insertions, 0 deletions
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