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
0092a3c5
Commit
0092a3c5
authored
Nov 19, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for V4-mapped addresses in kernel.c.
parent
7e30942b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
kernel_netlink.c
kernel_netlink.c
+19
-0
kernel_socket.c
kernel_socket.c
+19
-0
No files found.
kernel_netlink.c
View file @
0092a3c5
...
@@ -582,6 +582,25 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
...
@@ -582,6 +582,25 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
}
}
}
}
/* Check that the protocol family is consistent. */
if
(
plen
>=
96
&&
v4mapped
(
dest
))
{
if
(
!
v4mapped
(
gate
))
{
errno
=
EINVAL
;
return
-
1
;
}
}
else
{
if
(
v4mapped
(
gate
))
{
errno
=
EINVAL
;
return
-
1
;
}
}
if
(
v4mapped
(
gate
))
{
/* Not implemented yet. */
errno
=
EINVAL
;
return
-
1
;
}
if
(
operation
==
ROUTE_MODIFY
)
{
if
(
operation
==
ROUTE_MODIFY
)
{
if
(
newmetric
==
metric
&&
memcmp
(
newgate
,
gate
,
16
)
==
0
&&
if
(
newmetric
==
metric
&&
memcmp
(
newgate
,
gate
,
16
)
==
0
&&
newifindex
==
ifindex
)
newifindex
==
ifindex
)
...
...
kernel_socket.c
View file @
0092a3c5
...
@@ -261,6 +261,25 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
...
@@ -261,6 +261,25 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
char
local
[
1
][
1
][
16
]
=
IN6ADDR_LOOPBACK_INIT
;
char
local
[
1
][
1
][
16
]
=
IN6ADDR_LOOPBACK_INIT
;
/* Check that the protocol family is consistent. */
if
(
plen
>=
96
&&
v4mapped
(
dest
))
{
if
(
!
v4mapped
(
gate
))
{
errno
=
EINVAL
;
return
-
1
;
}
}
else
{
if
(
v4mapped
(
gate
))
{
errno
=
EINVAL
;
return
-
1
;
}
}
if
(
v4mapped
(
gate
))
{
/* Not implemented yet. */
errno
=
EINVAL
;
return
-
1
;
}
if
(
operation
==
ROUTE_MODIFY
&&
newmetric
==
metric
&&
if
(
operation
==
ROUTE_MODIFY
&&
newmetric
==
metric
&&
memcmp
(
newgate
,
gate
,
16
)
==
0
&&
newifindex
==
ifindex
)
memcmp
(
newgate
,
gate
,
16
)
==
0
&&
newifindex
==
ifindex
)
return
0
;
return
0
;
...
...
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