Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DHCP retrying not fully implemented

 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
AndyShissler



Joined: 22 Oct 2010
Posts: 11
Location: Pennsylvania

PostPosted: Tue Nov 30, 2010 6:28 pm    Post subject: Reply with quote

I added the "disable_config=true" and it performed the auto config on the next reboot. I received a message about the network settings being changed. I viewed the Network Preferences and it states "eth0" and "Yes" for the Enabled column. I set the type to DHCP. I've rebooted and checked the Network Preferences again and they're the same. However, I don't think the Ethernet is working. The PING command has the message "Network is unreachable". Is there a way to find out the IP address negotiated by DHCP?


Here's the kernel log:

1:init::init(-1) : eepro100: Intel EtherExpress Pro 10/100 NIC driver v0.2
based on Linux driver by Donald Becker et al., port by Michael Krueger
1:init::init(-1) : eepro100: Intel i82557 PCI Speedo found at I/O 0x1000, IRQ 10.
1:init::init(-1) : PCI latency timer (CFLT) is 0x20.
1:init::init(-1) : eepro100: OEM i82557/i82558 10/100 Ethernet, I/O at 0x1000, IRQ 10.
1:init::init(-1) : 00:1:init::init(-1) : 19:1:init::init(-1) : D1:1:init::init(-1) : 54:1:init::init(-1) : 0D:1:init::init(-1) : DD: 1:init::init(-1) : Board assembly 0011ff-255, Physical connectors present:1:init::init(-1) : RJ451:init::init(-1) :
Primary interface chip i82555 PHY #1.
1:init::init(-1) : General self-test: passed.
Serial sub-system self-test: passed.
Internal registers self-test: passed.
ROM checksum self-test: passed (0xed626fe2).

1:init::init(-1) : OEM i82557/i82558 10/100 Ethernet: speedo_open() irq 10.
1:init::init(-1) : OEM i82557/i82558 10/100 Ethernet: Done speedo_open(), status 00000090.

0:kernel::ata_cmd_thread : OEM i82557/i82558 10/100 Ethernet: Link status change.
0:kernel::ata_cmd_thread : OEM i82557/i82558 10/100 Ethernet: Old partner 0, new cde1, adv 5e1.
0:kernel::ata_cmd_thread : OEM i82557/i82558 10/100 Ethernet: Sending a multicast list set command from a timer routine.

1:ifconfig::ifconfig : OEM i82557/i82558 10/100 Ethernet: Shutting down ethercard, status was 0050.
1:ifconfig::ifconfig : Error: release_irq() invalid handler 10/0
Enabling interface eth0

1:dhcpc::dhcpc : OEM i82557/i82558 10/100 Ethernet: speedo_open() irq 10.
1:dhcpc::dhcpc : OEM i82557/i82558 10/100 Ethernet: Done speedo_open(), status 00000090.
1:ls::ls : Device /boot/system/drivers/dev/battery on bus acpi is disabled
1:sh-host::sh-host(-1) : ... boot shell finished
0:kernel::idle_00 : OEM i82557/i82558 10/100 Ethernet: Link status change.
0:kernel::idle_00 : OEM i82557/i82558 10/100 Ethernet: Old partner 0, new cde1, adv 5e1.
0:kernel::idle_00 : OEM i82557/i82558 10/100 Ethernet: Sending a multicast list set command from a timer routine.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Tue Nov 30, 2010 7:23 pm    Post subject: Reply with quote

That looks like it works, but in the Network Preferences, did you set the gateway, to eth0?

You can see the IP number and other info from the terminal with the command

ifconfig

What was the exact code that you added to the driver?
Back to top
View user's profile Send private message Visit poster's website
AndyShissler



Joined: 22 Oct 2010
Posts: 11
Location: Pennsylvania

PostPosted: Wed Dec 01, 2010 7:47 pm    Post subject: Reply with quote

I did set the gateway to eth0.

Here's the results from IFCONFIG:

loopback : < up, loopback, broadcast, running, no ARP >
IP: 127.0.0.1 Netmask: 255.0.0.0 Remote: <n/a>

eth0 : < up, broadcast, running, ARP >
IP: 0.0.0.0 Netmask: 255.255.255.255 Remote: <n/a>
Hardware Address: 00:19:D1:54:0D:DD MTU: 1500

It should have detected the DHCP server on my router at 192.168.1.0.

I just added an extra ID of 0x1094 in the array of device ID's. If need be, I'll post the exact code change in another post.

It appears the DHCP client on Syllable is running. Here's my DHCP log:

