public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] dhcp fails on second ethernet port
@ 2007-10-18  9:39 Emmanuel.Coullien
  2007-10-19 14:40 ` Mike Arthur
  0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel.Coullien @ 2007-10-18  9:39 UTC (permalink / raw)
  To: dpaape; +Cc: ecos-discuss


Hello,

I find your mail below in the ecos-discuss and I got the same problem on an
ecosPRO 2.0.66.
My purpose is to initialize 2 Ethernet interfaces in a separate thread
because sometime one of them can be unplugged and then, we want to continue
the application on the plugged interface and, in the meantime, we want the
other one to wait until an ethernet link.
So that, I can't use init_all_network_interface().

Then I notice that :
- When the Eth0 (with static adress) is initialized before the second one
(with DHCP configuration), the DISCOVER packet never make it out onto the
wire.
- When the Eth0 (with static adress) is initialized after the second one
(with DHCP configuration), it works fine.
- When the 2 interfaces are initializes with static adress, it works fine.

we tryed a lot of other tests but we don't know how to avoid this problem.

Did you find a solution to solve your problem, and if so, is it possible to
share your solution ?

thank you and best regards,

Emmanuel Coullien



http://www.cygwin.com/ml/ecos-discuss/2007-07/msg00134.html


This is the mail archive of the ecos-discuss@sourceware.org mailing list
for the
eCos project.


---------------------------------------------------------------------------
-----
   Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
   Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
   Other format: [Raw text]

Re: dhcp fails on second ethernet port
a.. From: "Mike Arthur" <arth2219 at gmail dot com>
b.. To: "Daniel Paape" <dpaape at amtelco dot com>
c.. Cc: ecos-discuss at ecos dot sourceware dot org
d.. Date: Tue, 17 Jul 2007 10:53:32 -0500
e.. Subject: Re: [ECOS] dhcp fails on second ethernet port
f.. References:
<8D5709AC1061E8499884E0CD03B75CBF02071A70@MAIL1.amtelco.com>

---------------------------------------------------------------------------
-----
Daniel,


Do you have any problems with your eth0 dhcp & eth1 static
configuration when eth0's dhcp lease expires?

I am running eCosPro 2.0.51, with an in house HAL.  I have found that
if I ping flood eth0, it stops responding once its dhcp lease expires.
If I run with eth0 dhcp and eth1 disabled in my configuration, there
isn't an interruption when eth0's lease expires.

I am still trying to track down the source of this problem,
Mike


On 7/9/07, Daniel Paape <dpaape@amtelco.com> wrote:
Thank you Andrew...  I had been concentrating on the stack code.  I'll
take a closer look at the state machine.
Dan


-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: Sunday, July 08, 2007 1:37 PM
To: Daniel Paape
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] dhcp fails on second ethernet port

On Fri, Jul 06, 2007 at 11:36:21AM -0500, Daniel Paape wrote:
> Hello,
>
> I'm running eCos2.1 on a MIPS variant (w/ bsd_tcip) and am having some
trouble getting the second Ethernet port to configure via DHCP.? Both
ports are connected to the same switch.? Eth0 has a statically
configured (10.9.8.188) address while eth1 is set to configure from a
DHCP server providing 192.168.20.x addresses.? If I reverse the
assignments (eth0 DHCP & eth1 static) the ports work fine.? I am not
calling 'init_all_networks()' rather, I call (what I believe to be) the
common init code 'cyg_net_init()' and then by way of two threads each
associated with a specific port, " call 'dhcp_config(port)' or
'init_net("ethx", &bootp_data)'.
>
> When the second port attempts DHCP, the DISCOVER packets never make it
out onto the wire, which I believe is due to the variable 'isbcast' in
the 'ip_output routine evaluating to zero as a consequence of the
RTF_HOST flag being set.? It's as if -any- established route interferes
with subsequent DHCP configuration.
>
> Does anyone have any idea as to what might be occurring?

I think you are right about a route on the other interface causing
problems. Take a look at the state machine and the way it clears out
the routing tables when doing DHCP. It might be better to use
init_all_network interfaces().
Andrew


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

---------------------------------------------------------------------------
-----

a.. References:
 a.. RE: dhcp fails on second ethernet port
   a.. From: Daniel Paape
   Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
   Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]


--
J'utilise la version gratuíte de SPAMfighter pour utilisateurs privés.
Ce programme a supprimé22236 d'e-mails spam à ce jour.
Les utilisateurs qui paient n'ont pas ce message dans leurse-mails.
Obtenez la version gratuite de SPAMfighter ici:
http://www.spamfighter.com/lfr


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] dhcp fails on second ethernet port
  2007-10-18  9:39 [ECOS] dhcp fails on second ethernet port Emmanuel.Coullien
@ 2007-10-19 14:40 ` Mike Arthur
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Arthur @ 2007-10-19 14:40 UTC (permalink / raw)
  To: Emmanuel.Coullien; +Cc: dpaape, ecos-discuss

