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
f36d1140
Commit
f36d1140
authored
Sep 26, 2014
by
Steffen Klassert
Committed by
Stephen Hemminger
Sep 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iproute2: Add support for IPv6 VTI tunnels to ip6tunnel
Signed-off-by:
Steffen Klassert
<
steffen.klassert@secunet.com
>
parent
08ce8ae9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
ip/ip6tunnel.c
ip/ip6tunnel.c
+12
-3
No files found.
ip/ip6tunnel.c
View file @
f36d1140
...
@@ -47,7 +47,7 @@ static void usage(void) __attribute__((noreturn));
...
@@ -47,7 +47,7 @@ static void usage(void) __attribute__((noreturn));
static
void
usage
(
void
)
static
void
usage
(
void
)
{
{
fprintf
(
stderr
,
"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]
\n
"
);
fprintf
(
stderr
,
"Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]
\n
"
);
fprintf
(
stderr
,
" [ mode { ip6ip6 | ipip6 | ip6gre | any } ]
\n
"
);
fprintf
(
stderr
,
" [ mode { ip6ip6 | ipip6 | ip6gre |
vti6 |
any } ]
\n
"
);
fprintf
(
stderr
,
" [ remote ADDR local ADDR ] [ dev PHYS_DEV ]
\n
"
);
fprintf
(
stderr
,
" [ remote ADDR local ADDR ] [ dev PHYS_DEV ]
\n
"
);
fprintf
(
stderr
,
" [ encaplimit ELIM ]
\n
"
);
fprintf
(
stderr
,
" [ encaplimit ELIM ]
\n
"
);
fprintf
(
stderr
,
" [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]
\n
"
);
fprintf
(
stderr
,
" [ hoplimit TTL ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]
\n
"
);
...
@@ -140,7 +140,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
...
@@ -140,7 +140,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
if
(
strcmp
(
*
argv
,
"ipv6/ipv6"
)
==
0
||
if
(
strcmp
(
*
argv
,
"ipv6/ipv6"
)
==
0
||
strcmp
(
*
argv
,
"ip6ip6"
)
==
0
)
strcmp
(
*
argv
,
"ip6ip6"
)
==
0
)
p
->
proto
=
IPPROTO_IPV6
;
p
->
proto
=
IPPROTO_IPV6
;
else
if
(
strcmp
(
*
argv
,
"ip/ipv6"
)
==
0
||
else
if
(
strcmp
(
*
argv
,
"vti6"
)
==
0
)
{
p
->
proto
=
IPPROTO_IPV6
;
p
->
i_flags
|=
VTI_ISVTI
;
}
else
if
(
strcmp
(
*
argv
,
"ip/ipv6"
)
==
0
||
strcmp
(
*
argv
,
"ipv4/ipv6"
)
==
0
||
strcmp
(
*
argv
,
"ipv4/ipv6"
)
==
0
||
strcmp
(
*
argv
,
"ipip6"
)
==
0
||
strcmp
(
*
argv
,
"ipip6"
)
==
0
||
strcmp
(
*
argv
,
"ip4ip6"
)
==
0
)
strcmp
(
*
argv
,
"ip4ip6"
)
==
0
)
...
@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)
...
@@ -459,11 +462,14 @@ static int do_add(int cmd, int argc, char **argv)
switch
(
p
.
proto
)
{
switch
(
p
.
proto
)
{
case
IPPROTO_IPIP
:
case
IPPROTO_IPIP
:
case
IPPROTO_IPV6
:
case
IPPROTO_IPV6
:
if
(
p
.
i_flags
!=
VTI_ISVTI
)
return
tnl_add_ioctl
(
cmd
,
"ip6_vti0"
,
p
.
name
,
&
p
);
else
return
tnl_add_ioctl
(
cmd
,
"ip6tnl0"
,
p
.
name
,
&
p
);
return
tnl_add_ioctl
(
cmd
,
"ip6tnl0"
,
p
.
name
,
&
p
);
case
IPPROTO_GRE
:
case
IPPROTO_GRE
:
return
tnl_add_ioctl
(
cmd
,
"ip6gre0"
,
p
.
name
,
&
p
);
return
tnl_add_ioctl
(
cmd
,
"ip6gre0"
,
p
.
name
,
&
p
);
default:
default:
fprintf
(
stderr
,
"cannot determine tunnel mode (ip6ip6, ipip6 or gre)
\n
"
);
fprintf
(
stderr
,
"cannot determine tunnel mode (ip6ip6, ipip6
, vti6
or gre)
\n
"
);
}
}
return
-
1
;
return
-
1
;
}
}
...
@@ -480,6 +486,9 @@ static int do_del(int argc, char **argv)
...
@@ -480,6 +486,9 @@ static int do_del(int argc, char **argv)
switch
(
p
.
proto
)
{
switch
(
p
.
proto
)
{
case
IPPROTO_IPIP
:
case
IPPROTO_IPIP
:
case
IPPROTO_IPV6
:
case
IPPROTO_IPV6
:
if
(
p
.
i_flags
!=
VTI_ISVTI
)
return
tnl_del_ioctl
(
"ip6_vti0"
,
p
.
name
,
&
p
);
else
return
tnl_del_ioctl
(
"ip6tnl0"
,
p
.
name
,
&
p
);
return
tnl_del_ioctl
(
"ip6tnl0"
,
p
.
name
,
&
p
);
case
IPPROTO_GRE
:
case
IPPROTO_GRE
:
return
tnl_del_ioctl
(
"ip6gre0"
,
p
.
name
,
&
p
);
return
tnl_del_ioctl
(
"ip6gre0"
,
p
.
name
,
&
p
);
...
...
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