summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-08 21:11:58 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-08-08 21:11:58 -0700
commit31b83a676bca0c0da58195aefb6dd2f618cdac17 (patch)
tree7c4bd5efd4374734fec9643e4ce5fc76f1df9a04 /src/rtnl.c
parenteedda82541e0cc367f784c3551277d40c53b28f5 (diff)
downloadconnman-31b83a676bca0c0da58195aefb6dd2f618cdac17.tar.gz
connman-31b83a676bca0c0da58195aefb6dd2f618cdac17.tar.bz2
connman-31b83a676bca0c0da58195aefb6dd2f618cdac17.zip
Fix issue with gateway notification for non default routes
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index c6fd27e7..785a1de6 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -425,32 +425,38 @@ static void process_delroute(unsigned char family, unsigned char scope,
static void process_newgateway(struct rtmsg *msg, int bytes)
{
GSList *list;
- struct in_addr addr;
+ struct in_addr dst = { INADDR_ANY }, gateway = { INADDR_ANY };
int index = -1;
- extract_route(msg, bytes, &index, NULL, &addr);
+ extract_route(msg, bytes, &index, &dst, &gateway);
+
+ if (dst.s_addr != INADDR_ANY)
+ return;
for (list = rtnl_list; list; list = list->next) {
struct connman_rtnl *rtnl = list->data;
if (rtnl->newgateway)
- rtnl->newgateway(index, inet_ntoa(addr));
+ rtnl->newgateway(index, inet_ntoa(gateway));
}
}
static void process_delgateway(struct rtmsg *msg, int bytes)
{
GSList *list;
- struct in_addr addr;
+ struct in_addr dst = { INADDR_ANY }, gateway = { INADDR_ANY };
int index = -1;
- extract_route(msg, bytes, &index, NULL, &addr);
+ extract_route(msg, bytes, &index, &dst, &gateway);
+
+ if (dst.s_addr != INADDR_ANY)
+ return;
for (list = rtnl_list; list; list = list->next) {
struct connman_rtnl *rtnl = list->data;
if (rtnl->delgateway)
- rtnl->delgateway(index, inet_ntoa(addr));
+ rtnl->delgateway(index, inet_ntoa(gateway));
}
}