X-Git-Url: http://olsr.org/git/?p=olsrd.git;a=blobdiff_plain;f=src%2Fcfgparser%2Fcfgfile_gen.c;h=7e1a240caa17a3b1eb46441ad01d4f1f59a83538;hp=b5bcac1a771e1ae2ee9251fd0ca3342496c98aab;hb=4e5e44d5767106e62630572dc2d0c49b2fac8bfb;hpb=85b4b61d1ec58dfde638a636d8e7426d9f26c018 diff --git a/src/cfgparser/cfgfile_gen.c b/src/cfgparser/cfgfile_gen.c index b5bcac1a..7e1a240c 100644 --- a/src/cfgparser/cfgfile_gen.c +++ b/src/cfgparser/cfgfile_gen.c @@ -53,6 +53,12 @@ #include #include +#ifdef __linux__ +#include +#else +#define RTPROT_BOOT 3 +#endif + int olsrd_write_cnf(struct olsrd_config *cnf, const char *fname) { FILE *fd; struct autobuf abuf; @@ -409,12 +415,18 @@ void olsrd_write_cnf_autobuf(struct autobuf *out, struct olsrd_config *cnf) { "# 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"