[radvd-devel-l] [PATCH] continue even if forwarding is off
Ludwig Nussel
ludwig.nussel at suse.de
Wed May 4 10:03:28 EDT 2011
radvd is useful for advertising ULA's without having a router too
---
radvd.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/radvd.c b/radvd.c
index 5071b4a..3b7a56b 100644
--- a/radvd.c
+++ b/radvd.c
@@ -252,12 +252,7 @@ main(int argc, char *argv[])
/* if we know how to do it, check whether forwarding is enabled */
if (check_ip6_forwarding()) {
- if (get_debuglevel() == 0) {
- flog(LOG_ERR, "IPv6 forwarding seems to be disabled, exiting");
- exit(1);
- }
- else
- flog(LOG_WARNING, "IPv6 forwarding seems to be disabled, but continuing anyway.");
+ flog(LOG_WARNING, "IPv6 forwarding seems to be disabled, but continuing anyway.");
}
/* parse config file */
@@ -786,6 +781,7 @@ check_ip6_forwarding(void)
int value;
size_t size = sizeof(value);
FILE *fp = NULL;
+ static int warned = 0;
#ifdef __linux__
fp = fopen(PROC_SYS_IP6_FORWARDING, "r");
@@ -810,7 +806,8 @@ check_ip6_forwarding(void)
return(0); /* this is of advisory value only */
}
- if (value != 1) {
+ if (value != 1 && !warned) {
+ warned = 1;
flog(LOG_DEBUG, "IPv6 forwarding setting is: %u, should be 1", value);
return(-1);
}
--
1.7.3.4
More information about the radvd-devel-l
mailing list