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
33462073
Commit
33462073
authored
Mar 31, 2022
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename v4ov6 to v4viav6 in source code.
parent
a09b114c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
25 deletions
+25
-25
babeld.c
babeld.c
+2
-2
babeld.h
babeld.h
+1
-1
configuration.c
configuration.c
+1
-1
kernel.h
kernel.h
+1
-1
kernel_netlink.c
kernel_netlink.c
+2
-2
kernel_socket.c
kernel_socket.c
+1
-1
message.c
message.c
+16
-16
message.h
message.h
+1
-1
No files found.
babeld.c
View file @
33462073
...
@@ -63,7 +63,7 @@ int debug = 0;
...
@@ -63,7 +63,7 @@ int debug = 0;
int
link_detect
=
0
;
int
link_detect
=
0
;
int
all_wireless
=
0
;
int
all_wireless
=
0
;
int
has_ipv6_subtrees
=
0
;
int
has_ipv6_subtrees
=
0
;
int
has_v4
o
v6
=
0
;
int
has_v4
via
v6
=
0
;
int
default_wireless_hello_interval
=
-
1
;
int
default_wireless_hello_interval
=
-
1
;
int
default_wired_hello_interval
=
-
1
;
int
default_wired_hello_interval
=
-
1
;
int
resend_delay
=
-
1
;
int
resend_delay
=
-
1
;
...
@@ -152,7 +152,7 @@ main(int argc, char **argv)
...
@@ -152,7 +152,7 @@ main(int argc, char **argv)
protocol_port
=
6696
;
protocol_port
=
6696
;
change_smoothing_half_life
(
4
);
change_smoothing_half_life
(
4
);
has_ipv6_subtrees
=
kernel_has_ipv6_subtrees
();
has_ipv6_subtrees
=
kernel_has_ipv6_subtrees
();
has_v4
ov6
=
kernel_has_v4o
v6
();
has_v4
viav6
=
kernel_has_v4via
v6
();
while
(
1
)
{
while
(
1
)
{
opt
=
getopt
(
argc
,
argv
,
opt
=
getopt
(
argc
,
argv
,
...
...
babeld.h
View file @
33462073
...
@@ -92,7 +92,7 @@ extern const char *logfile, *pidfile, *state_file;
...
@@ -92,7 +92,7 @@ extern const char *logfile, *pidfile, *state_file;
extern
int
link_detect
;
extern
int
link_detect
;
extern
int
all_wireless
;
extern
int
all_wireless
;
extern
int
has_ipv6_subtrees
;
extern
int
has_ipv6_subtrees
;
extern
int
has_v4
o
v6
;
extern
int
has_v4
via
v6
;
extern
unsigned
char
myid
[
8
];
extern
unsigned
char
myid
[
8
];
extern
int
have_id
;
extern
int
have_id
;
...
...
configuration.c
View file @
33462073
...
@@ -1047,7 +1047,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
...
@@ -1047,7 +1047,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
else
if
(
strcmp
(
token
,
"ipv6-subtrees"
)
==
0
)
else
if
(
strcmp
(
token
,
"ipv6-subtrees"
)
==
0
)
has_ipv6_subtrees
=
b
;
has_ipv6_subtrees
=
b
;
else
if
(
strcmp
(
token
,
"v4-over-v6"
)
==
0
)
else
if
(
strcmp
(
token
,
"v4-over-v6"
)
==
0
)
has_v4
o
v6
=
b
;
has_v4
via
v6
=
b
;
else
if
(
strcmp
(
token
,
"reflect-kernel-metric"
)
==
0
)
else
if
(
strcmp
(
token
,
"reflect-kernel-metric"
)
==
0
)
reflect_kernel_metric
=
b
;
reflect_kernel_metric
=
b
;
else
else
...
...
kernel.h
View file @
33462073
...
@@ -95,7 +95,7 @@ int gettime(struct timeval *tv);
...
@@ -95,7 +95,7 @@ int gettime(struct timeval *tv);
int
read_random_bytes
(
void
*
buf
,
int
len
);
int
read_random_bytes
(
void
*
buf
,
int
len
);
int
kernel_older_than
(
const
char
*
sysname
,
int
version
,
int
sub_version
);
int
kernel_older_than
(
const
char
*
sysname
,
int
version
,
int
sub_version
);
int
kernel_has_ipv6_subtrees
(
void
);
int
kernel_has_ipv6_subtrees
(
void
);
int
kernel_has_v4
o
v6
(
void
);
int
kernel_has_v4
via
v6
(
void
);
int
add_rule
(
int
prio
,
const
unsigned
char
*
src_prefix
,
int
src_plen
,
int
add_rule
(
int
prio
,
const
unsigned
char
*
src_prefix
,
int
src_plen
,
int
table
);
int
table
);
int
flush_rule
(
int
prio
,
int
family
);
int
flush_rule
(
int
prio
,
int
family
);
...
...
kernel_netlink.c
View file @
33462073
...
@@ -944,9 +944,9 @@ kernel_has_ipv6_subtrees(void)
...
@@ -944,9 +944,9 @@ kernel_has_ipv6_subtrees(void)
}
}
int
int
kernel_has_v4
o
v6
(
void
)
kernel_has_v4
via
v6
(
void
)
{
{
/* v4-
over
-v6 was introduced in Linux by commit
/* v4-
via
-v6 was introduced in Linux by commit
d15662682db232da77136cd348f4c9df312ca6f9 first released as 5.2 */
d15662682db232da77136cd348f4c9df312ca6f9 first released as 5.2 */
return
(
kernel_older_than
(
"Linux"
,
5
,
2
)
==
0
);
return
(
kernel_older_than
(
"Linux"
,
5
,
2
)
==
0
);
}
}
...
...
kernel_socket.c
View file @
33462073
...
@@ -396,7 +396,7 @@ kernel_has_ipv6_subtrees(void)
...
@@ -396,7 +396,7 @@ kernel_has_ipv6_subtrees(void)
}
}
int
int
kernel_has_v4
o
v6
(
void
)
kernel_has_v4
via
v6
(
void
)
{
{
return
0
;
return
0
;
}
}
...
...
message.c
View file @
33462073
...
@@ -56,7 +56,7 @@ struct timeval seqno_time = {0, 0};
...
@@ -56,7 +56,7 @@ struct timeval seqno_time = {0, 0};
static
int
static
int
known_ae
(
int
ae
)
known_ae
(
int
ae
)
{
{
return
ae
<=
AE_IPV6_LOCAL
||
ae
==
AE_V4
O
V6
;
return
ae
<=
AE_IPV6_LOCAL
||
ae
==
AE_V4
VIA
V6
;
}
}
/* Parse a network prefix, encoded in the somewhat baroque compressed
/* Parse a network prefix, encoded in the somewhat baroque compressed
...
@@ -87,7 +87,7 @@ network_prefix(int ae, int plen, unsigned int omitted,
...
@@ -87,7 +87,7 @@ network_prefix(int ae, int plen, unsigned int omitted,
ret
=
0
;
ret
=
0
;
break
;
break
;
case
AE_IPV4
:
case
AE_IPV4
:
case
AE_V4
O
V6
:
case
AE_V4
VIA
V6
:
if
(
omitted
>
4
||
pb
>
4
||
(
pb
>
omitted
&&
len
<
pb
-
omitted
))
if
(
omitted
>
4
||
pb
>
4
||
(
pb
>
omitted
&&
len
<
pb
-
omitted
))
return
-
1
;
return
-
1
;
memcpy
(
prefix
,
v4prefix
,
12
);
memcpy
(
prefix
,
v4prefix
,
12
);
...
@@ -593,10 +593,10 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -593,10 +593,10 @@ parse_packet(const unsigned char *from, struct interface *ifp,
int
bodylen
;
int
bodylen
;
struct
neighbour
*
neigh
=
NULL
;
struct
neighbour
*
neigh
=
NULL
;
int
have_router_id
=
0
,
have_v4_prefix
=
0
,
have_v6_prefix
=
0
,
int
have_router_id
=
0
,
have_v4_prefix
=
0
,
have_v6_prefix
=
0
,
have_v4
o
v6_prefix
=
0
,
have_v4
via
v6_prefix
=
0
,
have_v4_nh
=
0
,
have_v6_nh
=
0
;
have_v4_nh
=
0
,
have_v6_nh
=
0
;
unsigned
char
router_id
[
8
],
v4_prefix
[
16
],
v6_prefix
[
16
],
unsigned
char
router_id
[
8
],
v4_prefix
[
16
],
v6_prefix
[
16
],
v4
o
v6_prefix
[
16
],
v4_nh
[
16
],
v6_nh
[
16
];
v4
via
v6_prefix
[
16
],
v4_nh
[
16
],
v6_nh
[
16
];
int
have_hello_rtt
=
0
;
int
have_hello_rtt
=
0
;
/* Content of the RTT sub-TLV on IHU messages. */
/* Content of the RTT sub-TLV on IHU messages. */
unsigned
int
hello_send_us
=
0
,
hello_rtt_receive_time
=
0
;
unsigned
int
hello_send_us
=
0
,
hello_rtt_receive_time
=
0
;
...
@@ -814,7 +814,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -814,7 +814,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
memcpy
(
v6_nh
,
nh
,
16
);
memcpy
(
v6_nh
,
nh
,
16
);
have_v6_nh
=
1
;
have_v6_nh
=
1
;
break
;
break
;
case
AE_V4
O
V6
:
case
AE_V4
VIA
V6
:
goto
done
;
goto
done
;
default:
default:
/* We should have guards against this before this point. */
/* We should have guards against this before this point. */
...
@@ -832,7 +832,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -832,7 +832,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
int
rc
,
parsed_len
,
is_ss
;
int
rc
,
parsed_len
,
is_ss
;
if
(
len
<
10
)
{
if
(
len
<
10
)
{
if
(
len
<
2
||
message
[
3
]
&
0x80
)
if
(
len
<
2
||
message
[
3
]
&
0x80
)
have_v4_prefix
=
have_v6_prefix
=
have_v4
o
v6_prefix
=
0
;
have_v4_prefix
=
have_v6_prefix
=
have_v4
via
v6_prefix
=
0
;
goto
fail
;
goto
fail
;
}
}
if
(
!
known_ae
(
message
[
2
]))
{
if
(
!
known_ae
(
message
[
2
]))
{
...
@@ -840,11 +840,11 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -840,11 +840,11 @@ parse_packet(const unsigned char *from, struct interface *ifp,
message
[
2
]);
message
[
2
]);
goto
done
;
goto
done
;
}
}
if
(
message
[
2
]
==
AE_V4
OV6
&&
!
has_v4o
v6
)
{
if
(
message
[
2
]
==
AE_V4
VIAV6
&&
!
has_v4via
v6
)
{
/* We can safely ignore the prefix update that might come
/* We can safely ignore the prefix update that might come
alongside with this TLV, since we ignore every v4-
over
-v6
alongside with this TLV, since we ignore every v4-
via
-v6
TLVs */
TLVs */
debugf
(
"Ignoring v4-
over
-v6 route (unsupported).
\n
"
);
debugf
(
"Ignoring v4-
via
-v6 route (unsupported).
\n
"
);
goto
done
;
goto
done
;
}
}
DO_NTOHS
(
interval
,
message
+
6
);
DO_NTOHS
(
interval
,
message
+
6
);
...
@@ -853,13 +853,13 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -853,13 +853,13 @@ parse_packet(const unsigned char *from, struct interface *ifp,
if
(
message
[
5
]
==
0
||
if
(
message
[
5
]
==
0
||
(
message
[
2
]
==
AE_IPV4
?
have_v4_prefix
:
(
message
[
2
]
==
AE_IPV4
?
have_v4_prefix
:
message
[
2
]
==
AE_IPV6
?
have_v6_prefix
:
message
[
2
]
==
AE_IPV6
?
have_v6_prefix
:
message
[
2
]
==
AE_V4
OV6
?
have_v4o
v6_prefix
:
message
[
2
]
==
AE_V4
VIAV6
?
have_v4via
v6_prefix
:
0
))
0
))
rc
=
network_prefix
(
message
[
2
],
message
[
4
],
message
[
5
],
rc
=
network_prefix
(
message
[
2
],
message
[
4
],
message
[
5
],
message
+
12
,
message
+
12
,
(
message
[
2
]
==
AE_IPV4
?
v4_prefix
:
(
message
[
2
]
==
AE_IPV4
?
v4_prefix
:
message
[
2
]
==
AE_IPV6
?
v6_prefix
:
message
[
2
]
==
AE_IPV6
?
v6_prefix
:
message
[
2
]
==
AE_V4
OV6
?
v4o
v6_prefix
:
message
[
2
]
==
AE_V4
VIAV6
?
v4via
v6_prefix
:
NULL
),
NULL
),
len
-
10
,
prefix
);
len
-
10
,
prefix
);
else
else
...
@@ -873,7 +873,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -873,7 +873,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
}
}
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
if
(
message
[
3
]
&
0x80
)
if
(
message
[
3
]
&
0x80
)
have_v4_prefix
=
have_v6_prefix
=
have_v4
o
v6_prefix
=
0
;
have_v4_prefix
=
have_v6_prefix
=
have_v4
via
v6_prefix
=
0
;
goto
fail
;
goto
fail
;
}
}
parsed_len
=
10
+
rc
;
parsed_len
=
10
+
rc
;
...
@@ -890,9 +890,9 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -890,9 +890,9 @@ parse_packet(const unsigned char *from, struct interface *ifp,
memcpy
(
v6_prefix
,
prefix
,
16
);
memcpy
(
v6_prefix
,
prefix
,
16
);
have_v6_prefix
=
1
;
have_v6_prefix
=
1
;
break
;
break
;
case
AE_V4
O
V6
:
case
AE_V4
VIA
V6
:
memcpy
(
v4
o
v6_prefix
,
prefix
,
16
);
memcpy
(
v4
via
v6_prefix
,
prefix
,
16
);
have_v4
o
v6_prefix
=
1
;
have_v4
via
v6_prefix
=
1
;
break
;
break
;
default:
default:
debugf
(
"Received default prefix update with invalid "
debugf
(
"Received default prefix update with invalid "
...
@@ -1461,7 +1461,7 @@ really_buffer_update(struct buffered *buf, struct interface *ifp,
...
@@ -1461,7 +1461,7 @@ really_buffer_update(struct buffered *buf, struct interface *ifp,
if
(
v4
)
{
if
(
v4
)
{
if
(
!
ifp
->
ipv4
)
{
if
(
!
ifp
->
ipv4
)
{
ae
=
AE_V4
O
V6
;
ae
=
AE_V4
VIA
V6
;
}
else
{
}
else
{
ae
=
AE_IPV4
;
ae
=
AE_IPV4
;
if
(
!
buf
->
have_nh
||
if
(
!
buf
->
have_nh
||
...
...
message.h
View file @
33462073
...
@@ -52,7 +52,7 @@ THE SOFTWARE.
...
@@ -52,7 +52,7 @@ THE SOFTWARE.
#define AE_IPV4 1
#define AE_IPV4 1
#define AE_IPV6 2
#define AE_IPV6 2
#define AE_IPV6_LOCAL 3
#define AE_IPV6_LOCAL 3
#define AE_V4
O
V6 4
#define AE_V4
VIA
V6 4
extern
unsigned
short
myseqno
;
extern
unsigned
short
myseqno
;
extern
struct
timeval
seqno_time
;
extern
struct
timeval
seqno_time
;
...
...
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