main : 1 interfaces to configure
dhcp_run : configuring interface eth0
bringup_interface : checking interface eth0
bringup_interface : bringing up interface eth0
get_mac_address : looking up hardware address of interface eth0
get_mac_address : MAC address for interface eth0 is 00:19:d1:54:0d:dd
setup_sockets : forcing packets via interface eth0
dhcp_init : using dhcp_sessions[0], pid = 45
dhcp_start : starting DHCP client
change_state : changing state to 0x01
state_init : lease time is now: 3600
setoptions : type = 0x35
setoptions : value = 1
setoptions : type = 0x33
setoptions : value = 0
setoptions : type = 0x37
setoptions : value = 0
setoptions : type = 0x3d
setoptions : value = 0
setoptions : type = 0xff
setoptions : value = 0
freeoptions : freeing option data
freeoptions : freeing option data
freeoptions : freeing option data
state_init : xid for this packet is 677CB56A
state_init : secs for this packet is 0
state_init : DHCPDISCOVER packet sent.
change_state : changing state to 0x02
sighandle : received signal 14 for process #45
state_selecting : timeout after 60 seconds waiting for response
change_state : changing state to 0x01
dhcp_start : shutting down state machine
main : waiting for 1 children.
main : parent exiting
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Wed Dec 01, 2010 9:38 pm    Post subject: Reply with quote

That does seem to be a problem with DHCP. Have you tried several times?

The problem with our DHCP implementation is that it doesn't retry when it gets no response to its DHCPDISCOVER request. So it doesn't work if the networking situation isn't ideal.

Retrying shouldn't be hard to add to the code, though.
Back to top
View user's profile Send private message Visit poster's website
AndyShissler



Joined: 22 Oct 2010
Posts: 11
Location: Pennsylvania

PostPosted: Wed Dec 08, 2010 2:49 pm    Post subject: Reply with quote

I looked at the DHCP code and the retry mechanism is there. After further examination in the logs, I found this message in the DHCP log:

sighandle : received signal 14 for process #46

The DHCP never retried because it was told to shutdown.

Unfortunately, I have yet to track down the source of the sighandle.
Not sure if it has to do with this message in the kernel log:

0:ifconfig::ifconfig : OEM i82557/i82558 10/100 Ethernet: Shutting down ethercard, status was 0050.

I did find a message in SysLog stating that it can't find /var/run/inetd.pid. Not sure if that relates.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Wed Dec 08, 2010 3:14 pm    Post subject: Reply with quote

Hm, when we discussed these failures at the time, Kristian said it doesn't retry. Oh well, better if the code is already there.

The card shutdown could be related, but it could also be the result of being unable to obtain an IP address.

The inetd.pid is not related. INetD is a service at a higher level in the networking.
Back to top
View user's profile Send private message Visit poster's website
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Sat Dec 11, 2010 9:16 am    Post subject: Reply with quote

Signal #14 is SIGALRM. In this specific instance the alarm is a timeout because no response was received:

sighandle : received signal 14 for process #45
state_selecting : timeout after 60 seconds waiting for response

You're right that half the retry code is there, but it's buggy. First of all RESPONSE_TIMEOUT is still set to 60 seconds (dhcp.h), which should be reduced to E.g. 10

Secondly sighandle() causes a shutdown if the client isn't running:

1773 if( ( session->t2_state != TIMER_RUNNING ) &&
1774 ( session->t3_state != TIMER_RUNNING ))
1775 session->do_shutdown=true;

I'd suggest trying something like:

dhcp.h

#define RESPONSE_TIMEOUT 10
#define ATTEMPT_LIMIT 5

dhcp.c, sighandle():

if( (( session->t2_state != TIMER_RUNNING ) && ( session->t3_state != TIMER_RUNNING )) && ( session->attempts < ATTEMPT_LIMIT ) )
{
session->do_shutdown=true;
}
Back to top
View user's profile Send private message Send e-mail
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Sat Dec 11, 2010 10:41 am    Post subject: Reply with quote

Hey, are you back? Smile
Back to top
View user's profile Send private message Visit poster's website
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Sat Dec 11, 2010 2:28 pm    Post subject: Reply with quote

I split this topic.
Back to top
View user's profile Send private message Visit poster's website
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Sat Dec 11, 2010 4:11 pm    Post subject: Reply with quote

> Hey, are you back? :-)

Well, I wouldn't get too excited, but I'm trying to keep an eye on things now and again. I don't really have the time or the energy to commit to anything.
Back to top
View user's profile Send private message Send e-mail
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Sat Dec 11, 2010 5:57 pm    Post subject: Reply with quote

Cool anyway. It's good to know you're there in the background. Smile I hope things are going alright.
Back to top
View user's profile Send private message Visit poster's website
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Sun Dec 12, 2010 6:23 am    Post subject: Reply with quote

Good to hear from you Vanders, hope all's well!
Back to top
View user's profile Send private message Visit poster's website
doneill



Joined: 16 Oct 2009
Posts: 40

PostPosted: Wed Dec 15, 2010 3:52 am    Post subject: Reply with quote

so the card is ifdown'ing()?
Back to top
View user's profile Send private message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Fri Dec 17, 2010 9:06 am    Post subject: Reply with quote

Not really. The DHCP client is sending one DHCPDISCOVER packet, waiting 60 seconds and shutting down. If you see my post above it explains why the DHCP client is not properly retrying.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group