[{"id":1772070,"web_url":"http://patchwork.ozlabs.org/comment/1772070/","msgid":"<20170920095605.1ea527fc@xeon-e3>","list_archive_url":null,"date":"2017-09-20T16:56:05","subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size\n\tis not enough","submitter":{"id":21389,"url":"http://patchwork.ozlabs.org/api/people/21389/","name":"Stephen Hemminger","email":"stephen@networkplumber.org"},"content":"On Wed, 20 Sep 2017 09:43:39 +0800\nHangbin Liu <liuhangbin@gmail.com> wrote:\n\nThanks for keeping up on this.\n\n\n> +realloc:\n> +\tbufp = realloc(buf, buf_len);\n> +\n> +\tif (bufp == NULL) {\n\nMinor personal style issue:\nTo me, blank lines are like paragraphs in writing.\nCode reads better assignment and condition check are next to\neach other.\n\n> +recv:\n> +\tlen = recvmsg(fd, msg, flag);\n> +\n> +\tif (len < 0) {\n> +\t\tif (errno == EINTR || errno == EAGAIN)\n> +\t\t\tgoto recv;\n> +\t\tfprintf(stderr, \"netlink receive error %s (%d)\\n\",\n> +\t\t\tstrerror(errno), errno);\n> +\t\tfree(buf);\n> +\t\treturn -errno;\n> +\t}\n> +\n> +\tif (len == 0) {\n> +\t\tfprintf(stderr, \"EOF on netlink\\n\");\n> +\t\tfree(buf);\n> +\t\treturn -ENODATA;\n> +\t}\n> +\n> +\tif (len > buf_len) {\n> +\t\tbuf_len = len;\n> +\t\tflag = 0;\n> +\t\tgoto realloc;\n> +\t}\n> +\n> +\tif (flag != 0) {\n> +\t\tflag = 0;\n> +\t\tgoto recv;\n\nAlthough I programmed in BASIC years ago. I never liked code\nwith loops via goto. To me it indicates the logic is not well thought\nthrough.  Not sure exactly how to rearrange the control flow, but it\nshould be possible to rewrite this so that it reads cleaner.\n\nStill think this needs to go through a few more review cycles\nbefore applying.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=networkplumber-org.20150623.gappssmtp.com\n\theader.i=@networkplumber-org.20150623.gappssmtp.com\n\theader.b=\"h9qkk6Vk\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xy5VN5p0Sz9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 02:56:12 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751709AbdITQ4L (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 12:56:11 -0400","from mail-pg0-f48.google.com ([74.125.83.48]:48510 \"EHLO\n\tmail-pg0-f48.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751693AbdITQ4J (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 12:56:09 -0400","by mail-pg0-f48.google.com with SMTP id v23so2004003pgc.5\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 09:56:09 -0700 (PDT)","from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240])\n\tby smtp.gmail.com with ESMTPSA id\n\tu8sm9801473pgq.52.2017.09.20.09.56.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 20 Sep 2017 09:56:08 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=qM2xqXiruF/eWnyEutIDAX3OS7b9ovnhu79PdNo220I=;\n\tb=h9qkk6VkHzUX/30XQBvFXbTPK2rDaxtRf961xpYA5f4qIrKDbgNo6MLP/bCA2b69Cd\n\tegrl+xjV4EF1rWadrXmrGkyJaEPKlipHwb8sVvF/GUcUsgEVS4T3B1soc/u3CFWAu1Xv\n\txrEygJLxR9w2gDchkKDqSihe/BQe5gnI4oiud93E5arFoRjWAQvDNFgHUu9p1FwmtFy8\n\tJkUFGAoHX0SYnXa1p2oqv0tyKe4AnTiDbyrljce4wQK88nEaf/hxg+R1WxsAab3/bV2a\n\tJx9CX8RBNHMridyFxg+I+usUsWYYQNe7l2gDI+8hBwZTjosOR8zZYjKWC15xvjV5Hj4A\n\tJfyg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=qM2xqXiruF/eWnyEutIDAX3OS7b9ovnhu79PdNo220I=;\n\tb=tr+4THSsP7UOnOhd/OrKS93+OXwAyIn/y1cIf0iod71h302JZjWGXKNFK5VjOizZ0J\n\thgHMDmYBa4l8RqpHZixjffHEfnhL0+dh6StDd/rpYewuKaCw6IXU7Repcqosfkb5/Nv9\n\twa1PVdV58GIaRARbs0h+K8i/b2+GnBey5JWmDQodmJ1I4X7xBxCW7HajYvM7Dl4E4MEd\n\tucocxSxkQcYcE3TU9CFH3F/udH6WXUqb8oU5c4RK65QQfVe1unEWTJZnrMZzGxNj3AIm\n\tpMZ6MezoRrzGiexX+g18OEGc9IjpDBVw/ZwXcu1ei9WzK5yucsxK8gJ37Ign2jAnwFLB\n\t3gfg==","X-Gm-Message-State":"AHPjjUjCNX5H04KXR8OsECMRomRdSU5ZF5HcZ+O0v5Q+R5ImFUtXQG5k\n\tZDW5eq3CcoxJLz9siFxKa9wiB+0ajHw=","X-Google-Smtp-Source":"AOwi7QA/Wt/nN4Lg95+Fc4y+myJyVoVB7zbCKyu8m697prMjooxXd0Xgj6spqH4EFOoJYWgK7EmPrw==","X-Received":"by 10.98.156.152 with SMTP id u24mr2736483pfk.255.1505926568737; \n\tWed, 20 Sep 2017 09:56:08 -0700 (PDT)","Date":"Wed, 20 Sep 2017 09:56:05 -0700","From":"Stephen Hemminger <stephen@networkplumber.org>","To":"Hangbin Liu <liuhangbin@gmail.com>","Cc":"netdev@vger.kernel.org, Michal Kubecek <mkubecek@suse.cz>,\n\tPhil Sutter <phil@nwl.cc>","Subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size\n\tis not enough","Message-ID":"<20170920095605.1ea527fc@xeon-e3>","In-Reply-To":"<1505871820-31580-2-git-send-email-liuhangbin@gmail.com>","References":"<1505871820-31580-1-git-send-email-liuhangbin@gmail.com>\n\t<1505871820-31580-2-git-send-email-liuhangbin@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1772484,"web_url":"http://patchwork.ozlabs.org/comment/1772484/","msgid":"<20170921072002.GM5465@leo.usersys.redhat.com>","list_archive_url":null,"date":"2017-09-21T07:20:02","subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","submitter":{"id":15639,"url":"http://patchwork.ozlabs.org/api/people/15639/","name":"Hangbin Liu","email":"liuhangbin@gmail.com"},"content":"Hi Stephen,\nOn Wed, Sep 20, 2017 at 09:56:05AM -0700, Stephen Hemminger wrote:\n> > +realloc:\n> > +\tbufp = realloc(buf, buf_len);\n> > +\n> > +\tif (bufp == NULL) {\n> \n> Minor personal style issue:\n> To me, blank lines are like paragraphs in writing.\n> Code reads better assignment and condition check are next to\n> each other.\n\nOK, I will remove the blank lines.\n> \n> > +recv:\n> > +\tlen = recvmsg(fd, msg, flag);\n> > +\n> > +\tif (len < 0) {\n> > +\t\tif (errno == EINTR || errno == EAGAIN)\n> > +\t\t\tgoto recv;\n> > +\t\tfprintf(stderr, \"netlink receive error %s (%d)\\n\",\n> > +\t\t\tstrerror(errno), errno);\n> > +\t\tfree(buf);\n> > +\t\treturn -errno;\n> > +\t}\n> > +\n> > +\tif (len == 0) {\n> > +\t\tfprintf(stderr, \"EOF on netlink\\n\");\n> > +\t\tfree(buf);\n> > +\t\treturn -ENODATA;\n> > +\t}\n> > +\n> > +\tif (len > buf_len) {\n> > +\t\tbuf_len = len;\n> > +\t\tflag = 0;\n> > +\t\tgoto realloc;\n> > +\t}\n> > +\n> > +\tif (flag != 0) {\n> > +\t\tflag = 0;\n> > +\t\tgoto recv;\n> \n> Although I programmed in BASIC years ago. I never liked code\n> with loops via goto. To me it indicates the logic is not well thought\n> through.  Not sure exactly how to rearrange the control flow, but it\n> should be possible to rewrite this so that it reads cleaner.\n\nHmm, if we remove goto. Then the logic should look like\n\n\tbufp = realloc(buf, buf_len);\n\t/* check bufp and set msg */\n\n\tlen = recvmsg(fd, msg, flag);\n\t/* check len */\n\n\tif (len > buf_len) {\n\t\tbuf_len = len;\n\t\tbufp = realloc(buf, buf_len);\n\t\t/* check bufp and set msg */\n\n\t\tlen = recvmsg(fd, msg, flag);\n\t\t/* check len */\n\t}\n\n\tlen = recvmsg(fd, msg, flag);\n\t/* check len */\n\nOr maybe we can set buf_len very small first. Then it will force to realloc at\nthe second time. And the code would like\n\n\tint buf_len = 16;\n\tbufp = realloc(buf, buf_len);\n\t/* check bufp and set msg */\n\n\tlen = recvmsg(fd, msg, flag);\n\t/* check len */\n\n\tbuf_len = len;\n\tbufp = realloc(buf, buf_len);\n\t/* check bufp and set msg */\n\n\tlen = recvmsg(fd, msg, flag);\n\t/* check len */\n\nWhat do you think?\n\nThanks\nHangbin","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"KU9YIz58\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xySgP34W5z9s76\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 17:20:17 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751798AbdIUHUP (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 03:20:15 -0400","from mail-pg0-f67.google.com ([74.125.83.67]:33960 \"EHLO\n\tmail-pg0-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751676AbdIUHUO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 03:20:14 -0400","by mail-pg0-f67.google.com with SMTP id u18so2995978pgo.1\n\tfor <netdev@vger.kernel.org>; Thu, 21 Sep 2017 00:20:14 -0700 (PDT)","from leo.usersys.redhat.com ([209.132.188.80])\n\tby smtp.gmail.com with ESMTPSA id\n\tl12sm1742101pgp.74.2017.09.21.00.20.11\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 21 Sep 2017 00:20:13 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=zhlWOMQealh/Ncr8MVoTd95ERh9EGaEpCMkYC+IJ4z8=;\n\tb=KU9YIz58Z/STvrINTxM/STcfuwjjqF7xTAzw2BdUuzBlsToWyQMmZnOkWlPsiZKRaA\n\tzfwTwU6xXZYWgC3JEu400k1Q3bvsfDKH9V7cVpBS2NdLcA1YyFTK2HIv2XLyAzr+wMwf\n\tZdvVYxMH2RKxW/zJe7XT7J/fz75Jcz/V3w5ljqu/uOo4wkoXyNLnmydTfe22pTnWPAUH\n\tCuuMJQmY1RASyKQF3jkTNBfqUQ6fhF5pSikJZMs3UslkiutCTwFd439VbEp4C/DZaeIK\n\tTTWBg2PfH/MqeKr/TZDxgkMu3e7aea0dG0+BWHcdfF1u7wXBZUVCwxL62ouP0xrsRo3a\n\t25Bw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=zhlWOMQealh/Ncr8MVoTd95ERh9EGaEpCMkYC+IJ4z8=;\n\tb=c6Bs0oCfA4bTZbsfnbOjHe72+GElvGYROaTiVp07ty0Ill4prVgjGRm1m60fHkZGKq\n\tXexqqE5/ifrUy+319fjcMEwEWd/SHFzcGiSTeiTHU+WKpEk2c/ZzsriU6tTv/KwvrJy/\n\tbu1L4X21nrwnCB/qpgEPlRjLkoRcNxp8Xa66ZPymHmb4S9YhO/aUSi4WVirdmL5lc7kY\n\tp6TWVfOZEkU51+2aVTmu9R02ZJi/3IO1zfc7x7tJidZjAKqWJoTWFZ9Vsd6nPstTsYnQ\n\tjoOei6H2Ltt88rXep3fWuLdaGjIYDFtRKDI9NMVkuvOVGs5yjYfNAjBwL2ZI+MzbItEh\n\t4CyA==","X-Gm-Message-State":"AHPjjUj4dPz69flMEi9jDIPkfq39mEylTnT/Xdrr4ryCcIdcHzXQ4XvL\n\tPZK0ZmgR6cF54wvi9cJn3qk=","X-Google-Smtp-Source":"AOwi7QBtOqYNESJi85rwMYmJm89JmzkB0e3Iiaf5p7Fp9zzpuMsEBAHLQc9dt2S2/FnjMR49y7ZAmw==","X-Received":"by 10.84.210.225 with SMTP id a88mr4551322pli.79.1505978413845; \n\tThu, 21 Sep 2017 00:20:13 -0700 (PDT)","Date":"Thu, 21 Sep 2017 15:20:02 +0800","From":"Hangbin Liu <liuhangbin@gmail.com>","To":"Stephen Hemminger <stephen@networkplumber.org>","Cc":"netdev@vger.kernel.org, Michal Kubecek <mkubecek@suse.cz>,\n\tPhil Sutter <phil@nwl.cc>","Subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","Message-ID":"<20170921072002.GM5465@leo.usersys.redhat.com>","References":"<1505871820-31580-1-git-send-email-liuhangbin@gmail.com>\n\t<1505871820-31580-2-git-send-email-liuhangbin@gmail.com>\n\t<20170920095605.1ea527fc@xeon-e3>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170920095605.1ea527fc@xeon-e3>","User-Agent":"Mutt/1.7.0 (2016-08-17)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1772494,"web_url":"http://patchwork.ozlabs.org/comment/1772494/","msgid":"<20170921073420.dcoipli2sxy3bmnx@unicorn.suse.cz>","list_archive_url":null,"date":"2017-09-21T07:34:20","subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","submitter":{"id":11892,"url":"http://patchwork.ozlabs.org/api/people/11892/","name":"Michal Kubecek","email":"mkubecek@suse.cz"},"content":"On Thu, Sep 21, 2017 at 03:20:02PM +0800, Hangbin Liu wrote:\n> \n> Or maybe we can set buf_len very small first. Then it will force to realloc at\n> the second time. And the code would like\n> \n> \tint buf_len = 16;\n> \tbufp = realloc(buf, buf_len);\n> \t/* check bufp and set msg */\n> \n> \tlen = recvmsg(fd, msg, flag);\n> \t/* check len */\n> \n> \tbuf_len = len;\n> \tbufp = realloc(buf, buf_len);\n> \t/* check bufp and set msg */\n> \n> \tlen = recvmsg(fd, msg, flag);\n> \t/* check len */\n> \n> What do you think?\n\nI will have to check but IIRC it might be possible to use zero length\nfor the peek to only check the length which could help you to avoid both\nthe reallocation and copying the same data from kernel to userspace\ntwice.\n\nMichal Kubecek","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xySzl0Mgbz9sNc\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 17:34:27 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751878AbdIUHeZ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 03:34:25 -0400","from mx2.suse.de ([195.135.220.15]:44236 \"EHLO mx1.suse.de\"\n\trhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP\n\tid S1751588AbdIUHeY (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tThu, 21 Sep 2017 03:34:24 -0400","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 8E651ABDB;\n\tThu, 21 Sep 2017 07:34:22 +0000 (UTC)","by unicorn.suse.cz (Postfix, from userid 1000)\n\tid 44878A0F06; Thu, 21 Sep 2017 09:34:20 +0200 (CEST)"],"X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","Date":"Thu, 21 Sep 2017 09:34:20 +0200","From":"Michal Kubecek <mkubecek@suse.cz>","To":"Hangbin Liu <liuhangbin@gmail.com>","Cc":"Stephen Hemminger <stephen@networkplumber.org>,\n\tnetdev@vger.kernel.org, Phil Sutter <phil@nwl.cc>","Subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","Message-ID":"<20170921073420.dcoipli2sxy3bmnx@unicorn.suse.cz>","References":"<1505871820-31580-1-git-send-email-liuhangbin@gmail.com>\n\t<1505871820-31580-2-git-send-email-liuhangbin@gmail.com>\n\t<20170920095605.1ea527fc@xeon-e3>\n\t<20170921072002.GM5465@leo.usersys.redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170921072002.GM5465@leo.usersys.redhat.com>","User-Agent":"NeoMutt/20170421 (1.8.2)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776811,"web_url":"http://patchwork.ozlabs.org/comment/1776811/","msgid":"<20170928071306.GB1498@leo.usersys.redhat.com>","list_archive_url":null,"date":"2017-09-28T07:13:06","subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","submitter":{"id":69853,"url":"http://patchwork.ozlabs.org/api/people/69853/","name":"Hangbin Liu","email":"haliu@redhat.com"},"content":"Hi Michal,\n\nOn Thu, Sep 21, 2017 at 09:34:20AM +0200, Michal Kubecek wrote:\n> I will have to check but IIRC it might be possible to use zero length\n> for the peek to only check the length which could help you to avoid both\n> the reallocation and copying the same data from kernel to userspace\n> twice.\n\nYes, msg with zero buf length also works. I will post a new patch after fix.\n\nThanks\nHangbin","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=haliu@redhat.com"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2mB718cFz9t5x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 17:13:18 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751355AbdI1HNN (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 Sep 2017 03:13:13 -0400","from mx1.redhat.com ([209.132.183.28]:46042 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750794AbdI1HNM (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tThu, 28 Sep 2017 03:13:12 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id B348DDC598;\n\tThu, 28 Sep 2017 07:13:12 +0000 (UTC)","from leo.usersys.redhat.com (dhcp-13-183.nay.redhat.com\n\t[10.66.13.183])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id D471C7E67F;\n\tThu, 28 Sep 2017 07:13:09 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com B348DDC598","Date":"Thu, 28 Sep 2017 15:13:06 +0800","From":"Hangbin Liu <haliu@redhat.com>","To":"Michal Kubecek <mkubecek@suse.cz>","Cc":"Hangbin Liu <liuhangbin@gmail.com>,\n\tStephen Hemminger <stephen@networkplumber.org>,\n\tnetdev@vger.kernel.org, Phil Sutter <phil@nwl.cc>","Subject":"Re: [PATCHv3 iproute2 1/2] lib/libnetlink: re malloc buff if size is\n\tnot enough","Message-ID":"<20170928071306.GB1498@leo.usersys.redhat.com>","References":"<1505871820-31580-1-git-send-email-liuhangbin@gmail.com>\n\t<1505871820-31580-2-git-send-email-liuhangbin@gmail.com>\n\t<20170920095605.1ea527fc@xeon-e3>\n\t<20170921072002.GM5465@leo.usersys.redhat.com>\n\t<20170921073420.dcoipli2sxy3bmnx@unicorn.suse.cz>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170921073420.dcoipli2sxy3bmnx@unicorn.suse.cz>","User-Agent":"Mutt/1.7.0 (2016-08-17)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tThu, 28 Sep 2017 07:13:12 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]