qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Erik Kline <1814352@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 1814352] Re: SIOCGIFNAME takes a struct ifreq not an integer
Date: Mon, 06 May 2019 16:54:14 -0000	[thread overview]
Message-ID: <155716165423.19039.12111324989595094622.malone@gac.canonical.com> (raw)
In-Reply-To: 154907151753.31178.12938166708527410326.malonedeb@gac.canonical.com

Please let me know if further work or another patch submission is
required.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1814352

Title:
  SIOCGIFNAME takes a struct ifreq not an integer

Status in QEMU:
  Confirmed

Bug description:
  The ioctl SIOCGIFNAME takes a pointer to a struct ifreq, not an
  integer.  This leads to if_indextoname() not correctly returning
  interface names (well, not if they're longer than 4 characters
  including the trailing NULL ;-).

  This is observed on v3.1.0.

  The following one-line patch will be sent to the qemu-devel mailing
  list:

  """
  diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
  index ae8951625f..37501f575c 100644
  --- a/linux-user/ioctls.h
  +++ b/linux-user/ioctls.h
  @@ -178,7 +178,7 @@
   #endif /* CONFIG_USBFS */
   
     IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
  -  IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
  +  IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
     IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
     IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
     IOCTL(SIOCGIFADDR, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
  """

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1814352/+subscriptions


  parent reply	other threads:[~2019-05-06 17:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02  1:38 [Qemu-devel] [Bug 1814352] [NEW] SIOCGIFNAME takes a struct ifreq not an integer Erik Kline
2019-04-09 13:51 ` [Qemu-devel] [Bug 1814352] " Peter Maydell
2019-04-09 13:51   ` Peter Maydell
2019-04-09 18:18   ` Erik Kline
2019-04-09 18:18     ` Erik Kline
2019-04-09 20:16     ` Peter Maydell
2019-04-09 20:16       ` Peter Maydell
2019-04-09 20:16       ` Peter Maydell
2019-04-23 22:31 ` Erik Kline
2019-04-23 22:31   ` Erik Kline
2019-04-29 22:15 ` Erik Kline
2019-04-29 22:15   ` Erik Kline
2019-05-06 16:54 ` Erik Kline [this message]
2019-05-10 16:40 ` Erik Kline
2019-05-10 16:40 ` Erik Kline
2019-08-16  2:02 ` Erik Kline

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=155716165423.19039.12111324989595094622.malone@gac.canonical.com \
    --to=1814352@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /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).