diff --git a/src/nl.c b/src/nl.c index 1a0ff5e1f50b452f457b9cbe7693b4caaff23a0e..739f6c80f58b8678bb1cb2220b8e5fb6c4f3ff48 100644 --- a/src/nl.c +++ b/src/nl.c @@ -82,13 +82,13 @@ static int func(struct nl_msg *msg, void *arg) if_indextoname(ifi->ifi_index, ifname); - //printf("ifname = %s ifindex = %d status = %s action = %s\n", - // ifname, - // ifi->ifi_index, - // !!(ifi->ifi_flags & IFF_UP) ? "up" : "down", - // nlh->nlmsg_type == RTM_GETLINK ? "RTM_GETLINK" : - // nlh->nlmsg_type == RTM_NEWLINK ? "RTM_NEWLINK" : - // "RTM_DELLINK"); + printf("xxx ifname = %s ifindex = %d status = %s action = %s\n", + ifname, + ifi->ifi_index, + !!(ifi->ifi_flags & IFF_UP) ? "up" : "down", + nlh->nlmsg_type == RTM_GETLINK ? "RTM_GETLINK" : + nlh->nlmsg_type == RTM_NEWLINK ? "RTM_NEWLINK" : + "RTM_DELLINK"); //if (!(ifi->ifi_flags & IFF_UP)) // break; @@ -119,13 +119,13 @@ static int func(struct nl_msg *msg, void *arg) bool found = false; if (br_get_iflist(bridge, &num, if_list)) { - printf("Failed to check bridge affiliation\n"); + printf("xxx Failed to check bridge affiliation\n"); break; } max = (num < max) ? num : max; for (i = 0; i < max; i++) { if (!strncmp(ifname, if_list[i], 15)) { - printf("Interface %s is already a part of bridge\n", + printf("xxx Interface %s is already a part of bridge\n", ifname); found = true; break; @@ -135,21 +135,25 @@ static int func(struct nl_msg *msg, void *arg) break; } - printf("Adding interface %s to bridge %s!\n", ifname, + printf("xxx Adding interface %s to bridge %s!\n", ifname, bridge); /* add wds iface to bridge */ ret = br_addif(bridge, ifname); if (!ret) - printf("Successfully added interface %s to bridge %s\n", + printf("xxx Successfully added interface %s to bridge %s\n", ifname, bridge); + else + printf("xxx br_addif failed\n"); /* bring up wds interface */ //ret = if_setflags(ifname, IFF_UP); ret = if_updown(ifname, true); if (!ret) - printf("Successfully brought up interface %s\n", + printf("xxx Successfully brought up interface %s\n", ifname); + else + printf("xxx ifup failed\n"); break; } default: