From: David Miller <davem@davemloft.net>
To: steve.moorby@ntlworld.com
Cc: sasha.levin@oracle.com, akpm@linux-foundation.org,
paulmck@linux.vnet.ibm.com, jiri@resnulli.us,
linux-x25@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] net/x25: fix address parsing bug in x25_parse_address_block.
Date: Wed, 19 Jun 2013 17:59:28 -0700 (PDT) [thread overview]
Message-ID: <20130619.175928.1277008545805789566.davem@davemloft.net> (raw)
In-Reply-To: <1371673956-471-1-git-send-email-steve.moorby@ntlworld.com>
From: Stephen Moorby <steve.moorby@ntlworld.com>
Date: Wed, 19 Jun 2013 21:32:36 +0100
> This problem was discovered when a linux box was incorrectly rejecting
> calls from some X.25 equipment. The problem was diagnosed to an incorrect
> address length calculation in 'x25_parse_address_block', the calculation
> did not account for the address digits being BCD encoded. The correct
> calculation is already performed on line 155.
>
> Patched on linux-next 18-Jun-2013
> Tested on 2.6.32-45-generic
>
> Signed-off-by: Stephen Moorby <steve.moorby@ntlworld.com>
This change has two problems:
1) If there is existing code that does the calculation correctly, don't
get creative and express the calculation differently than the existing
code.
2) If there are two places doing the same thing, write a helper function
that does it in one place.
The exact reason this bug exists is because of code duplication, you are
making it even worse by writing the same calculation two different ways.
Please fix this up and resubmit, thanks.
next prev parent reply other threads:[~2013-06-20 0:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 20:32 [PATCH 1/1] net/x25: fix address parsing bug in x25_parse_address_block Stephen Moorby
2013-06-20 0:59 ` David Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-06-19 11:13 Stephen Moorby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130619.175928.1277008545805789566.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=sasha.levin@oracle.com \
--cc=steve.moorby@ntlworld.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).