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
360f9e19
Commit
360f9e19
authored
Mar 08, 2019
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rfc6126_compatible back into struct interface.
Avoid the duplication by passing around an interface pointer.
parent
68b6c5ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
14 deletions
+22
-14
interface.c
interface.c
+4
-1
interface.h
interface.h
+2
-1
message.c
message.c
+16
-12
No files found.
interface.c
View file @
360f9e19
...
...
@@ -443,7 +443,10 @@ interface_up(struct interface *ifp, int up)
"but timestamps are disabled on interface %s.
\n
"
,
ifp
->
name
);
ifp
->
buf
.
rfc6126_compatible
=
(
IF_CONF
(
ifp
,
rfc6126
)
==
CONFIG_YES
);
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
)
{
...
...
interface.h
View file @
360f9e19
...
...
@@ -72,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
...
...
@@ -86,7 +88,6 @@ struct buffered {
int
flush_interval
;
struct
timeval
timeout
;
char
enable_timestamps
;
char
rfc6126_compatible
;
char
have_id
;
char
have_nh
;
char
have_prefix
;
...
...
message.c
View file @
360f9e19
...
...
@@ -1069,7 +1069,7 @@ really_buffer_update(struct buffered *buf, struct interface *ifp,
if
(
!
if_up
(
ifp
))
return
;
if
(
is_ss
&&
buf
->
rfc6126_compatible
)
if
(
is_ss
&&
(
ifp
->
flags
&
IF_RFC6126
)
!=
0
)
return
;
add_metric
=
output_filter
(
id
,
prefix
,
plen
,
src_prefix
,
...
...
@@ -1690,14 +1690,14 @@ send_marginal_ihu(struct interface *ifp)
/* Standard wildcard request with prefix == NULL && src_prefix == zeroes,
Specific wildcard request with prefix == zeroes && src_prefix == NULL. */
static
void
send_request
(
struct
buffered
*
buf
,
send_request
(
struct
buffered
*
buf
,
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
)
{
int
v4
,
pb
,
spb
,
len
;
int
is_ss
=
!
is_default
(
src_prefix
,
src_plen
);
if
(
is_ss
&&
buf
->
rfc6126_compatible
)
if
(
is_ss
&&
(
ifp
->
flags
&
IF_RFC6126
)
!=
0
)
return
;
if
(
!
prefix
)
{
...
...
@@ -1763,12 +1763,12 @@ send_multicast_request(struct interface *ifp,
struct
neighbour
*
neigh
;
FOR_ALL_NEIGHBOURS
(
neigh
)
{
if
(
neigh
->
ifp
==
ifp
)
{
send_request
(
&
neigh
->
buf
,
prefix
,
plen
,
send_request
(
&
neigh
->
buf
,
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
);
}
}
}
else
{
send_request
(
&
ifp
->
buf
,
prefix
,
plen
,
src_prefix
,
src_plen
);
send_request
(
&
ifp
->
buf
,
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
);
}
}
...
...
@@ -1782,11 +1782,11 @@ send_unicast_request(struct neighbour *neigh,
flushupdates
(
neigh
->
ifp
);
send_request
(
&
neigh
->
buf
,
prefix
,
plen
,
src_prefix
,
src_plen
);
send_request
(
&
neigh
->
buf
,
neigh
->
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
);
}
static
void
send_multihop_request
(
struct
buffered
*
buf
,
send_multihop_request
(
struct
buffered
*
buf
,
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
...
...
@@ -1795,7 +1795,7 @@ send_multihop_request(struct buffered *buf,
int
v4
,
pb
,
spb
,
len
;
int
is_ss
=
!
is_default
(
src_prefix
,
src_plen
);
if
(
is_ss
&&
buf
->
rfc6126_compatible
)
if
(
is_ss
&&
(
ifp
->
flags
&
IF_RFC6126
)
!=
0
)
return
;
debugf
(
"Sending request (%d) for %s.
\n
"
,
...
...
@@ -1859,13 +1859,15 @@ send_multicast_multihop_request(struct interface *ifp,
struct
neighbour
*
neigh
;
FOR_ALL_NEIGHBOURS
(
neigh
)
{
if
(
neigh
->
ifp
==
ifp
)
{
send_multihop_request
(
&
neigh
->
buf
,
prefix
,
plen
,
send_multihop_request
(
&
neigh
->
buf
,
neigh
->
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
id
,
hop_count
);
}
}
}
else
{
send_multihop_request
(
&
ifp
->
buf
,
prefix
,
plen
,
send_multihop_request
(
&
ifp
->
buf
,
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
id
,
hop_count
);
}
...
...
@@ -1880,7 +1882,8 @@ send_unicast_multihop_request(struct neighbour *neigh,
unsigned
short
hop_count
)
{
flushupdates
(
neigh
->
ifp
);
send_multihop_request
(
&
neigh
->
buf
,
prefix
,
plen
,
src_prefix
,
src_plen
,
send_multihop_request
(
&
neigh
->
buf
,
neigh
->
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
id
,
hop_count
);
}
...
...
@@ -1905,7 +1908,8 @@ send_request_resend(const unsigned char *prefix, unsigned char plen,
struct
interface
*
ifp
;
FOR_ALL_INTERFACES
(
ifp
)
{
if
(
!
if_up
(
ifp
))
continue
;
send_multihop_request
(
&
ifp
->
buf
,
prefix
,
plen
,
src_prefix
,
src_plen
,
send_multihop_request
(
&
ifp
->
buf
,
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
id
,
127
);
}
}
...
...
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