On 10/18/07, Emmanuel.Coullien@faiveleytransport.com
<Emmanuel.Coullien@faiveleytransport.com> wrote:
>
> Hello,
>
> I find your mail below in the ecos-discuss and I got the same problem on an
> ecosPRO 2.0.66.

Here is the solution to our problem with DHCP renewals:

Index: net/common/v2_0_51/src/dhcp_support.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/v2_0_51/src/dhcp_support.c,v
retrieving revision 1.2.10036.1
diff -u -5 -p -r1.2.10036.1 dhcp_support.c
--- net/common/v2_0_51/src/dhcp_support.c	9 Nov 2004 10:49:41 -0000	1.2.10036.1
+++ net/common/v2_0_51/src/dhcp_support.c	23 Aug 2007 15:24:33 -0000
@@ -111,15 +111,17 @@ int dhcp_bind( void )
         cyg_semaphore_init( &dhcp_needs_attention, 0 );

     // Run the state machine...
 #ifdef CYGHWR_NET_DRIVER_ETH0
     if (eth0_up
+        && 0 != eth0_dhcpstate
         && DHCPSTATE_FAILED != eth0_dhcpstate )
             eth0_up = do_dhcp(eth0_name, &eth0_bootp_data,
&eth0_dhcpstate, &eth0_lease);
 #endif
 #ifdef CYGHWR_NET_DRIVER_ETH1
     if (eth1_up
+        && 0 != eth1_dhcpstate
         && DHCPSTATE_FAILED != eth1_dhcpstate )
             eth1_up = do_dhcp(eth1_name, &eth1_bootp_data,
&eth1_dhcpstate, &eth1_lease);
 #endif

     // If the interface newly came up, initialize it:




> My purpose is to initialize 2 Ethernet interfaces in a separate thread
> because sometime one of them can be unplugged and then, we want to continue
> the application on the plugged interface and, in the meantime, we want the
> other one to wait until an ethernet link.
> So that, I can't use init_all_network_interface().
>
> Then I notice that :
> - When the Eth0 (with static adress) is initialized before the second one
> (with DHCP configuration), the DISCOVER packet never make it out onto the
> wire.
> - When the Eth0 (with static adress) is initialized after the second one
> (with DHCP configuration), it works fine.
> - When the 2 interfaces are initializes with static adress, it works fine.
>


You should search the eCosCentric bug tracker
(http://bugzilla.ecoscentric.com).  We found another bug with DHCP and
they supplied a huge patch.  If you have eCosPro you should be able to
search for the bug report.  If you don't find the bug report, try
submitting one.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] dhcp fails on second ethernet port
  2007-07-09 17:55 Daniel Paape
@ 2007-07-17 15:53 ` Mike Arthur
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Arthur @ 2007-07-17 15:53 UTC (permalink / raw)
  To: Daniel Paape; +Cc: ecos-discuss

Daniel,

Do you have any problems with your eth0 dhcp & eth1 static
configuration when eth0's dhcp lease expires?

I am running eCosPro 2.0.51, with an in house HAL.  I have found that
if I ping flood eth0, it stops responding once its dhcp lease expires.
 If I run with eth0 dhcp and eth1 disabled in my configuration, there
isn't an interruption when eth0's lease expires.

I am still trying to track down the source of this problem,
Mike



On 7/9/07, Daniel Paape <dpaape@amtelco.com> wrote:
> Thank you Andrew...  I had been concentrating on the stack code.  I'll
> take a closer look at the state machine.
>
> Dan
>
> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Sunday, July 08, 2007 1:37 PM
> To: Daniel Paape
> Cc: ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] dhcp fails on second ethernet port
>
> On Fri, Jul 06, 2007 at 11:36:21AM -0500, Daniel Paape wrote:
> > Hello,
> >
> > I'm running eCos2.1 on a MIPS variant (w/ bsd_tcip) and am having some
> trouble getting the second Ethernet port to configure via DHCP.? Both
> ports are connected to the same switch.? Eth0 has a statically
> configured (10.9.8.188) address while eth1 is set to configure from a
> DHCP server providing 192.168.20.x addresses.? If I reverse the
> assignments (eth0 DHCP & eth1 static) the ports work fine.? I am not
> calling 'init_all_networks()' rather, I call (what I believe to be) the
> common init code 'cyg_net_init()' and then by way of two threads each
> associated with a specific port, " call 'dhcp_config(port)' or
> 'init_net("ethx", &bootp_data)'.
> >
> > When the second port attempts DHCP, the DISCOVER packets never make it
> out onto the wire, which I believe is due to the variable 'isbcast' in
> the 'ip_output routine evaluating to zero as a consequence of the
> RTF_HOST flag being set.? It's as if -any- established route interferes
> with subsequent DHCP configuration.
> >
> > Does anyone have any idea as to what might be occurring?
>
> I think you are right about a route on the other interface causing
> problems. Take a look at the state machine and the way it clears out
> the routing tables when doing DHCP. It might be better to use
> init_all_network interfaces().
>
>        Andrew
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* RE: [ECOS] dhcp fails on second ethernet port
@ 2007-07-09 17:55 Daniel Paape
  2007-07-17 15:53 ` Mike Arthur
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Paape @ 2007-07-09 17:55 UTC (permalink / raw)
  To: ecos-discuss

