summaryrefslogtreecommitdiff
path: root/src/ipaddress.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-01 12:21:06 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-05 13:29:04 +0200
commit370414cebfb7073d4ccc31df49591211b2ffabd1 (patch)
tree8323c20486c7713865ccfc515a8d0e8b2006f41a /src/ipaddress.c
parent1618c2735449f17964b51c9f43349192b4b448fc (diff)
downloadconnman-370414cebfb7073d4ccc31df49591211b2ffabd1.tar.gz
connman-370414cebfb7073d4ccc31df49591211b2ffabd1.tar.bz2
connman-370414cebfb7073d4ccc31df49591211b2ffabd1.zip
ipconfig: Do not overwrite gateway address
If we have already received gateway address via newroute rtnl message, then do not overwrite it when receiving newaddr message. Fixes BMC#25931
Diffstat (limited to 'src/ipaddress.c')
-rw-r--r--src/ipaddress.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ipaddress.c b/src/ipaddress.c
index e5af9a06..f66bb674 100644
--- a/src/ipaddress.c
+++ b/src/ipaddress.c
@@ -177,7 +177,12 @@ void connman_ipaddress_clear(struct connman_ipaddress *ipaddress)
ipaddress->gateway = NULL;
}
-void connman_ipaddress_copy(struct connman_ipaddress *ipaddress,
+/*
+ * Note that this copy function only copies the actual address and
+ * prefixlen. If you need full copy of ipaddress struct, then you need
+ * to create a new function that does that.
+ */
+void connman_ipaddress_copy_address(struct connman_ipaddress *ipaddress,
struct connman_ipaddress *source)
{
if (ipaddress == NULL || source == NULL)
@@ -188,13 +193,4 @@ void connman_ipaddress_copy(struct connman_ipaddress *ipaddress,
g_free(ipaddress->local);
ipaddress->local = g_strdup(source->local);
-
- g_free(ipaddress->peer);
- ipaddress->peer = g_strdup(source->peer);
-
- g_free(ipaddress->broadcast);
- ipaddress->broadcast = g_strdup(source->broadcast);
-
- g_free(ipaddress->gateway);
- ipaddress->gateway = g_strdup(source->gateway);
}