[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] ifplugd: Allow ENODEV when upping interface for -M
From: Jate Sujjavanich <jatedev () gmail ! com>
Date: 2016-08-29 22:47:58
Message-ID: CAPphmga+vePbSdzH-_HAzWxzR0rk1TThdE+E5R7fk+JCc3Lo=g () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
I was finally able to try out the commit in busybox master. The patch
worked.
On Fri, Aug 19, 2016 at 9:40 AM, Denys Vlasenko <vda.linux@googlemail.com>
wrote:
> Fixed in git, please try it.
>
> On Thu, Aug 18, 2016 at 10:00 PM, Jate Sujjavanich <jatedev@gmail.com>
> wrote:
> > I am able to reproduce the issue on my system consistently. I'm using
> > modprobe to remove the driver for g_ether on my ARM system. Using strace
> > reduces the frequency of the bug, but it still occurs.
> >
> > Here's the output from strace:
> >
> > 14:50:53.886676 ioctl(3, SIOCGIFFLAGS, {ifr_name="usb0",
> > ifr_flags=IFF_BROADCAS
> > T|IFF_MULTICAST}) = 0
> > 14:50:53.887140 write(2, "ifplugd(usb0): upping interface\n",
> > 32ifplugd(usb0):
> > upping interface
> > ) = 32
> > 14:50:53.887584 gettimeofday({1471546253, 887734}, NULL) = 0
> > 14:50:53.888011 send(5, "<27>Aug 18 14:50:53 ifplugd(usb0"..., 52,
> > MSG_NOSIGNAL
> > ) = 52
> > 14:50:53.888431 ioctl(3, SIOCSIFFLAGS, {ifr_name="usb0", ???}) = -1
> ENODEV
> > (No
> > such device)
> > 14:50:53.895989 write(2, "ifplugd(usb0): setting interface"...,
> > 62ifplugd(usb0)
> > : setting interface flags failed: No such device
> > ) = 62
> >
> >
> > On Tue, Aug 16, 2016 at 7:52 PM, Denys Vlasenko <
> vda.linux@googlemail.com>
> > wrote:
> >>
> >> On Thu, Aug 11, 2016 at 5:21 PM, Jate Sujjavanich <jatedev@gmail.com>
> >> wrote:
> >> > The following changes since commit
> >> > 150dc7a2b483b8338a3e185c478b4b23ee884e71:
> >> >
> >> > ntpd: respond only to client and symmetric active packets
> (2016-08-01
> >> > 20:25:06 +0200)
> >> >
> >> > are available in the git repository at:
> >> >
> >> > https://github.com/jatedev/busybox work-ifplugd-device-detect
> >> >
> >> > for you to fetch changes up to a5d29d0cc0ff79214465a66fc8cd49
> 757bf72064:
> >> >
> >> > ifplugd: Allow ENODEV when upping interface for -M (2016-08-11
> >> > 11:09:21
> >> > -0400)
> >> >
> >> > ----------------------------------------------------------------
> >> > Jate Sujjavanich (1):
> >> > ifplugd: Allow ENODEV when upping interface for -M
> >> >
> >> > networking/ifplugd.c | 6 +++++-
> >> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/networking/ifplugd.c b/networking/ifplugd.c
> >> > index 28c49e2..67251ae 100644
> >> > --- a/networking/ifplugd.c
> >> > +++ b/networking/ifplugd.c
> >> > @@ -359,7 +359,11 @@ static void up_iface(void)
> >> > /* Let user know we mess up with interface */
> >> > bb_error_msg("upping interface");
> >> > if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting
> >> > interface flags") < 0)
> >> > - xfunc_die();
> >> > + if (errno == ENODEV) {
> >> > + G.iface_exists = 0;
> >> > + return;
> >> > + } else
> >> > + xfunc_die();
> >> > }
> >>
> >> This makes sense. But...
> >>
> >> set_ifreq_to_ifname(&ifrequest);
> >> if (network_ioctl(SIOCGIFFLAGS, &ifrequest, "getting interface
> >> flags") < 0) {
> >> G.iface_exists = 0;
> >> return;
> >> }
> >>
> >> if (!(ifrequest.ifr_flags & IFF_UP)) {
> >> ifrequest.ifr_flags |= IFF_UP;
> >> /* Let user know we mess up with interface */
> >> bb_error_msg("upping interface");
> >> if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting
> >> interface flags") < 0) {
> >>
> >>
> >>
> >> I just wonder, how on Earth SIOCGIFFLAGS just above did _not_ fail?
> >> The iface deletion race? Very tight, almost impossible to hit...
> >
> >
>
[Attachment #5 (text/html)]
<div dir="ltr">I was finally able to try out the commit in busybox master. The patch \
worked.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug \
19, 2016 at 9:40 AM, Denys Vlasenko <span dir="ltr"><<a \
href="mailto:vda.linux@googlemail.com" \
target="_blank">vda.linux@googlemail.com</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Fixed in git, please try it.<br> <div class="HOEnZb"><div \
class="h5"><br> On Thu, Aug 18, 2016 at 10:00 PM, Jate Sujjavanich <<a \
href="mailto:jatedev@gmail.com">jatedev@gmail.com</a>> wrote:<br> > I am able \
to reproduce the issue on my system consistently. I'm using<br> > modprobe to \
remove the driver for g_ether on my ARM system. Using strace<br> > reduces the \
frequency of the bug, but it still occurs.<br> ><br>
> Here's the output from strace:<br>
><br>
> 14:50:53.886676 ioctl(3, SIOCGIFFLAGS, {ifr_name="usb0",<br>
> ifr_flags=IFF_BROADCAS<br>
> T|IFF_MULTICAST}) = 0<br>
> 14:50:53.887140 write(2, "ifplugd(usb0): upping interface\n",<br>
> 32ifplugd(usb0):<br>
> upping interface<br>
> ) = 32<br>
> 14:50:53.887584 gettimeofday({1471546253, 887734}, NULL) = 0<br>
> 14:50:53.888011 send(5, "<27>Aug 18 14:50:53 ifplugd(usb0"..., \
52,<br> > MSG_NOSIGNAL<br>
> ) = 52<br>
> 14:50:53.888431 ioctl(3, SIOCSIFFLAGS, {ifr_name="usb0", ???}) = -1 \
ENODEV<br> > (No<br>
> such device)<br>
> 14:50:53.895989 write(2, "ifplugd(usb0): setting interface"...,<br>
> 62ifplugd(usb0)<br>
> : setting interface flags failed: No such device<br>
> ) = 62<br>
><br>
><br>
> On Tue, Aug 16, 2016 at 7:52 PM, Denys Vlasenko <<a \
href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a>><br> > \
wrote:<br> >><br>
>> On Thu, Aug 11, 2016 at 5:21 PM, Jate Sujjavanich <<a \
href="mailto:jatedev@gmail.com">jatedev@gmail.com</a>><br> >> wrote:<br>
>> > The following changes since commit<br>
>> > 150dc7a2b483b8338a3e185c478b4b<wbr>23ee884e71:<br>
>> ><br>
>> > ntpd: respond only to client and symmetric active packets \
(2016-08-01<br> >> > 20:25:06 +0200)<br>
>> ><br>
>> > are available in the git repository at:<br>
>> ><br>
>> > <a href="https://github.com/jatedev/busybox" rel="noreferrer" \
target="_blank">https://github.com/jatedev/<wbr>busybox</a> \
work-ifplugd-device-detect<br> >> ><br>
>> > for you to fetch changes up to \
a5d29d0cc0ff79214465a66fc8cd49<wbr>757bf72064:<br> >> ><br>
>> > ifplugd: Allow ENODEV when upping interface for -M (2016-08-11<br>
>> > 11:09:21<br>
>> > -0400)<br>
>> ><br>
>> > ------------------------------<wbr>------------------------------<wbr>----<br>
>> > Jate Sujjavanich (1):<br>
>> > ifplugd: Allow ENODEV when upping interface for -M<br>
>> ><br>
>> > networking/ifplugd.c | 6 +++++-<br>
>> > 1 file changed, 5 insertions(+), 1 deletion(-)<br>
>> ><br>
>> > diff --git a/networking/ifplugd.c b/networking/ifplugd.c<br>
>> > index 28c49e2..67251ae 100644<br>
>> > --- a/networking/ifplugd.c<br>
>> > +++ b/networking/ifplugd.c<br>
>> > @@ -359,7 +359,11 @@ static void up_iface(void)<br>
>> > /* Let user know we mess up with interface \
*/<br> >> > bb_error_msg("upping \
interface");<br> >> > if \
(network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting<br> >> > \
interface flags") < 0)<br> >> > - \
xfunc_die();<br> >> > + if (errno == \
ENODEV) {<br> >> > + \
G.iface_exists = 0;<br> >> > + \
return;<br> >> > + } else<br>
>> > + xfunc_die();<br>
>> > }<br>
>><br>
>> This makes sense. But...<br>
>><br>
>> set_ifreq_to_ifname(&<wbr>ifrequest);<br>
>> if (network_ioctl(SIOCGIFFLAGS, &ifrequest, "getting \
interface<br> >> flags") < 0) {<br>
>> G.iface_exists = 0;<br>
>> return;<br>
>> }<br>
>><br>
>> if (!(ifrequest.ifr_flags & IFF_UP)) {<br>
>> ifrequest.ifr_flags |= IFF_UP;<br>
>> /* Let user know we mess up with interface */<br>
>> bb_error_msg("upping interface");<br>
>> if (network_ioctl(SIOCSIFFLAGS, &ifrequest, \
"setting<br> >> interface flags") < 0) {<br>
>><br>
>><br>
>><br>
>> I just wonder, how on Earth SIOCGIFFLAGS just above did _not_ fail?<br>
>> The iface deletion race? Very tight, almost impossible to hit...<br>
><br>
><br>
</div></div></blockquote></div><br></div>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic