From: Matt Domsch <Matt_Domsch@dell.com>
To: netdev@oss.sgi.com
Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len
Date: Fri, 29 Oct 2004 20:37:00 -0500 [thread overview]
Message-ID: <20041030013700.GA21540@lists.us.dell.com> (raw)
In-Reply-To: <20041029215134.GA15414@lists.us.dell.com>
On Fri, Oct 29, 2004 at 04:51:34PM -0500, Matt Domsch wrote:
> If dev->dev_addr is zero, then the memcpy() never takes place, and the
> same data that was in the caller's buffer is still in the caller's
> buffer on successful return. The caller can't know that the data in
> its buffer isn't the right answer. So, if dev->dev_addr == 0,
> clear the buffer before returning success.
Some additional detail I forgot to include.
s/dev_addr/addr_len in the comments above, that's the field we care
about being non-zero.
This directly affects ppp devices, as those have dev->addr_len == 0.
This was seen because net-snmp reports the MAC address of devices in
the system, and for ppp devices was reporting an address of 0x00FFFFFF
because that was the data in the buffer prior to calling ioctl().
This patch causes the 2.6 behaviour to match that of the 2.4 kernel
which has a fixed length MAX_ADDR_LEN instead of a variable addr_len
and always copies MAX_ADDR_LEN bytes.
Thanks to Jordan Hargrave for root cause analysis and suggesting the
fix.
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
next prev parent reply other threads:[~2004-10-30 1:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-29 21:51 [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Matt Domsch
2004-10-30 1:37 ` Matt Domsch [this message]
2004-10-30 1:51 ` Herbert Xu
2004-10-30 3:09 ` Matt Domsch
2004-10-30 19:10 ` jamal
2004-11-01 4:44 ` Matt Domsch
2004-11-01 17:34 ` Matt Domsch
2004-11-01 20:27 ` Herbert Xu
2004-11-01 20:38 ` Matt Domsch
2004-11-01 20:41 ` Herbert Xu
2004-11-01 20:45 ` Matt Domsch
2004-11-01 21:50 ` jamal
2004-11-01 21:59 ` Matt Domsch
2004-11-01 22:06 ` Herbert Xu
2004-11-04 0:07 ` David S. Miller
2004-11-04 3:42 ` Matt Domsch
2004-11-01 22:03 ` Herbert Xu
2004-10-30 1:48 ` Herbert Xu
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=20041030013700.GA21540@lists.us.dell.com \
--to=matt_domsch@dell.com \
--cc=netdev@oss.sgi.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).