netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bridge-utils: wrong sysfs path odds
@ 2015-11-25  0:15 Richard Weinberger
  2015-11-25  0:24 ` Richard Weinberger
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Weinberger @ 2015-11-25  0:15 UTC (permalink / raw)
  To: netdev@vger.kernel.org; +Cc: Ralf Baechle, Stephen Hemminger, manty

Hi!

Today I was hunting down an issue where "brctl stp br0 off"
always failed on mips64be with n32 userland.

It turned out that the ioctl(fd, SIOCDEVPRIVATE, &ifr) with BRCTL_SET_BRIDGE_STP_STATE
returned -EOPNOTSUPP.
First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
the ioctl() argument was 0x1 instead of the expected BRCTL_SET_BRIDGE_STP_STATE (0x14)

Further investigation showed that brctl first tries to open the sysfs file
"/sys/class/net/br0/stp_state" and falls back to the legacy ioctl() upon failure.

On my mips setup old_dev_ioctl() seems not to work. And the function's comment
is correct:
/*
 * Legacy ioctl's through SIOCDEVPRIVATE
 * This interface is deprecated because it was too difficult to
 * to do the translation for 32/64bit ioctl compatibility.
 */

Later I've realized that the sysfs path is wrong, the "bridge/" directory
part is missing.
On most setups nobody would notice as the fallback ioctl() works.

Debian's bridge-utils package carries a patch which fixes the sysfs paths.
Can we please have this patch also in upstream bridge-utils?

Thanks,
//richard

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-11-25 22:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25  0:15 bridge-utils: wrong sysfs path odds Richard Weinberger
2015-11-25  0:24 ` Richard Weinberger
2015-11-25  0:37   ` Stephen Hemminger
2015-11-25  0:40     ` Richard Weinberger
2015-11-25  9:21     ` Richard Weinberger
     [not found]       ` <CAJk_L2GSvNUGiexawakMHdm+v5ndv=qLXB9TD7xxn7z9c-ZMsg@mail.gmail.com>
2015-11-25 22:37         ` Richard Weinberger
2015-11-25 22:44         ` Fwd: " Santiago Garcia Mantinan
2015-11-25 22:38       ` Florian Fainelli
2015-11-25 22:41         ` Richard Weinberger

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).