Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
98f6ed92
Commit
98f6ed92
authored
Jan 20, 2018
by
Juliusz Chroboczek
Committed by
Juliusz Chroboczek
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move enable_timestamps into the buffered structure.
parent
46134e60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
interface.c
interface.c
+5
-5
interface.h
interface.h
+1
-2
message.c
message.c
+6
-6
No files found.
interface.c
View file @
98f6ed92
...
...
@@ -425,14 +425,14 @@ interface_up(struct interface *ifp, int up)
ifp
->
max_rtt_penalty
=
96
;
if
(
IF_CONF
(
ifp
,
enable_timestamps
)
==
CONFIG_YES
)
ifp
->
flags
|=
IF_TIMESTAMPS
;
ifp
->
buf
.
enable_timestamps
=
1
;
else
if
(
IF_CONF
(
ifp
,
enable_timestamps
)
==
CONFIG_NO
)
ifp
->
flags
&=
~
IF_TIMESTAMPS
;
ifp
->
buf
.
enable_timestamps
=
0
;
else
if
(
type
==
IF_TYPE_TUNNEL
)
ifp
->
flags
|=
IF_TIMESTAMPS
;
ifp
->
buf
.
enable_timestamps
=
1
;
else
ifp
->
flags
&=
~
IF_TIMESTAMPS
;
if
(
ifp
->
max_rtt_penalty
>
0
&&
!
(
ifp
->
flags
&
IF_TIMESTAMPS
)
)
ifp
->
buf
.
enable_timestamps
=
0
;
if
(
ifp
->
max_rtt_penalty
>
0
&&
!
ifp
->
buf
.
enable_timestamps
)
fprintf
(
stderr
,
"Warning: max_rtt_penalty is set "
"but timestamps are disabled on interface %s.
\n
"
,
...
...
interface.h
View file @
98f6ed92
...
...
@@ -69,8 +69,6 @@ struct interface_conf {
#define IF_LQ (1 << 3)
/* Nodes on the far end don't interfere with nodes on the near end. */
#define IF_FARAWAY (1 << 4)
/* Send timestamps in Hello and IHU. */
#define IF_TIMESTAMPS (1 << 5)
/* Remain compatible with RFC 6126. */
#define IF_RFC6126 (1 << 6)
...
...
@@ -85,6 +83,7 @@ struct buffered {
int
len
;
int
size
;
struct
timeval
timeout
;
char
enable_timestamps
;
char
have_id
;
char
have_nh
;
char
have_prefix
;
...
...
message.c
View file @
98f6ed92
...
...
@@ -342,7 +342,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
/* Content of the RTT sub-TLV on IHU messages. */
unsigned
int
hello_send_us
=
0
,
hello_rtt_receive_time
=
0
;
if
(
ifp
->
flags
&
IF_TIMESTAMPS
)
{
if
(
ifp
->
buf
.
enable_timestamps
)
{
/* We want to track exactly when we received this packet. */
gettime
(
&
now
);
}
...
...
@@ -894,7 +894,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
static
int
fill_rtt_message
(
struct
interface
*
ifp
)
{
if
(
(
ifp
->
flags
&
IF_TIMESTAMPS
)
&&
(
ifp
->
buf
.
hello
>=
0
))
{
if
(
ifp
->
buf
.
enable_timestamps
&&
(
ifp
->
buf
.
hello
>=
0
))
{
if
(
ifp
->
buf
.
buf
[
ifp
->
buf
.
hello
+
8
]
==
SUBTLV_PADN
&&
ifp
->
buf
.
buf
[
ifp
->
buf
.
hello
+
9
]
==
4
)
{
unsigned
int
time
;
...
...
@@ -1123,19 +1123,19 @@ send_hello_noupdate(struct interface *ifp, unsigned interval)
debugf
(
"Sending hello %d (%d) to %s.
\n
"
,
ifp
->
hello_seqno
,
interval
,
ifp
->
name
);
start_message
(
ifp
,
MESSAGE_HELLO
,
(
ifp
->
flags
&
IF_TIMESTAMPS
)
?
12
:
6
);
start_message
(
ifp
,
MESSAGE_HELLO
,
ifp
->
buf
.
enable_timestamps
?
12
:
6
);
ifp
->
buf
.
hello
=
ifp
->
buf
.
len
-
2
;
accumulate_short
(
ifp
,
0
);
accumulate_short
(
ifp
,
ifp
->
hello_seqno
);
accumulate_short
(
ifp
,
interval
>
0xFFFF
?
0xFFFF
:
interval
);
if
(
ifp
->
flags
&
IF_TIMESTAMPS
)
{
if
(
ifp
->
buf
.
enable_timestamps
)
{
/* Sub-TLV containing the local time of emission. We use a
Pad4 sub-TLV, which we'll fill just before sending. */
accumulate_byte
(
ifp
,
SUBTLV_PADN
);
accumulate_byte
(
ifp
,
4
);
accumulate_int
(
ifp
,
0
);
}
end_message
(
ifp
,
MESSAGE_HELLO
,
(
ifp
->
flags
&
IF_TIMESTAMPS
)
?
12
:
6
);
end_message
(
ifp
,
MESSAGE_HELLO
,
ifp
->
buf
.
enable_timestamps
?
12
:
6
);
}
void
...
...
@@ -1734,7 +1734,7 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
ll
=
linklocal
(
neigh
->
address
);
if
(
(
ifp
->
flags
&
IF_TIMESTAMPS
)
&&
neigh
->
hello_send_us
&&
if
(
ifp
->
buf
.
enable_timestamps
&&
neigh
->
hello_send_us
&&
/* Checks whether the RTT data is not too old to be sent. */
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_rtt_receive_time
)
<
1000000
)
{
send_rtt_data
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment