Skip to content

Commit

Permalink
modules/network: add routing data to debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCrion committed Jul 20, 2024
1 parent 12ba962 commit 61e2117
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ static gboolean net_rt_parse (GIOChannel *chan, GIOCondition cond, gpointer d)
!g_strcmp0(route->name,if_indextoname(
((struct ifinfomsg *)NLMSG_DATA(hdr))->ifi_index,ifname)))
{
g_debug("netinfo: delete default gw iface: %s", route?route->name:"?");
g_debug("netinfo: delete default gw iface: %s (%x %x)",
route?route->name:"?", gate.s_addr, dest.s_addr);
net_set_interface(0,gate,gate6);
}
else if(hdr->nlmsg_type == RTM_NEWLINK)
Expand Down Expand Up @@ -342,13 +343,14 @@ static gboolean net_rt_parse (GIOChannel *chan, GIOCondition cond, gpointer d)
iidx && !(((struct rtmsg *)NLMSG_DATA(hdr))->rtm_dst_len))
{
net_set_interface(iidx, gate,gate6);
g_debug("netinfo: new default gw route on: %s", route?route->name:"?");
g_debug("netinfo: new default gw route on: %s (%x %x)",
route?route->name:"?", gate.s_addr, dest.s_addr);
}
else if(hdr->nlmsg_type==RTM_DELROUTE && !dest.s_addr && iidx &&
!(((struct rtmsg *)NLMSG_DATA(hdr))->rtm_dst_len))
{
g_debug("netinfo: delete default gw route on: %s",
route?route->name:"?");
g_debug("netinfo: delete default gw route on: %s (%x %x)",
route?route->name:"?", gate.s_addr, dest.s_addr);
net_set_interface(0, gate,gate6);
}
}
Expand Down

0 comments on commit 61e2117

Please sign in to comment.