From b906243b62c832f24473de3ead7d7feef0e75e4b Mon Sep 17 00:00:00 2001 From: "net[shemminger]!shemminger" Date: Mon, 17 Jan 2005 23:28:16 +0000 Subject: [PATCH] Import patch iproute2.116 (Logical change 1.118) --- ChangeLog | 5 +++++ ip/ipxfrm.c | 14 +++++++------- tc/f_u32.c | 7 +++++-- tc/q_hfsc.c | 4 ++-- tc/tc_util.c | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9ee19db..98822458 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-12 Stephen Hemminger + + * Fix compile warnings when building 64bit system since + u64 is unsigned long, but format is %llu + 2005-01-12 "Catalin(ux aka Dino) BOIE" * Add the possibility to use fwmark in u32 filters diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c index 4df3fb99..b29b3a03 100644 --- a/ip/ipxfrm.c +++ b/ip/ipxfrm.c @@ -243,7 +243,7 @@ static const char *strxf_limit(__u64 limit) if (limit == XFRM_INF) strcpy(str, "(INF)"); else - sprintf(str, "%llu", limit); + sprintf(str, "%llu", (unsigned long long) limit); return str; } @@ -323,9 +323,9 @@ void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg, fprintf(fp, " "); fprintf(fp, "expire add: "); fprintf(fp, "soft "); - fprintf(fp, "%llu", cfg->soft_add_expires_seconds); + fprintf(fp, "%llu", (unsigned long long) cfg->soft_add_expires_seconds); fprintf(fp, "(sec), hard "); - fprintf(fp, "%llu", cfg->hard_add_expires_seconds); + fprintf(fp, "%llu", (unsigned long long) cfg->hard_add_expires_seconds); fprintf(fp, "(sec)"); fprintf(fp, "%s", _SL_); @@ -334,9 +334,9 @@ void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg, fprintf(fp, " "); fprintf(fp, "expire use: "); fprintf(fp, "soft "); - fprintf(fp, "%llu", cfg->soft_use_expires_seconds); + fprintf(fp, "%llu", (unsigned long long) cfg->soft_use_expires_seconds); fprintf(fp, "(sec), hard "); - fprintf(fp, "%llu", cfg->hard_use_expires_seconds); + fprintf(fp, "%llu", (unsigned long long) cfg->hard_use_expires_seconds); fprintf(fp, "(sec)"); fprintf(fp, "%s", _SL_); } @@ -349,8 +349,8 @@ void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg, if (prefix) fprintf(fp, prefix); fprintf(fp, " "); - fprintf(fp, "%llu(bytes), ", cur->bytes); - fprintf(fp, "%llu(packets)", cur->packets); + fprintf(fp, "%llu(bytes), ", (unsigned long long) cur->bytes); + fprintf(fp, "%llu(packets)", (unsigned long long) cur->packets); fprintf(fp, "%s", _SL_); if (prefix) diff --git a/tc/f_u32.c b/tc/f_u32.c index d661f52b..1d96d63f 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -1005,7 +1005,9 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __ } if (sel && show_stats && NULL != pf) - fprintf(f, " (rule hit %llu success %llu)",pf->rcnt,pf->rhit); + fprintf(f, " (rule hit %llu success %llu)", + (unsigned long long) pf->rcnt, + (unsigned long long) pf->rhit); if (tb[TCA_U32_MARK]) { struct tc_u32_mark *mark = RTA_DATA(tb[TCA_U32_MARK]); @@ -1028,7 +1030,8 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __ key->offmask ? "nexthdr+" : "", key->off); if (show_stats && NULL != pf) - fprintf(f, " (success %lld ) ",pf->kcnts[i]); + fprintf(f, " (success %lld ) ", + (unsigned long long) pf->kcnts[i]); } } diff --git a/tc/q_hfsc.c b/tc/q_hfsc.c index 77458860..021fbb5b 100644 --- a/tc/q_hfsc.c +++ b/tc/q_hfsc.c @@ -129,9 +129,9 @@ hfsc_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) fprintf(f, " period %u ", st->period); if (st->work != 0) - fprintf(f, "work %llu bytes ", st->work); + fprintf(f, "work %llu bytes ", (unsigned long long) st->work); if (st->rtwork != 0) - fprintf(f, "rtwork %llu bytes ", st->rtwork); + fprintf(f, "rtwork %llu bytes ", (unsigned long long) st->rtwork); fprintf(f, "level %u ", st->level); fprintf(f, "\n"); diff --git a/tc/tc_util.c b/tc/tc_util.c index 45a35c4f..2a19e3f1 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -437,7 +437,7 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat struct gnet_stats_basic bs = {0}; memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs))); fprintf(fp, "%sSent %llu bytes %u pkt", - prefix, bs.bytes, bs.packets); + prefix, (unsigned long long) bs.bytes, bs.packets); } if (tbs[TCA_STATS_QUEUE]) {