[support] AF_UNSPEC AF_INET6 different and link how to establish

tony chen aoc90058 at gmail.com
Tue May 19 17:02:59 JST 2009


Hi , everybody.
I'm tracing the NEMO code in my project, but I have some problem.
Would anyone can reply me about following problem.

A.
When I trace the main()->process_link()
I find these code with two cases and run separated code.
1. ifi->ifi_family == AF_UNSPEC
    if (n->nlmsg_type == RTM_NEWLINK)
        process_new_link(ifi, rta_tb);
    else if (n->nlmsg_type == RTM_DELLINK)
        process_del_inet6_iface(ifi, rta_tb);
2. ifi->ifi_family == AF_INET6
    process_inet6_iface(n, ifi, rta_tb);

I can't understand why it must divided into two kinds of situations.
What different do we in AF_UNSPEC or AF_INET6?

B. In the process_new_link()

static int process_new_link(struct ifinfomsg *ifi, struct rtattr **rta_tb)
{
    struct md_inet6_iface *iface;
    if ((iface = md_get_inet6_iface(&ifaces, ifi->ifi_index)) != NULL &&
        link_flags_changed(ifi->ifi_flags, iface->link_flags)) {
        iface->link_flags = ifi->ifi_flags;
        if (md_is_link_up(iface))
            md_link_up(iface);
        else
            md_link_down(iface);
    }
    return 0;
}

The md_is_link_up() check the Link has established , so md_get_inet6_iface()
's opeartion is establishing the link ?
Thanks to every body view and reply my problem.

C.C. Hao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.nautilus6.org/pipermail/support/attachments/20090519/6e4547b0/attachment.htm 


More information about the Support mailing list