Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initRouteTable() code question #93

Open
zhao-wuji-ahh opened this issue Jan 31, 2023 · 0 comments
Open

initRouteTable() code question #93

zhao-wuji-ahh opened this issue Jan 31, 2023 · 0 comments

Comments

@zhao-wuji-ahh
Copy link

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);
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant