From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757771AbcBCXhT (ORCPT ); Wed, 3 Feb 2016 18:37:19 -0500 Received: from smtprelay0209.hostedemail.com ([216.40.44.209]:47164 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755156AbcBCXhQ (ORCPT ); Wed, 3 Feb 2016 18:37:16 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1538:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3350:3622:3865:3868:3874:4321:5007:6261:10004:10400:10848:11026:11232:11658:11914:12296:12517:12519:12740:13069:13311:13357: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:1,LUA_SUMMARY:none X-HE-Tag: nut41_5c349fc421537 X-Filterd-Recvd-Size: 1515 Message-ID: <1454542632.7291.144.camel@perches.com> Subject: Re: [PATCH v2] vsprintf: automatic parameters for %pIS via 'a' From: Joe Perches To: "Jason A. Donenfeld" Cc: Daniel Borkmann , Andrew Morton , linux@rasmusvillemoes.dk, andriy.shevchenko@linux.intel.com, LKML Date: Wed, 03 Feb 2016 15:37:12 -0800 In-Reply-To: <1454542185-1147-1-git-send-email-Jason@zx2c4.com> References: <1454540721.7291.141.camel@perches.com> <1454542185-1147-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: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-02-04 at 00:29 +0100, Jason A. Donenfeld wrote: > This patch adds a variable 'a' which indicates that the 'p', > 'f', and 's' options should be toggled on or off depending on > whether or not those parameters are actually valid inside the > passed sockaddr. trivia: > diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > @@ -1225,9 +1234,15 @@ char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa, [] > + if (have_a) > + have_p = sa->sin_port != 0; > + different style than the v6 tests