Skip to content

Commit

Permalink
net: pim: add a helper to check for IPv4 all pim routers address
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Oct 31, 2016
1 parent 556d299 commit 20bb6ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/pim.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 20bb6ce

Please sign in to comment.