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
68eede25
Commit
68eede25
authored
Dec 21, 2015
by
Hangbin Liu
Committed by
Stephen Hemminger
Dec 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
route: allow routes to be configured with expire values
Signed-off-by:
Hangbin Liu
<
liuhangbin@gmail.com
>
parent
5d3ec438
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
ip/iproute.c
ip/iproute.c
+10
-1
No files found.
ip/iproute.c
View file @
68eede25
...
...
@@ -86,7 +86,7 @@ static void usage(void)
fprintf
(
stderr
,
" [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]
\n
"
);
fprintf
(
stderr
,
" [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]
\n
"
);
fprintf
(
stderr
,
" [ features FEATURES ] [ quickack BOOL ] [ congctl NAME ]
\n
"
);
fprintf
(
stderr
,
" [ pref PREF ]
\n
"
);
fprintf
(
stderr
,
" [ pref PREF ]
[ expires TIME ]
\n
"
);
fprintf
(
stderr
,
"TYPE := [ unicast | local | broadcast | multicast | throw |
\n
"
);
fprintf
(
stderr
,
" unreachable | prohibit | blackhole | nat ]
\n
"
);
fprintf
(
stderr
,
"TABLE_ID := [ local | main | default | all | NUMBER ]
\n
"
);
...
...
@@ -829,6 +829,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
int
table_ok
=
0
;
int
raw
=
0
;
int
type_ok
=
0
;
static
int
hz
;
memset
(
&
req
,
0
,
sizeof
(
req
));
...
...
@@ -899,6 +900,14 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if
(
rtnl_dsfield_a2n
(
&
tos
,
*
argv
))
invarg
(
"
\"
tos
\"
value is invalid
\n
"
,
*
argv
);
req
.
r
.
rtm_tos
=
tos
;
}
else
if
(
strcmp
(
*
argv
,
"expires"
)
==
0
)
{
__u32
expires
;
NEXT_ARG
();
if
(
get_u32
(
&
expires
,
*
argv
,
0
))
invarg
(
"
\"
expires
\"
value is invalid
\n
"
,
*
argv
);
if
(
!
hz
)
hz
=
get_user_hz
();
addattr32
(
&
req
.
n
,
sizeof
(
req
),
RTA_EXPIRES
,
expires
*
hz
);
}
else
if
(
matches
(
*
argv
,
"metric"
)
==
0
||
matches
(
*
argv
,
"priority"
)
==
0
||
strcmp
(
*
argv
,
"preference"
)
==
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