projects
/
framework
/
connectivity
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eedda82
)
Fix issue with gateway notification for non default routes
author
Marcel Holtmann
<marcel@holtmann.org>
Sun, 9 Aug 2009 04:11:58 +0000
(21:11 -0700)
committer
Marcel Holtmann
<marcel@holtmann.org>
Sun, 9 Aug 2009 04:11:58 +0000
(21:11 -0700)
src/rtnl.c
patch
|
blob
|
history
diff --git
a/src/rtnl.c
b/src/rtnl.c
index
c6fd27e
..
785a1de
100644
(file)
--- 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;
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;
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)
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;
}
}
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;
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)
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
));
}
}
}
}