Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Lucas Nussbaum <lucas <at> lucas-nussbaum.net>
Subject: Bug#414176: more information on WOL and sysvinit
Newsgroups: gmane.linux.debian.devel.sysvinit
Date: Thursday 6th March 2008 16:53:19 UTC (over 8 years ago)
Hi,

I actually have the opposite problem with my r8169:
- if the interface is left up during shutdown, WOL works.
- if the interface is down during shutdown, WOL doesn't work.
But that's a driver problem, of course.

After commenting out the ifdown call in /etc/init.d/networking, the
interface wasn't shut down anymore during shutdown. Which is strange,
because halt should have shut it down. So WOL worked for me, while it
shouldn't!

The reason for that is 21_ifdown_kfreebsd.dpatch, a debian-specific
patch (which explains why recompiling by hand "fixes" the problem).

The patch does this:
    if (ifr[i].FLAGS & IFF_UP) {
            ifr[i].FLAGS &= ~(IFF_UP);
            if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {
                    fprintf(stderr, "ifdown: shutdown ");
                    perror(ifr[i].ifr_name);
            }
    }

The problem is that ifr[i].FLAGS doesn't include IFF_UP, even if the
interface
is still UP, as seen by ifconfig. So the ioctl is never performed.

I don't understand why that's the case. Maybe SIOCGIFCONF has strange
semantics? (I haven't checked)

Simple solution: revert to pre-patch behaviour, ie simply remove the
  if (ifr[i].FLAGS & IFF_UP) {
So the ioctl is done even if IFF_UP is not set.

Attached is my hacked-up dirty patch to understand the problem.
-- 
| Lucas Nussbaum
| [email protected]   http://www.lucas-nussbaum.net/ |
| jabber: [email protected]             GPG: 1024D/023B3F4F |
 
CD: 3ms