projects
/
project
/
relayd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b4ba9ff
)
Flush the route cache after changing routes
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 11 Aug 2010 15:44:21 +0000
(17:44 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 11 Aug 2010 15:47:54 +0000
(17:47 +0200)
route.c
patch
|
blob
|
history
diff --git
a/route.c
b/route.c
index
f436691
..
5425d51
100644
(file)
--- a/
route.c
+++ b/
route.c
@@
-20,12
+20,25
@@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <fcntl.h>
#include "relayd.h"
static struct uloop_fd rtnl_sock;
static unsigned int rtnl_seq, rtnl_dump_seq;
#include "relayd.h"
static struct uloop_fd rtnl_sock;
static unsigned int rtnl_seq, rtnl_dump_seq;
+static void rtnl_flush(void)
+{
+ int fd;
+
+ fd = open("/proc/sys/net/ipv4/route/flush", O_WRONLY);
+ if (fd < 0)
+ return;
+
+ write(fd, "-1", 2);
+ close(fd);
+}
+
static void rtnl_route_set(struct relayd_host *host, bool add)
{
static struct {
static void rtnl_route_set(struct relayd_host *host, bool add)
{
static struct {
@@
-70,6
+83,7
@@
static void rtnl_route_set(struct relayd_host *host, bool add)
}
send(rtnl_sock.fd, &req, sizeof(req), 0);
}
send(rtnl_sock.fd, &req, sizeof(req), 0);
+ rtnl_flush();
}
void relayd_add_route(struct relayd_host *host)
}
void relayd_add_route(struct relayd_host *host)