summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
85b4b61)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef __linux__
+#include <linux/rtnetlink.h>
+#else
+#define RTPROT_BOOT 3
+#endif
+
int olsrd_write_cnf(struct olsrd_config *cnf, const char *fname) {
FILE *fd;
struct autobuf abuf;
int olsrd_write_cnf(struct olsrd_config *cnf, const char *fname) {
FILE *fd;
struct autobuf abuf;
"# 3 BOOT (should in fact not be used by routing daemons)\n"
"# 4 STATIC\n"
"# 8 .. 15 various routing daemons (gated, zebra, bird, & co)\n"
"# 3 BOOT (should in fact not be used by routing daemons)\n"
"# 4 STATIC\n"
"# 8 .. 15 various routing daemons (gated, zebra, bird, & co)\n"
- "# (default is %u which gets replaced by an OS-specific default value\n"
- "# under linux 3 (BOOT) (for backward compatibility)\n"
- "\n", DEF_RTPROTO);
- abuf_appendf(out, "%sRtProto %u\n",
- cnf->rt_proto == DEF_RTPROTO ? "# " : "",
- cnf->rt_proto);
+ "# (default is %u which gets replaced by an OS-specific default value;\n"
+ "# %u (BOOT) under linux (for backward compatibility)\n"
+ "\n", DEF_RTPROTO, RTPROT_BOOT);
+ {
+ int expected = DEF_RTPROTO;
+#ifdef __linux__
+ expected = RTPROT_BOOT;
+#endif
+ abuf_appendf(out, "%sRtProto %u\n",
+ cnf->rt_proto == expected ? "# " : "",
+ cnf->rt_proto == expected ? DEF_RTPROTO : cnf->rt_proto);
+ }
abuf_appendf(out,
"\n"
"# Specifies the routing Table olsr uses\n"
abuf_appendf(out,
"\n"
"# Specifies the routing Table olsr uses\n"