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
f8bce04c
Commit
f8bce04c
authored
Apr 11, 2019
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for multiple source prefixes, discard TLV.
Source prefix can be specified only once.
parent
10321b9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
message.c
message.c
+12
-0
No files found.
message.c
View file @
f8bce04c
...
@@ -137,6 +137,8 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
...
@@ -137,6 +137,8 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
}
}
}
}
*
src_plen
=
0
;
while
(
i
<
alen
)
{
while
(
i
<
alen
)
{
type
=
a
[
i
];
type
=
a
[
i
];
if
(
type
==
SUBTLV_PAD1
)
{
if
(
type
==
SUBTLV_PAD1
)
{
...
@@ -159,6 +161,10 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
...
@@ -159,6 +161,10 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
int
rc
;
int
rc
;
if
(
len
<
1
)
if
(
len
<
1
)
goto
fail
;
goto
fail
;
if
(
a
[
i
+
2
]
==
0
)
/* source prefix cannot be default */
goto
fail
;
if
(
*
src_plen
!=
0
)
/* source prefix can only be specified once */
goto
fail
;
*
src_plen
=
a
[
i
+
2
];
*
src_plen
=
a
[
i
+
2
];
rc
=
network_prefix
(
ae
,
*
src_plen
,
0
,
a
+
i
+
3
,
NULL
,
rc
=
network_prefix
(
ae
,
*
src_plen
,
0
,
a
+
i
+
3
,
NULL
,
len
-
1
,
src_prefix
);
len
-
1
,
src_prefix
);
...
@@ -299,6 +305,8 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
...
@@ -299,6 +305,8 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
{
{
int
type
,
len
,
i
=
0
;
int
type
,
len
,
i
=
0
;
*
src_plen
=
0
;
while
(
i
<
alen
)
{
while
(
i
<
alen
)
{
type
=
a
[
0
];
type
=
a
[
0
];
if
(
type
==
SUBTLV_PAD1
)
{
if
(
type
==
SUBTLV_PAD1
)
{
...
@@ -319,6 +327,10 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
...
@@ -319,6 +327,10 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
int
rc
;
int
rc
;
if
(
len
<
1
)
if
(
len
<
1
)
goto
fail
;
goto
fail
;
if
(
a
[
i
+
2
]
==
0
)
goto
fail
;
if
(
*
src_plen
!=
0
)
goto
fail
;
*
src_plen
=
a
[
i
+
2
];
*
src_plen
=
a
[
i
+
2
];
rc
=
network_prefix
(
ae
,
*
src_plen
,
0
,
a
+
i
+
3
,
NULL
,
rc
=
network_prefix
(
ae
,
*
src_plen
,
0
,
a
+
i
+
3
,
NULL
,
len
-
1
,
src_prefix
);
len
-
1
,
src_prefix
);
...
...
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