Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
906ac543
Commit
906ac543
authored
Sep 24, 2015
by
John W. Linville
Committed by
Stephen Hemminger
Nov 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
geneve: add support for IPv6 link partners
Signed-off-by:
John W. Linville
<
linville@tuxdriver.com
>
parent
e149d4e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
ip/iplink_geneve.c
ip/iplink_geneve.c
+13
-7
No files found.
ip/iplink_geneve.c
View file @
906ac543
...
...
@@ -55,7 +55,7 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
fprintf
(
stderr
,
"Invalid address
\"
%s
\"\n
"
,
*
argv
);
return
-
1
;
}
if
(
IN_MULTICAST
(
ntohl
(
daddr
)))
if
(
IN
6_IS_ADDR_MULTICAST
(
&
daddr6
)
||
IN
_MULTICAST
(
ntohl
(
daddr
)))
invarg
(
"invalid remote address"
,
*
argv
);
}
else
if
(
!
matches
(
*
argv
,
"ttl"
)
||
!
matches
(
*
argv
,
"hoplimit"
))
{
...
...
@@ -96,18 +96,16 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
return
-
1
;
}
if
(
!
daddr
)
{
fprintf
(
stderr
,
"geneve: remove link partner not specified
\n
"
);
return
-
1
;
}
if
(
memcmp
(
&
daddr6
,
&
in6addr_any
,
sizeof
(
daddr6
))
!=
0
)
{
fprintf
(
stderr
,
"geneve: remove link over IPv6 not supported
\n
"
);
if
(
!
daddr
&&
memcmp
(
&
daddr6
,
&
in6addr_any
,
sizeof
(
daddr6
))
==
0
)
{
fprintf
(
stderr
,
"geneve: remote link partner not specified
\n
"
);
return
-
1
;
}
addattr32
(
n
,
1024
,
IFLA_GENEVE_ID
,
vni
);
if
(
daddr
)
addattr_l
(
n
,
1024
,
IFLA_GENEVE_REMOTE
,
&
daddr
,
4
);
if
(
memcmp
(
&
daddr6
,
&
in6addr_any
,
sizeof
(
daddr6
))
!=
0
)
addattr_l
(
n
,
1024
,
IFLA_GENEVE_REMOTE6
,
&
daddr6
,
sizeof
(
struct
in6_addr
));
addattr8
(
n
,
1024
,
IFLA_GENEVE_TTL
,
ttl
);
addattr8
(
n
,
1024
,
IFLA_GENEVE_TOS
,
tos
);
...
...
@@ -135,6 +133,14 @@ static void geneve_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if
(
addr
)
fprintf
(
f
,
"remote %s "
,
format_host
(
AF_INET
,
4
,
&
addr
,
s1
,
sizeof
(
s1
)));
}
else
if
(
tb
[
IFLA_GENEVE_REMOTE6
])
{
struct
in6_addr
addr
;
memcpy
(
&
addr
,
RTA_DATA
(
tb
[
IFLA_GENEVE_REMOTE6
]),
sizeof
(
struct
in6_addr
));
if
(
memcmp
(
&
addr
,
&
in6addr_any
,
sizeof
(
addr
))
!=
0
)
{
if
(
IN6_IS_ADDR_MULTICAST
(
&
addr
))
fprintf
(
f
,
"remote %s "
,
format_host
(
AF_INET6
,
sizeof
(
struct
in6_addr
),
&
addr
,
s1
,
sizeof
(
s1
)));
}
}
if
(
tb
[
IFLA_GENEVE_TTL
])
{
...
...
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