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
53e16e39
Commit
53e16e39
authored
Mar 21, 2014
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into net-next
parents
bf9f122d
9e763fa5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
bridge/fdb.c
bridge/fdb.c
+6
-1
ip/iproute.c
ip/iproute.c
+4
-4
tc/q_htb.c
tc/q_htb.c
+9
-9
No files found.
bridge/fdb.c
View file @
53e16e39
...
@@ -103,8 +103,13 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
...
@@ -103,8 +103,13 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
tb
[
NDA_DST
])
{
if
(
tb
[
NDA_DST
])
{
SPRINT_BUF
(
abuf
);
SPRINT_BUF
(
abuf
);
int
family
=
AF_INET
;
if
(
RTA_PAYLOAD
(
tb
[
NDA_DST
])
==
sizeof
(
struct
in6_addr
))
family
=
AF_INET6
;
fprintf
(
fp
,
"dst %s "
,
fprintf
(
fp
,
"dst %s "
,
format_host
(
AF_INET
,
format_host
(
family
,
RTA_PAYLOAD
(
tb
[
NDA_DST
]),
RTA_PAYLOAD
(
tb
[
NDA_DST
]),
RTA_DATA
(
tb
[
NDA_DST
]),
RTA_DATA
(
tb
[
NDA_DST
]),
abuf
,
sizeof
(
abuf
)));
abuf
,
sizeof
(
abuf
)));
...
...
ip/iproute.c
View file @
53e16e39
...
@@ -332,7 +332,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
...
@@ -332,7 +332,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
n
->
nlmsg_type
==
RTM_DELROUTE
)
if
(
n
->
nlmsg_type
==
RTM_DELROUTE
)
fprintf
(
fp
,
"Deleted "
);
fprintf
(
fp
,
"Deleted "
);
if
(
r
->
rtm_type
!=
RTN_UNICAST
&&
!
filter
.
type
)
if
(
(
r
->
rtm_type
!=
RTN_UNICAST
||
show_details
>
0
)
&&
!
filter
.
type
)
fprintf
(
fp
,
"%s "
,
rtnl_rtntype_n2a
(
r
->
rtm_type
,
b1
,
sizeof
(
b1
)));
fprintf
(
fp
,
"%s "
,
rtnl_rtntype_n2a
(
r
->
rtm_type
,
b1
,
sizeof
(
b1
)));
if
(
tb
[
RTA_DST
])
{
if
(
tb
[
RTA_DST
])
{
...
@@ -389,11 +389,11 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
...
@@ -389,11 +389,11 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf
(
fp
,
"dev %s "
,
ll_index_to_name
(
*
(
int
*
)
RTA_DATA
(
tb
[
RTA_OIF
])));
fprintf
(
fp
,
"dev %s "
,
ll_index_to_name
(
*
(
int
*
)
RTA_DATA
(
tb
[
RTA_OIF
])));
if
(
!
(
r
->
rtm_flags
&
RTM_F_CLONED
))
{
if
(
!
(
r
->
rtm_flags
&
RTM_F_CLONED
))
{
if
(
table
!=
RT_TABLE_MAIN
&&
!
filter
.
tb
)
if
(
(
table
!=
RT_TABLE_MAIN
||
show_details
>
0
)
&&
!
filter
.
tb
)
fprintf
(
fp
,
" table %s "
,
rtnl_rttable_n2a
(
table
,
b1
,
sizeof
(
b1
)));
fprintf
(
fp
,
" table %s "
,
rtnl_rttable_n2a
(
table
,
b1
,
sizeof
(
b1
)));
if
(
r
->
rtm_protocol
!=
RTPROT_BOOT
&&
filter
.
protocolmask
!=
-
1
)
if
(
(
r
->
rtm_protocol
!=
RTPROT_BOOT
||
show_details
>
0
)
&&
filter
.
protocolmask
!=
-
1
)
fprintf
(
fp
,
" proto %s "
,
rtnl_rtprot_n2a
(
r
->
rtm_protocol
,
b1
,
sizeof
(
b1
)));
fprintf
(
fp
,
" proto %s "
,
rtnl_rtprot_n2a
(
r
->
rtm_protocol
,
b1
,
sizeof
(
b1
)));
if
(
r
->
rtm_scope
!=
RT_SCOPE_UNIVERSE
&&
filter
.
scopemask
!=
-
1
)
if
(
(
r
->
rtm_scope
!=
RT_SCOPE_UNIVERSE
||
show_details
>
0
)
&&
filter
.
scopemask
!=
-
1
)
fprintf
(
fp
,
" scope %s "
,
rtnl_rtscope_n2a
(
r
->
rtm_scope
,
b1
,
sizeof
(
b1
)));
fprintf
(
fp
,
" scope %s "
,
rtnl_rtscope_n2a
(
r
->
rtm_scope
,
b1
,
sizeof
(
b1
)));
}
}
if
(
tb
[
RTA_PREFSRC
]
&&
filter
.
rprefsrc
.
bitlen
!=
host_len
)
{
if
(
tb
[
RTA_PREFSRC
]
&&
filter
.
rprefsrc
.
bitlen
!=
host_len
)
{
...
...
tc/q_htb.c
View file @
53e16e39
...
@@ -62,6 +62,7 @@ static void explain1(char *arg)
...
@@ -62,6 +62,7 @@ static void explain1(char *arg)
static
int
htb_parse_opt
(
struct
qdisc_util
*
qu
,
int
argc
,
char
**
argv
,
struct
nlmsghdr
*
n
)
static
int
htb_parse_opt
(
struct
qdisc_util
*
qu
,
int
argc
,
char
**
argv
,
struct
nlmsghdr
*
n
)
{
{
unsigned
int
direct_qlen
=
~
0U
;
struct
tc_htb_glob
opt
;
struct
tc_htb_glob
opt
;
struct
rtattr
*
tail
;
struct
rtattr
*
tail
;
unsigned
i
;
char
*
p
;
unsigned
i
;
char
*
p
;
...
@@ -86,6 +87,11 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
...
@@ -86,6 +87,11 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
if
(
*
p
<
'0'
||
*
p
>
'3'
)
break
;
if
(
*
p
<
'0'
||
*
p
>
'3'
)
break
;
opt
.
debug
|=
(
*
p
-
'0'
)
<<
(
2
*
i
);
opt
.
debug
|=
(
*
p
-
'0'
)
<<
(
2
*
i
);
}
}
}
else
if
(
matches
(
*
argv
,
"direct_qlen"
)
==
0
)
{
NEXT_ARG
();
if
(
get_u32
(
&
direct_qlen
,
*
argv
,
10
))
{
explain1
(
"direct_qlen"
);
return
-
1
;
}
}
else
{
}
else
{
fprintf
(
stderr
,
"What is
\"
%s
\"
?
\n
"
,
*
argv
);
fprintf
(
stderr
,
"What is
\"
%s
\"
?
\n
"
,
*
argv
);
explain
();
explain
();
...
@@ -96,6 +102,9 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
...
@@ -96,6 +102,9 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
tail
=
NLMSG_TAIL
(
n
);
tail
=
NLMSG_TAIL
(
n
);
addattr_l
(
n
,
1024
,
TCA_OPTIONS
,
NULL
,
0
);
addattr_l
(
n
,
1024
,
TCA_OPTIONS
,
NULL
,
0
);
addattr_l
(
n
,
2024
,
TCA_HTB_INIT
,
&
opt
,
NLMSG_ALIGN
(
sizeof
(
opt
)));
addattr_l
(
n
,
2024
,
TCA_HTB_INIT
,
&
opt
,
NLMSG_ALIGN
(
sizeof
(
opt
)));
if
(
direct_qlen
!=
~
0U
)
addattr_l
(
n
,
2024
,
TCA_HTB_DIRECT_QLEN
,
&
direct_qlen
,
sizeof
(
direct_qlen
));
tail
->
rta_len
=
(
void
*
)
NLMSG_TAIL
(
n
)
-
(
void
*
)
tail
;
tail
->
rta_len
=
(
void
*
)
NLMSG_TAIL
(
n
)
-
(
void
*
)
tail
;
return
0
;
return
0
;
}
}
...
@@ -110,7 +119,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -110,7 +119,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
unsigned
mtu
;
unsigned
mtu
;
unsigned
short
mpu
=
0
;
unsigned
short
mpu
=
0
;
unsigned
short
overhead
=
0
;
unsigned
short
overhead
=
0
;
unsigned
int
direct_qlen
=
~
0U
;
unsigned
int
linklayer
=
LINKLAYER_ETHERNET
;
/* Assume ethernet */
unsigned
int
linklayer
=
LINKLAYER_ETHERNET
;
/* Assume ethernet */
struct
rtattr
*
tail
;
struct
rtattr
*
tail
;
__u64
ceil64
=
0
,
rate64
=
0
;
__u64
ceil64
=
0
,
rate64
=
0
;
...
@@ -129,11 +137,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -129,11 +137,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
if
(
get_u32
(
&
mtu
,
*
argv
,
10
))
{
if
(
get_u32
(
&
mtu
,
*
argv
,
10
))
{
explain1
(
"mtu"
);
return
-
1
;
explain1
(
"mtu"
);
return
-
1
;
}
}
}
else
if
(
matches
(
*
argv
,
"direct_qlen"
)
==
0
)
{
NEXT_ARG
();
if
(
get_u32
(
&
direct_qlen
,
*
argv
,
10
))
{
explain1
(
"direct_qlen"
);
return
-
1
;
}
}
else
if
(
matches
(
*
argv
,
"mpu"
)
==
0
)
{
}
else
if
(
matches
(
*
argv
,
"mpu"
)
==
0
)
{
NEXT_ARG
();
NEXT_ARG
();
if
(
get_u16
(
&
mpu
,
*
argv
,
10
))
{
if
(
get_u16
(
&
mpu
,
*
argv
,
10
))
{
...
@@ -245,9 +248,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -245,9 +248,6 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
opt
.
cbuffer
=
tc_calc_xmittime
(
ceil64
,
cbuffer
);
opt
.
cbuffer
=
tc_calc_xmittime
(
ceil64
,
cbuffer
);
tail
=
NLMSG_TAIL
(
n
);
tail
=
NLMSG_TAIL
(
n
);
if
(
direct_qlen
!=
~
0U
)
addattr_l
(
n
,
1024
,
TCA_HTB_DIRECT_QLEN
,
&
direct_qlen
,
sizeof
(
direct_qlen
));
addattr_l
(
n
,
1024
,
TCA_OPTIONS
,
NULL
,
0
);
addattr_l
(
n
,
1024
,
TCA_OPTIONS
,
NULL
,
0
);
if
(
rate64
>=
(
1ULL
<<
32
))
if
(
rate64
>=
(
1ULL
<<
32
))
...
...
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