gnetworkmonitornetlink: handle default route via device
authorDan Winship <danw@gnome.org>
Tue, 4 Jun 2013 20:29:55 +0000 (17:29 -0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 1 Aug 2013 15:50:55 +0000 (16:50 +0100)
commit2d3837563f1087cf00630fc1d4126af7a5f25ebf
tree620807cef2f79f991bf5ef6b5da0d5c09bdba556
parent6d8ee5ef409f4497d18aa1676eef886184dd5d03
gnetworkmonitornetlink: handle default route via device

If the default route is via a device rather than a particular IP
address, then neither RTA_DST nor RTA_GATEWAY will be present in the
RTM_NEWROUTE message, and so GNetworkMonitorNetlink would ignore it,
and then think there was no default route. (This could happen with
certain kinds of VPNs, if they were set to route all traffic through
the VPN.)

Fix this by recognizing routes that specify RTA_OIF ("output
interface") instead of RTA_GATEWAY.

https://bugzilla.gnome.org/show_bug.cgi?id=701609
(cherry picked from commit c08ef6c165c6935f257d3fb98c049be50e3816da)
gio/gnetworkmonitornetlink.c