Thank you Andrew...  I had been concentrating on the stack code.  I'll
take a closer look at the state machine.

Dan

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch] 
Sent: Sunday, July 08, 2007 1:37 PM
To: Daniel Paape
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] dhcp fails on second ethernet port

On Fri, Jul 06, 2007 at 11:36:21AM -0500, Daniel Paape wrote:
> Hello,
> 
> I'm running eCos2.1 on a MIPS variant (w/ bsd_tcip) and am having some
trouble getting the second Ethernet port to configure via DHCP.? Both
ports are connected to the same switch.? Eth0 has a statically
configured (10.9.8.188) address while eth1 is set to configure from a
DHCP server providing 192.168.20.x addresses.? If I reverse the
assignments (eth0 DHCP & eth1 static) the ports work fine.? I am not
calling 'init_all_networks()' rather, I call (what I believe to be) the
common init code 'cyg_net_init()' and then by way of two threads each
associated with a specific port, " call 'dhcp_config(port)' or
'init_net("ethx", &bootp_data)'.
> 
> When the second port attempts DHCP, the DISCOVER packets never make it
out onto the wire, which I believe is due to the variable 'isbcast' in
the 'ip_output routine evaluating to zero as a consequence of the
RTF_HOST flag being set.? It's as if -any- established route interferes
with subsequent DHCP configuration.
> 
> Does anyone have any idea as to what might be occurring?

I think you are right about a route on the other interface causing
problems. Take a look at the state machine and the way it clears out
the routing tables when doing DHCP. It might be better to use
init_all_network interfaces().

       Andrew

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] dhcp fails on second ethernet port
  2007-07-06 16:35 Daniel Paape
@ 2007-07-08 18:37 ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2007-07-08 18:37 UTC (permalink / raw)
  To: Daniel Paape; +Cc: ecos-discuss

On Fri, Jul 06, 2007 at 11:36:21AM -0500, Daniel Paape wrote:
> Hello,
> 
> I'm running eCos2.1 on a MIPS variant (w/ bsd_tcip) and am having some trouble getting the second Ethernet port to configure via DHCP.? Both ports are connected to the same switch.? Eth0 has a statically configured (10.9.8.188) address while eth1 is set to configure from a DHCP server providing 192.168.20.x addresses.? If I reverse the assignments (eth0 DHCP & eth1 static) the ports work fine.? I am not calling 'init_all_networks()' rather, I call (what I believe to be) the common init code 'cyg_net_init()' and then by way of two threads each associated with a specific port, " call 'dhcp_config(port)' or 'init_net("ethx", &bootp_data)'.
> 
> When the second port attempts DHCP, the DISCOVER packets never make it out onto the wire, which I believe is due to the variable 'isbcast' in the 'ip_output routine evaluating to zero as a consequence of the RTF_HOST flag being set.? It's as if -any- established route interferes with subsequent DHCP configuration.
> 
> Does anyone have any idea as to what might be occurring?

I think you are right about a route on the other interface causing
problems. Take a look at the state machine and the way it clears out
the routing tables when doing DHCP. It might be better to use
init_all_network interfaces().

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS] dhcp fails on second ethernet port
@ 2007-07-06 16:35 Daniel Paape
  2007-07-08 18:37 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Paape @ 2007-07-06 16:35 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I'm running eCos2.1 on a MIPS variant (w/ bsd_tcip) and am having some trouble getting the second Ethernet port to configure via DHCP.  Both ports are connected to the same switch.  Eth0 has a statically configured (10.9.8.188) address while eth1 is set to configure from a DHCP server providing 192.168.20.x addresses.  If I reverse the assignments (eth0 DHCP & eth1 static) the ports work fine.  I am not calling 'init_all_networks()' rather, I call (what I believe to be) the common init code 'cyg_net_init()' and then by way of two threads each associated with a specific port, " call 'dhcp_config(port)' or 'init_net("ethx", &bootp_data)'.

When the second port attempts DHCP, the DISCOVER packets never make it out onto the wire, which I believe is due to the variable 'isbcast' in the 'ip_output routine evaluating to zero as a consequence of the RTF_HOST flag being set.  It's as if -any- established route interferes with subsequent DHCP configuration.

Does anyone have any idea as to what might be occurring?


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2007-10-19 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18  9:39 [ECOS] dhcp fails on second ethernet port Emmanuel.Coullien
2007-10-19 14:40 ` Mike Arthur
  -- strict thread matches above, loose matches on Subject: below --
2007-07-09 17:55 Daniel Paape
2007-07-17 15:53 ` Mike Arthur
2007-07-06 16:35 Daniel Paape
2007-07-08 18:37 ` Andrew Lunn

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 read-only IMAP folder(s) and NNTP newsgroup(s).