summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/routing.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-03-27 11:08:01 +0200
committerSander Vrijders <[email protected]>2017-03-28 10:24:54 +0200
commit8f88486a5a549e1b6644670e5eb011a9309f176b (patch)
tree42146dc93df8ff4ccb7b4d0e8d1b76f49d6b90a5 /src/ipcpd/normal/routing.c
parent53384bdca4f5e80f626e68e71ad2b82100b22735 (diff)
downloadouroboros-8f88486a5a549e1b6644670e5eb011a9309f176b.tar.gz
ouroboros-8f88486a5a549e1b6644670e5eb011a9309f176b.zip
ipcpd: normal: Remove graph_add_edge operation
This removes the graph_add_edge operation of the graph component. The routing component now only listens to RO_MODIFY events, and updates the graph accordingly.
Diffstat (limited to 'src/ipcpd/normal/routing.c')
-rw-r--r--src/ipcpd/normal/routing.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/ipcpd/normal/routing.c b/src/ipcpd/normal/routing.c
index 998b294a..bf736311 100644
--- a/src/ipcpd/normal/routing.c
+++ b/src/ipcpd/normal/routing.c
@@ -235,23 +235,14 @@ static int read_fso(char * path,
return -1;
}
- if (flag & RO_CREATE) {
- if (graph_add_edge(routing.graph,
- fso->s_addr, fso->d_addr, qs)) {
- log_err("Failed to add edge to graph.");
- fso__free_unpacked(fso, NULL);
- return -1;
- }
- } else if (flag & RO_MODIFY) {
+ if (flag & RO_MODIFY) {
if (graph_update_edge(routing.graph,
fso->s_addr, fso->d_addr, qs)) {
- log_err("Failed to update edge of graph.");
fso__free_unpacked(fso, NULL);
return -1;
}
} else if (flag & RO_DELETE) {
if (graph_del_edge(routing.graph, fso->s_addr, fso->d_addr)) {
- log_err("Failed to del edge of graph.");
fso__free_unpacked(fso, NULL);
return -1;
}
@@ -272,8 +263,7 @@ static void * rib_listener(void * o)
(void) o;
- if (ro_set_add(routing.set, ROUTING_PATH,
- RO_MODIFY | RO_CREATE | RO_DELETE)) {
+ if (ro_set_add(routing.set, ROUTING_PATH, RO_MODIFY | RO_DELETE)) {
log_err("Failed to add to RO set");
return (void * ) -1;
}
@@ -292,6 +282,7 @@ static void * rib_listener(void * o)
}
while (rib_event_wait(routing.set, routing.queue, NULL) == 0) {
+ path[0] = '\0';
flag = rqueue_next(routing.queue, path);
if (flag < 0)
continue;