Skip to content

Commit

Permalink
Add a per-interface flag rfc6126-compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliusz Chroboczek authored and jech committed Oct 23, 2018
1 parent 2081d2d commit 52c28e4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions babeld.man
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ for tunnel interfaces, and
.B false
otherwise.
.TP
.BR rfc6126\-compatible " {" true | false }
Only send TLVs that are defined by RFC 6126, the older version of Babel.
The default is
.BR false .
.TP
.BI rtt\-decay " decay"
This specifies the decay factor for the exponential moving average of
RTT samples, in units of 1/256. Must be between 1 and 256, inclusive.
Expand Down
7 changes: 7 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
if(c < -1)
goto error;
if_conf->enable_timestamps = v;
} else if(strcmp(token, "rfc6126-compatible") == 0) {
int v;
c = getbool(c, &v, gnc, closure);
if(c < -1)
goto error;
if_conf->rfc6126 = v;
} else if(strcmp(token, "rtt-decay") == 0) {
int decay;
c = getint(c, &decay, gnc, closure);
Expand Down Expand Up @@ -716,6 +722,7 @@ merge_ifconf(struct interface_conf *dest,
MERGE(unicast);
MERGE(channel);
MERGE(enable_timestamps);
MERGE(rfc6126);
MERGE(rtt_decay);
MERGE(rtt_min);
MERGE(rtt_max);
Expand Down
5 changes: 5 additions & 0 deletions interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ interface_up(struct interface *ifp, int up)
"but timestamps are disabled on interface %s.\n",
ifp->name);

if(IF_CONF(ifp, rfc6126) == CONFIG_YES)
ifp->flags |= IF_RFC6126;
else
ifp->flags &= ~IF_RFC6126;

rc = check_link_local_addresses(ifp);
if(rc < 0) {
goto fail;
Expand Down
3 changes: 3 additions & 0 deletions interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct interface_conf {
char unicast;
int channel;
int enable_timestamps;
int rfc6126;
unsigned int rtt_decay;
unsigned int rtt_min;
unsigned int rtt_max;
Expand All @@ -71,6 +72,8 @@ struct interface_conf {
#define IF_FARAWAY (1 << 4)
/* Send most TLVs over unicast. */
#define IF_UNICAST (1 << 5)
/* Remain compatible with RFC 6126. */
#define IF_RFC6126 (1 << 6)

/* Only INTERFERING can appear on the wire. */
#define IF_CHANNEL_UNKNOWN 0
Expand Down

0 comments on commit 52c28e4

Please sign in to comment.