From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933378AbcBCR4o (ORCPT ); Wed, 3 Feb 2016 12:56:44 -0500 Received: from smtprelay0234.hostedemail.com ([216.40.44.234]:50545 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964787AbcBCR4m (ORCPT ); Wed, 3 Feb 2016 12:56:42 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1381:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:3872:4321:5007:6119:6261:8660:10004:10400:10848:11026:11232:11473:11658:11783:11914:12048:12517:12519:12555:12740:13069:13148:13161:13229:13230:13311:13357:13894:14659:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: flag71_1d295b8168150 X-Filterd-Recvd-Size: 1870 Message-ID: <1454522199.7291.103.camel@perches.com> Subject: IRe: [PATCH] vsprintf: flowinfo in IPv6 is optional too From: Joe Perches To: "Jason A. Donenfeld" , akpm@linux-foundation.org, linux@rasmusvillemoes.dk, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, dborkman@redhat.com Date: Wed, 03 Feb 2016 09:56:39 -0800 In-Reply-To: <1454501601-28480-1-git-send-email-Jason@zx2c4.com> References: <1454496118-26370-1-git-send-email-Jason@zx2c4.com> <1454501601-28480-1-git-send-email-Jason@zx2c4.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-02-03 at 13:13 +0100, Jason A. Donenfeld wrote: > Signed-off-by: Jason A. Donenfeld > --- >  lib/vsprintf.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 1b1b1c8..85e6645 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -1189,7 +1189,7 @@ char *ip6_addr_string_sa(char *buf, char *end, const struct sockaddr_in6 *sa, >   *p++ = ':'; >   p = number(p, pend, ntohs(sa->sin6_port), spec); >   } > - if (have_f) { > + if (have_f && (sa->sin6_flowinfo & IPV6_FLOWINFO_MASK)) { >   *p++ = '/'; >   p = number(p, pend, ntohl(sa->sin6_flowinfo & >     IPV6_FLOWINFO_MASK), spec); Why does this matter at all? The format string "%pIS[...]f" is not used currently in the kernel. If one were to call out this 'f' qualifier to %pIS, wouldn't it be better to show /0 than elide the / output completely?