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
5e8bc631
Commit
5e8bc631
authored
Mar 14, 2005
by
net[shemminger]!shemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import patch iproute2-hz
(Logical change 1.159)
parent
d27d73ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
include/utils.h
include/utils.h
+10
-0
ip/iproute.c
ip/iproute.c
+3
-3
lib/utils.c
lib/utils.c
+7
-0
tc/tc_util.c
tc/tc_util.c
+1
-1
No files found.
include/utils.h
View file @
5e8bc631
...
...
@@ -113,4 +113,14 @@ static __inline__ int get_hz(void)
return
__iproute2_hz_internal
;
}
extern
int
__iproute2_user_hz_internal
;
extern
int
__get_user_hz
(
void
);
static
__inline__
int
get_user_hz
(
void
)
{
if
(
__iproute2_user_hz_internal
==
0
)
__iproute2_user_hz_internal
=
__get_user_hz
();
return
__iproute2_user_hz_internal
;
}
#endif
/* __UTILS_H__ */
ip/iproute.c
View file @
5e8bc631
...
...
@@ -410,7 +410,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
struct
rta_cacheinfo
*
ci
=
RTA_DATA
(
tb
[
RTA_CACHEINFO
]);
static
int
hz
;
if
(
!
hz
)
hz
=
get_hz
();
hz
=
get_
user_
hz
();
if
(
ci
->
rta_expires
!=
0
)
fprintf
(
fp
,
" expires %dsec"
,
ci
->
rta_expires
/
hz
);
if
(
ci
->
rta_error
!=
0
)
...
...
@@ -437,7 +437,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
((
r
->
rtm_flags
&
RTM_F_CLONED
)
||
(
ci
&&
ci
->
rta_expires
))
{
static
int
hz
;
if
(
!
hz
)
hz
=
get_hz
();
hz
=
get_
user_
hz
();
if
(
r
->
rtm_flags
&
RTM_F_CLONED
)
fprintf
(
fp
,
"%s cache "
,
_SL_
);
if
(
ci
->
rta_expires
)
...
...
@@ -487,7 +487,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
i
-
2
<
sizeof
(
mx_names
)
/
sizeof
(
char
*
))
fprintf
(
fp
,
" %s"
,
mx_names
[
i
-
2
]);
else
fprintf
(
fp
,
" metric%d"
,
i
);
fprintf
(
fp
,
" metric
%d"
,
i
);
if
(
mxlock
&
(
1
<<
i
))
fprintf
(
fp
,
" lock"
);
...
...
lib/utils.c
View file @
5e8bc631
...
...
@@ -384,6 +384,13 @@ int __get_hz(void)
return
HZ
;
}
int
__iproute2_user_hz_internal
;
int
__get_user_hz
(
void
)
{
return
sysconf
(
_SC_CLK_TCK
);
}
const
char
*
rt_addr_n2a
(
int
af
,
int
len
,
const
void
*
addr
,
char
*
buf
,
int
buflen
)
{
switch
(
af
)
{
...
...
tc/tc_util.c
View file @
5e8bc631
...
...
@@ -421,7 +421,7 @@ int action_a2n(char *arg, int *result)
void
print_tm
(
FILE
*
f
,
const
struct
tcf_t
*
tm
)
{
int
hz
=
get_hz
();
int
hz
=
get_
user_
hz
();
if
(
tm
->
install
!=
0
)
fprintf
(
f
,
" installed %u sec"
,
(
unsigned
)(
tm
->
install
/
hz
));
if
(
tm
->
lastuse
!=
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