Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
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
net-tools
Commits
b94840d2
Commit
b94840d2
authored
May 22, 2000
by
Phil Blundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make `route -A inet6 add default ...' work.
parent
c32a1ce0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
lib/inet6_sr.c
lib/inet6_sr.c
+16
-10
No files found.
lib/inet6_sr.c
View file @
b94840d2
...
@@ -64,22 +64,28 @@ static int INET6_setroute(int action, int options, char **args)
...
@@ -64,22 +64,28 @@ static int INET6_setroute(int action, int options, char **args)
return
(
usage
());
return
(
usage
());
strcpy
(
target
,
*
args
++
);
strcpy
(
target
,
*
args
++
);
if
((
cp
=
strchr
(
target
,
'/'
)))
{
if
(
!
strcmp
(
target
,
"default"
))
{
prefix_len
=
atol
(
cp
+
1
);
prefix_len
=
0
;
if
((
prefix_len
<
0
)
||
(
prefix_len
>
128
))
memset
(
&
sa6
,
0
,
sizeof
(
sa6
));
usage
();
*
cp
=
0
;
}
else
{
}
else
{
prefix_len
=
128
;
if
((
cp
=
strchr
(
target
,
'/'
)))
{
prefix_len
=
atol
(
cp
+
1
);
if
((
prefix_len
<
0
)
||
(
prefix_len
>
128
))
usage
();
*
cp
=
0
;
}
else
{
prefix_len
=
128
;
}
if
(
inet6_aftype
.
input
(
1
,
target
,
(
struct
sockaddr
*
)
&
sa6
)
<
0
&&
inet6_aftype
.
input
(
0
,
target
,
(
struct
sockaddr
*
)
&
sa6
)
<
0
)
{
inet6_aftype
.
herror
(
target
);
return
(
1
);
}
}
}
/* Clean out the RTREQ structure. */
/* Clean out the RTREQ structure. */
memset
((
char
*
)
&
rt
,
0
,
sizeof
(
struct
in6_rtmsg
));
memset
((
char
*
)
&
rt
,
0
,
sizeof
(
struct
in6_rtmsg
));
if
(
inet6_aftype
.
input
(
1
,
target
,
(
struct
sockaddr
*
)
&
sa6
)
<
0
)
{
inet6_aftype
.
herror
(
target
);
return
(
1
);
}
memcpy
(
&
rt
.
rtmsg_dst
,
sa6
.
sin6_addr
.
s6_addr
,
sizeof
(
struct
in6_addr
));
memcpy
(
&
rt
.
rtmsg_dst
,
sa6
.
sin6_addr
.
s6_addr
,
sizeof
(
struct
in6_addr
));
/* Fill in the other fields. */
/* Fill in the other fields. */
...
...
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