mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 21:40:08 +01:00
2007-07-26 Dan Williams <dcbw@redhat.com>
Patch from Bernhard Miklautz <bernhard.miklautz@shacknet.at> * src/NetworkManagerSystem.c - (nm_system_device_set_ip4_route): don't add the route if it's on the same subnet (#437396) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2651 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
b3e0586150
commit
59749f4c33
2 changed files with 19 additions and 0 deletions
|
|
@ -1,3 +1,11 @@
|
|||
2007-07-26 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Bernhard Miklautz <bernhard.miklautz@shacknet.at>
|
||||
|
||||
* src/NetworkManagerSystem.c
|
||||
- (nm_system_device_set_ip4_route): don't add the route if it's on the
|
||||
same subnet (#437396)
|
||||
|
||||
2007-07-26 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Kelemen Gábor <kelemeng@gnome.hu>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ nm_system_device_set_ip4_route (NMDevice *dev,
|
|||
struct rtentry rtent;
|
||||
struct sockaddr_in *p;
|
||||
const char * iface;
|
||||
NMIP4Config * config = NULL;
|
||||
int err;
|
||||
struct rtentry rtent2;
|
||||
|
||||
|
|
@ -81,6 +82,16 @@ nm_system_device_set_ip4_route (NMDevice *dev,
|
|||
|
||||
iface = nm_device_get_iface (dev);
|
||||
|
||||
/*
|
||||
* Do not add the route if the destination is on the same subnet.
|
||||
*/
|
||||
config = nm_device_get_ip4_config(dev);
|
||||
if (config &&
|
||||
((guint32)ip4_dest & nm_ip4_config_get_netmask(config)) ==
|
||||
(nm_ip4_config_get_address(config) & nm_ip4_config_get_netmask(config)))
|
||||
return TRUE;
|
||||
|
||||
|
||||
if ((sk = nm_dev_sock_open (iface, NETWORK_CONTROL, __func__, NULL)) == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue