adding multicast route to the kernel

adding multicast route to the kernel

Post by Nirmal Vuppulu » Sun, 27 Oct 2002 01:29:55

Hi all,

I have a question which probably has a very simple answer.  I'm trying
to insert multicast routes into the kernel using setsockopt with
MRT_ADD_MFC on an IGMP socket... just like most multicast routing

What I want to do is to be able to say "all multicast packets going to
<mcast addr> from any source coming in from <incoming interface>
should go out on <outgoing interface>".  Now, I've looked at smcroute
code and pimd code.  What should mfcctl.mfcc_origin be set to when I
do the setsockopt() call?  Should it be set to ?  That doesn't
seem to work.  What value signifies "all IP addresses"??

I looked at ipmr_input() in ipmr.c in the kernel sources and found
that it does a "straight" cache lookup.  I mean, it just takes the
source IP address and the destination multicast address from the IP
datagram and does a cache lookup.  It doesn't try to do a "wildcard"

However, I know that routing daemons like PIMD have to add routes of
the form
(*, G).  And I did find that they set mfcctl.mfcc_origin to
But I'm not sure how it works for PIMD.

Any help is greatly appreciated.