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
ced61d7d
Commit
ced61d7d
authored
Mar 23, 2009
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle default hoplimit
Default for hoplimit is -1 which should be displayed as zero.
parent
ace9c961
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
ip/iproute.c
ip/iproute.c
+19
-7
No files found.
ip/iproute.c
View file @
ced61d7d
...
...
@@ -493,6 +493,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
mxlock
=
*
(
unsigned
*
)
RTA_DATA
(
mxrta
[
RTAX_LOCK
]);
for
(
i
=
2
;
i
<=
RTAX_MAX
;
i
++
)
{
unsigned
val
;
if
(
mxrta
[
i
]
==
NULL
)
continue
;
if
(
!
hz
)
...
...
@@ -505,21 +507,31 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
mxlock
&
(
1
<<
i
))
fprintf
(
fp
,
" lock"
);
if
(
i
!=
RTAX_RTT
&&
i
!=
RTAX_RTTVAR
&&
i
!=
RTAX_RTO_MIN
)
fprintf
(
fp
,
" %u"
,
*
(
unsigned
*
)
RTA_DATA
(
mxrta
[
i
]));
else
{
unsigned
long
long
val
=
*
(
unsigned
*
)
RTA_DATA
(
mxrta
[
i
]);
val
=
*
(
unsigned
*
)
RTA_DATA
(
mxrta
[
i
]);
switch
(
i
)
{
case
RTAX_HOPLIMIT
:
if
((
long
)
val
==
-
1
)
val
=
0
;
/* fall through */
default:
fprintf
(
fp
,
" %u"
,
val
);
break
;
case
RTAX_RTT
:
case
RTAX_RTTVAR
:
case
RTAX_RTO_MIN
:
val
*=
1000
;
if
(
i
==
RTAX_RTT
)
val
/=
8
;
else
if
(
i
==
RTAX_RTTVAR
)
val
/=
4
;
if
(
val
>=
hz
)
fprintf
(
fp
,
" %llums"
,
val
/
hz
);
fprintf
(
fp
,
" %llums"
,
(
unsigned
long
long
)
val
/
hz
);
else
fprintf
(
fp
,
" %.2fms"
,
(
float
)
val
/
hz
);
fprintf
(
fp
,
" %.2fms"
,
(
double
)
val
/
hz
);
}
}
}
...
...
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