Skip to content

initRouteTable() code question #93

Description

@zhao-wuji-ahh

Hi,Why the api named initRouteTable() but the api mainly deal with joining the default groups.Is it necessary make the line (routing_table = NULL) in the api? It makes me confused.
void initRouteTable(void) {
unsigned Ix;
struct IfDesc *Dp;

// Clear routing table...
routing_table = NULL;

// Join the all routers group on downstream vifs...
for ( Ix = 0; (Dp = getIfByIx(Ix)); Ix++ ) {
    // If this is a downstream vif, we should join the All routers group...
    if( Dp->InAdr.s_addr && ! (Dp->Flags & IFF_LOOPBACK) && Dp->state == IF_STATE_DOWNSTREAM) {
        my_log(LOG_DEBUG, 0, "Joining all-routers group %s on vif %s",
                     inetFmt(allrouters_group,s1),inetFmt(Dp->InAdr.s_addr,s2));

        k_join(Dp, allrouters_group);

        my_log(LOG_DEBUG, 0, "Joining all igmpv3 multicast routers group %s on vif %s",
                     inetFmt(alligmp3_group,s1),inetFmt(Dp->InAdr.s_addr,s2));
        k_join(Dp, alligmp3_group);
    }
}

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions