public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Multiple network interface & routing question
@ 2007-10-09 11:24 Will Wagner
  2007-10-09 11:53 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Will Wagner @ 2007-10-09 11:24 UTC (permalink / raw)
  To: ecos-discuss

Hi All,

I'm using the bsd sockets code and I have more than one interface. I am 
seeing that when one interface has to reget an address via dhcp then I 
get problems using the other interface.

Looking through the code it appears there might me a problem with the 
routing table. The dhcp code calls cyg_route_reinit() in a couple of 
places - do_dhcp_down_net() and bring_half_up() which are called whilst 
obtaining an address. The cyg_route_reinit() function seems to just 
empty the routing table regardless of interface.

Could this be my problem or am I looking in the wrong place? Anyone got 
any code for removing all routes for a specific interface only?

Thanks,

Will.
-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Senior Project Engineer                  Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------



-- 
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] 4+ messages in thread

* Re: [ECOS] Multiple network interface & routing question
  2007-10-09 11:24 [ECOS] Multiple network interface & routing question Will Wagner
@ 2007-10-09 11:53 ` Andrew Lunn
  2007-10-09 12:00   ` Will Wagner
  2007-10-09 16:40   ` Will Wagner
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Lunn @ 2007-10-09 11:53 UTC (permalink / raw)
  To: Will Wagner; +Cc: ecos-discuss

On Tue, Oct 09, 2007 at 12:25:42PM +0100, Will Wagner wrote:
> Hi All,
>
> I'm using the bsd sockets code and I have more than one interface. I am 
> seeing that when one interface has to reget an address via dhcp then I get 
> problems using the other interface.
>
> Looking through the code it appears there might me a problem with the 
> routing table. The dhcp code calls cyg_route_reinit() in a couple of places 
> - do_dhcp_down_net() and bring_half_up() which are called whilst obtaining 
> an address. The cyg_route_reinit() function seems to just empty the routing 
> table regardless of interface.
>
> Could this be my problem or am I looking in the wrong place? Anyone got any 
> code for removing all routes for a specific interface only?

There is a patch for that somewhere in ecos-patches, probably in the
last year. Although it looked O.K. i was not convinced it would work
in all situations. Why did the original author of the DHCP client not
do something similar?. I don't have a dual interface device so i
cannot test. So i would be interested in your comments about the
patch.

        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] 4+ messages in thread

* Re: [ECOS] Multiple network interface & routing question
  2007-10-09 11:53 ` Andrew Lunn
@ 2007-10-09 12:00   ` Will Wagner
  2007-10-09 16:40   ` Will Wagner
  1 sibling, 0 replies; 4+ messages in thread
From: Will Wagner @ 2007-10-09 12:00 UTC (permalink / raw)
  To: ecos-discuss

Thanks,

It looks reasonable, I'll give it a try.

Will.

Andrew Lunn wrote:
> On Tue, Oct 09, 2007 at 12:25:42PM +0100, Will Wagner wrote:
>> Hi All,
>>
>> I'm using the bsd sockets code and I have more than one interface. I am 
>> seeing that when one interface has to reget an address via dhcp then I get 
>> problems using the other interface.
>>
>> Looking through the code it appears there might me a problem with the 
>> routing table. The dhcp code calls cyg_route_reinit() in a couple of places 
>> - do_dhcp_down_net() and bring_half_up() which are called whilst obtaining 
>> an address. The cyg_route_reinit() function seems to just empty the routing 
>> table regardless of interface.
>>
>> Could this be my problem or am I looking in the wrong place? Anyone got any 
>> code for removing all routes for a specific interface only?
> 
> There is a patch for that somewhere in ecos-patches, probably in the
> last year. Although it looked O.K. i was not convinced it would work
> in all situations. Why did the original author of the DHCP client not
> do something similar?. I don't have a dual interface device so i
> cannot test. So i would be interested in your comments about the
> patch.
> 
>         Andrew

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Senior Project Engineer                  Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------



-- 
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] 4+ messages in thread

* Re: [ECOS] Multiple network interface & routing question
  2007-10-09 11:53 ` Andrew Lunn
  2007-10-09 12:00   ` Will Wagner
@ 2007-10-09 16:40   ` Will Wagner
  1 sibling, 0 replies; 4+ messages in thread
From: Will Wagner @ 2007-10-09 16:40 UTC (permalink / raw)
  To: ecos-discuss

This patch fixed my issue, thanks Andrew.

Looking at the code I think it is correct as well. Whoever originally 
added the cyg_route_reinit() function knew it wasn't ideal as there is 
this comment:

// FIXME: This function is only here because BOOTP fails on a second 
interface.
//        This failure is due to the fact that a route to 0.0.0.0 seems 
to be
//        incredibly sticky, i.e. can't be deleted.  BOOTP uses this to
//        achieve a generic broadcast.  Sadly it seems that BOOTP 
servers will
//        only work this way, thus the hack.
//
//        This version enumerates all IPv4 routes and deletes them - 
this leaks less
//        store than the previous version.

The patch does the same thing I think, it just only deletes IPv4 routes 
for a specific interface.

Will.

Andrew Lunn wrote:
> On Tue, Oct 09, 2007 at 12:25:42PM +0100, Will Wagner wrote:
>> Hi All,
>>
>> I'm using the bsd sockets code and I have more than one interface. I am 
>> seeing that when one interface has to reget an address via dhcp then I get 
>> problems using the other interface.
>>
>> Looking through the code it appears there might me a problem with the 
>> routing table. The dhcp code calls cyg_route_reinit() in a couple of places 
>> - do_dhcp_down_net() and bring_half_up() which are called whilst obtaining 
>> an address. The cyg_route_reinit() function seems to just empty the routing 
>> table regardless of interface.
>>
>> Could this be my problem or am I looking in the wrong place? Anyone got any 
>> code for removing all routes for a specific interface only?
> 
> There is a patch for that somewhere in ecos-patches, probably in the
> last year. Although it looked O.K. i was not convinced it would work
> in all situations. Why did the original author of the DHCP client not
> do something similar?. I don't have a dual interface device so i
> cannot test. So i would be interested in your comments about the
> patch.
> 
>         Andrew
> 

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Senior Project Engineer                  Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------



-- 
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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-09 11:24 [ECOS] Multiple network interface & routing question Will Wagner
2007-10-09 11:53 ` Andrew Lunn
2007-10-09 12:00   ` Will Wagner
2007-10-09 16:40   ` Will Wagner

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).