aboutsummaryrefslogtreecommitdiff
path: root/tc/tc_stab.c
diff options
context:
space:
mode:
Diffstat (limited to 'tc/tc_stab.c')
-rw-r--r--tc/tc_stab.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tc/tc_stab.c b/tc/tc_stab.c
index aba8ae87..1a0a3e3f 100644
--- a/tc/tc_stab.c
+++ b/tc/tc_stab.c
@@ -31,7 +31,7 @@
static void stab_help(void)
{
fprintf(stderr,
- "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ] \n"
+ "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ]\n"
" [ overhead BYTES ] [ linklayer TYPE ] ...\n"
" mtu : max packet size we create rate map for {2047}\n"
" tsize : how many slots should size table have {512}\n"
@@ -40,7 +40,6 @@ static void stab_help(void)
" linklayer : adapting to a linklayer e.g. atm\n"
"Example: ... stab overhead 20 linklayer atm\n");
- return;
}
int check_size_table_opts(struct tc_sizespec *s)
@@ -53,9 +52,7 @@ int parse_size_table(int *argcp, char ***argvp, struct tc_sizespec *sp)
{
char **argv = *argvp;
int argc = *argcp;
- struct tc_sizespec s;
-
- memset(&s, 0, sizeof(s));
+ struct tc_sizespec s = {};
NEXT_ARG();
if (matches(*argv, "help") == 0) {
@@ -110,12 +107,14 @@ int parse_size_table(int *argcp, char ***argvp, struct tc_sizespec *sp)
void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta)
{
struct rtattr *tb[TCA_STAB_MAX + 1];
+
SPRINT_BUF(b1);
parse_rtattr_nested(tb, TCA_STAB_MAX, rta);
if (tb[TCA_STAB_BASE]) {
struct tc_sizespec s = {0};
+
memcpy(&s, RTA_DATA(tb[TCA_STAB_BASE]),
MIN(RTA_PAYLOAD(tb[TCA_STAB_BASE]), sizeof(s)));
@@ -135,8 +134,9 @@ void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta)
#if 0
if (tb[TCA_STAB_DATA]) {
- unsigned i, j, dlen;
+ unsigned int i, j, dlen;
__u16 *data = RTA_DATA(tb[TCA_STAB_DATA]);
+
dlen = RTA_PAYLOAD(tb[TCA_STAB_DATA]) / sizeof(__u16);
fprintf(fp, "\n%sstab data:", prefix);