chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
conf-parser: distinguish between multiple sections with the same name
[elogind.git]
/
src
/
network
/
networkd-route.c
diff --git
a/src/network/networkd-route.c
b/src/network/networkd-route.c
index 918a1d0191790bf5e6960116d4dc5a16ffdda20c..3eca3cc547310583bbf9d8ffcd69352ca648d4d9 100644
(file)
--- a/
src/network/networkd-route.c
+++ b/
src/network/networkd-route.c
@@
-54,12
+54,14
@@
void route_free(Route *route) {
free(route);
}
free(route);
}
-int route_configure(Manager *manager, Route *route, Link *link) {
+int route_configure(Route *route, Link *link,
+ sd_rtnl_message_handler_t callback) {
_cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
int r;
_cleanup_sd_rtnl_message_unref_ sd_rtnl_message *req = NULL;
int r;
- assert(manager);
assert(link);
assert(link);
+ assert(link->manager);
+ assert(link->manager->rtnl);
assert(link->ifindex > 0);
assert(route->family == AF_INET || route->family == AF_INET6);
assert(link->ifindex > 0);
assert(route->family == AF_INET || route->family == AF_INET6);
@@
-83,13
+85,13
@@
int route_configure(Manager *manager, Route *route, Link *link) {
return r;
}
return r;
}
- r = sd_rtnl_
send_with_reply_and_block(manager->rtnl, req
, 0, NULL);
+ r = sd_rtnl_
call_async(link->manager->rtnl, req, callback, link
, 0, NULL);
if (r < 0) {
if (r < 0) {
- log_error("Could not
configure rout
e: %s", strerror(-r));
+ log_error("Could not
send rtnetlink messag
e: %s", strerror(-r));
return r;
}
return r;
}
- l
og_info("Configured route")
;
+ l
ink->rtnl_messages ++
;
return 0;
}
return 0;
}
@@
-98,6
+100,7
@@
int config_parse_gateway(const char *unit,
const char *filename,
unsigned line,
const char *section,
const char *filename,
unsigned line,
const char *section,
+ unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
const char *lvalue,
int ltype,
const char *rvalue,