Opened 14 years ago

Last modified 11 years ago

#7040 closed bug

[net_server] interface stops working after turning it off and on — at Version 4

Reported by: diver Owned by: axeld
Priority: normal Milestone: R1
Component: Servers/net_server Version: R1/Development
Keywords: Cc: shade, mmlr
Blocked By: Blocking:
Platform: All

Description (last modified by diver)

This is hrev39980, gcc4hybrid in VirtualBox 3.0.12 and 4.0.

After disabling/enabling network interface in Network preflet or deletion/creation it via ifconfig it doesn't obtain correct ip via DHCP anymore. Static mode doesn't work as well. Errors counter in ifconfig continues registering errors.

Default and working DHCP settings from VirtualBox:

~> ifconfig /dev/net/ipro1000/0
/dev/net/ipro1000/0
        Hardware type: Ethernet, Address: 08:00:27:c7:d8:5b
        Media type: 1 GBit, 1000BASE-T
        inet addr: 10.0.2.15, Bcast: 10.255.255.255, Mask: 255.255.255.0
        MTU: 1500, Metric: 0, up broadcast link auto-configured
        Receive: 4 packets, 0 errors, 1300 bytes, 0 mcasts, 0 dropped
        Transmit: 2 packets, 0 errors, 606 bytes, 0 mcasts, 0 dropped
        Collisions: 0

~> ifconfig del /dev/net/ipro1000/0 
~> ifconfig /dev/net/ipro1000/0 auto-config up
~> ifconfig /dev/net/ipro1000/0
/dev/net/ipro1000/0
        Hardware type: Ethernet, Address: 08:00:27:c7:d8:5b
        Media type: 1 GBit, 1000BASE-T
        inet addr: , Bcast: , Mask: 
        MTU: 1500, Metric: 0, up broadcast link
        Receive: 4 packets, 344 errors, 1300 bytes, 0 mcasts, 0 dropped
        Transmit: 2 packets, 0 errors, 606 bytes, 0 mcasts, 0 dropped
        Collisions: 0


After about 1 minute:

~> ifconfig /dev/net/ipro1000/0
        Hardware type: Ethernet, Address: 08:00:27:c7:d8:5b
        Media type: 1 GBit, 1000BASE-T
        inet addr: 169.254.0.107, Bcast: 169.254.255.255, Mask: 255.255.0.0
        MTU: 1500, Metric: 0, up broadcast link auto-configured
        Receive: 4 packets, 25670 errors, 1300 bytes, 0 mcasts, 0 dropped
        Transmit: 11 packets, 0 errors, 3279 bytes, 0 mcasts, 0 dropped
        Collisions: 0


syslog part:

KERN: [net/ipro1000/0] compat_close()
KERN: [net/ipro1000/0] compat_free()
KERN: [net/ipro1000/0] compat_open(0x2)
KERN: printf(`ifmedia_ioctl: switching %s to ',...)
KERN: printf(`Ethernet',...)
KERN: printf(` %s',...)
KERN: printf(`%s
KERN: ',...)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 4 secs (try 0)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 8 secs (try 0)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 2 secs (try 1)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 4 secs (try 1)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 8 secs (try 1)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 2 secs (try 2)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 4 secs (try 2)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP timeout shift for /dev/net/ipro1000/0: 8 secs (try 2)
DAEMON 'DHCP': DHCP send message DHCP_DISCOVER for /dev/net/ipro1000/0
DAEMON 'DHCP': DHCP for /dev/net/ipro1000/0, status: Operation timed out

Change History (9)

by diver, 14 years ago

Attachment: default_settings.png added

by diver, 14 years ago

Attachment: bogus_settings.png added

by diver, 14 years ago

Attachment: private_ip.png added

comment:1 by diver, 14 years ago

Still here in hrev41752.

comment:2 by diver, 12 years ago

Cc: shade added

Still present in hrev45428. Some notes, though:

after ifconfig del net_server can't bring up the interface:

ifconfig del /dev/net/ipro1000/0 
ifconfig /dev/net/ipro1000/0 up
ifconfig: Couldn't add interface: General system error 

removing /system/add-ons/kernel/network/protocols/ipv6 module workarounds this new issue.

For some reason deleting an interface leaves it in net_device_interface list:

ifconfig del /dev/net/ipro1000/0

As can be seen the net_device_interface is ref counted and obviously doesn't reach 0.

That may be the reason why neither DHCP nor static work.

ifconfig /dev/net/ipro1000/0 auto-config up
[...]
DHCP failed miserably!
DAEMON 'DHCP': DHCP for /dev/net/ipro1000/0, status: Operation timed out 
Last edited 12 years ago by diver (previous) (diff)

comment:3 by diver, 12 years ago

ifconfig up (after del) works until the interface is configured. Maybe hrev43721 is somehow related to it.

Also:

<mmlr_thinkpad> actually the preflet uses ioctls directly while ifconfig simply uses BNetworkInterfaceAddress 
<mmlr_thinkpad> and the latter simply handles the case of not having any address 
<mmlr_thinkpad> so the preflet should be reworked to use the API as well, instead of trying to do ioctls directly

comment:4 by diver, 12 years ago

Description: modified (diff)
Summary: [net_server] DHCP doesn't work after interface deletion[net_server] interface stops working after turning it off and on
Note: See TracTickets for help on using tickets.