* Re: [ECOS] connect() to machine outside local network [not found] <396CAA52.A429F2C6@berger.to> @ 2000-07-14 4:37 ` Nick Barnes 2000-07-14 5:30 ` Hugo 'NOx' Tyson 0 siblings, 1 reply; 11+ messages in thread From: Nick Barnes @ 2000-07-14 4:37 UTC (permalink / raw) To: Cedric Berger; +Cc: ecos-discuss It seems to me that build_bootp_record() in network_support.c should add_tag(vp, TAG_GATEWAY, ...) and that its failure to do so could account for my problems here. This from single stepping through most of init_all_network_interfaces(). nick B At 2000-07-12 17:26:43+0000, Cedric Berger writes: > That may mean that your default gateway is *not* on your local subnet. > > Cedric > > > Nick Barnes wrote: > > > At 2000-07-12 14:36:47+0000, Nick Barnes writes: > > > connect() works OK for local machines but gives me EHOSTUNREACH > > > outside the local network. > > > > After some single-stepping in the TCP/IP stack, I think this is an > > eCos problem, not a problem with my local network. rtalloc() inside > > ip_output() is returning 0. > > > > I don't have a clear understanding of the route datastructures (in > > route.c and radix.c), but I can do more single-stepping if that would > > help. > > > > Nick B > > > > -- > > FreeBSD 2.2.8-RELEASE: up 10 days, 21:57 > > Last reboot due to lightning strike. > > -- FreeBSD 2.2.8-RELEASE: up 12 days, 17:24 last reboot Sat Jul 1 19:26 (lightning strike) ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 4:37 ` [ECOS] connect() to machine outside local network Nick Barnes @ 2000-07-14 5:30 ` Hugo 'NOx' Tyson 2000-07-14 5:34 ` Nick Barnes ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Hugo 'NOx' Tyson @ 2000-07-14 5:30 UTC (permalink / raw) To: ecos-discuss Nick Barnes <Nick.Barnes@pobox.com> writes: > It seems to me that build_bootp_record() in network_support.c should > > add_tag(vp, TAG_GATEWAY, ...) > > and that its failure to do so could account for my problems here. > > This from single stepping through most of init_all_network_interfaces(). This is if it's statically configured, right? You're right, that makes perfect sense, I'll see to it. BTW, full DHCP coming real soon... - Huge > At 2000-07-12 17:26:43+0000, Cedric Berger writes: > > That may mean that your default gateway is *not* on your local subnet. > > Nick Barnes wrote: > > > > > At 2000-07-12 14:36:47+0000, Nick Barnes writes: > > > > connect() works OK for local machines but gives me EHOSTUNREACH > > > > outside the local network. > > > > > > After some single-stepping in the TCP/IP stack, I think this is an > > > eCos problem, not a problem with my local network. rtalloc() inside > > > ip_output() is returning 0. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 5:30 ` Hugo 'NOx' Tyson @ 2000-07-14 5:34 ` Nick Barnes 2000-07-14 5:39 ` Andrew Lunn 2000-07-14 6:37 ` Nick Barnes 2 siblings, 0 replies; 11+ messages in thread From: Nick Barnes @ 2000-07-14 5:34 UTC (permalink / raw) To: ecos-discuss At 2000-07-14 12:19:33+0000, "Hugo 'NOx' Tyson" writes: > > Nick Barnes <Nick.Barnes@pobox.com> writes: > > It seems to me that build_bootp_record() in network_support.c should > > > > add_tag(vp, TAG_GATEWAY, ...) > > > > and that its failure to do so could account for my problems here. > > > > This from single stepping through most of init_all_network_interfaces(). > > This is if it's statically configured, right? You're right, that makes > perfect sense, I'll see to it. BTW, full DHCP coming real soon... Yes, statically configured. I've made the change locally, but can't test it right now for unrelated reasons. Nick B -- FreeBSD 2.2.8-RELEASE: up 12 days, 18:21 last reboot Sat Jul 1 19:26 (lightning strike) ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 5:30 ` Hugo 'NOx' Tyson 2000-07-14 5:34 ` Nick Barnes @ 2000-07-14 5:39 ` Andrew Lunn 2000-07-14 8:45 ` Hugo 'NOx' Tyson 2000-07-14 6:37 ` Nick Barnes 2 siblings, 1 reply; 11+ messages in thread From: Andrew Lunn @ 2000-07-14 5:39 UTC (permalink / raw) To: ecos-discuss > This is if it's statically configured, right? You're right, that makes > perfect sense, I'll see to it. BTW, full DHCP coming real soon... When DHCP will be added will you re-evaluate the way you bring interfaces up. Its currently a bit messy if you want to pass your own addresses in the bootp record. The function build_bootp_record() is not exported either. Also when you added loopback devices i was not configuring them since you added init_loopback_interface() to init_all_network_interfaces() which did't need to call when using dynamic addresses. Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 5:39 ` Andrew Lunn @ 2000-07-14 8:45 ` Hugo 'NOx' Tyson 2000-07-14 9:17 ` Andrew Lunn 0 siblings, 1 reply; 11+ messages in thread From: Hugo 'NOx' Tyson @ 2000-07-14 8:45 UTC (permalink / raw) To: ecos-discuss andrew.lunn@ascom.ch (Andrew Lunn) writes: > > This is if it's statically configured, right? You're right, that makes > > perfect sense, I'll see to it. BTW, full DHCP coming real soon... > > When DHCP will be added will you re-evaluate the way you bring > interfaces up. > Its currently a bit messy if you want to pass your own addresses in the > bootp record. The function build_bootp_record() is not exported either. It is now. ;-) But the bootp record is published and RFC'd structure, you can initialize it however you like. > Also when you added loopback devices i was not > configuring them since you added init_loopback_interface() to > init_all_network_interfaces() which did't need to call when using > dynamic addresses. So, if you're not using init_all_network_interfaces(), then your code must do all the work, including calling init_loopback_interface() if you want one. Ah, but init_loopback_interface() is not exported, that's what you mean. OK, I'll do that too. It's exported. So now network.h describes the simplest way to get the network going according to your configuration. bootp.h describes the alternatives, ie. the way to do it "by hand" if you have some way outside of init_all_network_interfaces() that you want to use. And if you want something different again, use the ioctl() API directly. - Huge ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 8:45 ` Hugo 'NOx' Tyson @ 2000-07-14 9:17 ` Andrew Lunn 0 siblings, 0 replies; 11+ messages in thread From: Andrew Lunn @ 2000-07-14 9:17 UTC (permalink / raw) To: ecos-discuss > The function build_bootp_record() is not exported either. > > It is now. ;-) Please make it a weak symbol, so it does not clash with mine :-) > So, if you're not using init_all_network_interfaces(), then your code must > do all the work, including calling init_loopback_interface() if you want > one. Ah, but init_loopback_interface() is not exported, that's what you > mean. OK, I'll do that too. It's exported. The problem is keeping track of whats in init_all_network_interfaces(). When you add ppp or some other type of interface you are likly to add init_ppp_interface() to this function. I then need to change my function etc. What i think would be better is to change init_all_network_interfaces() so that it actually does init_all_uninitialised_network_interfaces(). ie i setup none/any/all interfaces the way i want them and then i call init_all_network_interfaces(), which initialises any i've not. Before loopback was added this would work, but not now. If i initialise the loopback device(s) in my own special say and then call init_all_network_interfaces() to bring up the ethernets etc, it will try to initialise the loopback interfaces again. Andrew ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-14 5:30 ` Hugo 'NOx' Tyson 2000-07-14 5:34 ` Nick Barnes 2000-07-14 5:39 ` Andrew Lunn @ 2000-07-14 6:37 ` Nick Barnes 2 siblings, 0 replies; 11+ messages in thread From: Nick Barnes @ 2000-07-14 6:37 UTC (permalink / raw) To: ecos-discuss; +Cc: ecos-discuss At 2000-07-14 12:19:33+0000, "Hugo 'NOx' Tyson" writes: > > Nick Barnes <Nick.Barnes@pobox.com> writes: > > It seems to me that build_bootp_record() in network_support.c should > > > > add_tag(vp, TAG_GATEWAY, ...) > > > > and that its failure to do so could account for my problems here. > > > > This from single stepping through most of init_all_network_interfaces(). > > This is if it's statically configured, right? You're right, that makes > perfect sense, I'll see to it. BTW, full DHCP coming real soon... I had to make two changes to get this to work. first I did this in build_bootp_record: #define DONT_FORGET_TO_ADD_GATEWAY 1 #if DONT_FORGET_TO_ADD_GATEWAY addr = inet_addr(addrs_gateway); vp = add_tag(vp, TAG_GATEWAY, &addr, sizeof(in_addr_t)); #endif This still didn't work. It told me (addressed redacted): Route - dst: 192.168.0.0, mask: 255.255.255.0, gateway: 192.168.0.92 which is the wrong mask for a default gateway. So I added this in the obvious place in bootp_support.c: #define SET_GATEWAY_ROUTE_MASK_TO_ZERO 1 #if SET_GATEWAY_ROUTE_MASK_TO_ZERO memset(&route.rt_genmask, 0, sizeof(route.rt_genmask)); #else addrp->sin_addr = netmask; memcpy(&route.rt_genmask, addrp, sizeof(*addrp)); #endif And now I can establish connections with the rest of the world. This may well not be the best way to do this. Nick B -- FreeBSD 2.2.8-RELEASE: up 12 days, 19:25 last reboot Sat Jul 1 19:26 (lightning strike) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [ECOS] connect() to machine outside local network @ 2000-07-12 7:36 Nick Barnes 2000-07-12 7:44 ` Gary Thomas 2000-07-12 9:10 ` Nick Barnes 0 siblings, 2 replies; 11+ messages in thread From: Nick Barnes @ 2000-07-12 7:36 UTC (permalink / raw) To: ecos-discuss connect() works OK for local machines but gives me EHOSTUNREACH outside the local network. Nick B -- FreeBSD 2.2.8-RELEASE: up 10 days, 20:23 Last reboot due to lightning strike. ^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [ECOS] connect() to machine outside local network 2000-07-12 7:36 Nick Barnes @ 2000-07-12 7:44 ` Gary Thomas 2000-07-12 7:48 ` Nick Barnes 2000-07-12 9:10 ` Nick Barnes 1 sibling, 1 reply; 11+ messages in thread From: Gary Thomas @ 2000-07-12 7:44 UTC (permalink / raw) To: Nick Barnes; +Cc: ecos-discuss On 12-Jul-2000 Nick Barnes wrote: > connect() works OK for local machines but gives me EHOSTUNREACH > outside the local network. Have you provided proper routing to allow this? The defaults will only give you connectivity to the local network unless you set up a gateway which provides the "way out". > -- > FreeBSD 2.2.8-RELEASE: up 10 days, 20:23 > Last reboot due to lightning strike. ^^^^^^^^^^^^^^^^ I hope your machines were protected. Don't you have UPS on your systems? ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-12 7:44 ` Gary Thomas @ 2000-07-12 7:48 ` Nick Barnes 0 siblings, 0 replies; 11+ messages in thread From: Nick Barnes @ 2000-07-12 7:48 UTC (permalink / raw) To: Gary Thomas; +Cc: ecos-discuss At 2000-07-12 14:44:29+0000, Gary Thomas writes: > > On 12-Jul-2000 Nick Barnes wrote: > > connect() works OK for local machines but gives me EHOSTUNREACH > > outside the local network. > > Have you provided proper routing to allow this? The defaults will only > give you connectivity to the local network unless you set up a gateway > which provides the "way out". Yes, I have (default gateway set in the config tool). I will be checking this with our sysadmin later today; it could be a network admin problem (maybe the box isn't on the subnet which I think it's on, or maybe the firewall doesn't know about it, etc., etc.). > > -- > > FreeBSD 2.2.8-RELEASE: up 10 days, 20:23 > > Last reboot due to lightning strike. > ^^^^^^^^^^^^^^^^ > I hope your machines were protected. Don't you have UPS on your systems? Not (yet) on the machine from which I send my email. My own fault. Nick B -- FreeBSD 2.2.8-RELEASE: up 10 days, 20:34 Last reboot due to lightning strike. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [ECOS] connect() to machine outside local network 2000-07-12 7:36 Nick Barnes 2000-07-12 7:44 ` Gary Thomas @ 2000-07-12 9:10 ` Nick Barnes 1 sibling, 0 replies; 11+ messages in thread From: Nick Barnes @ 2000-07-12 9:10 UTC (permalink / raw) To: ecos-discuss At 2000-07-12 14:36:47+0000, Nick Barnes writes: > connect() works OK for local machines but gives me EHOSTUNREACH > outside the local network. After some single-stepping in the TCP/IP stack, I think this is an eCos problem, not a problem with my local network. rtalloc() inside ip_output() is returning 0. I don't have a clear understanding of the route datastructures (in route.c and radix.c), but I can do more single-stepping if that would help. Nick B -- FreeBSD 2.2.8-RELEASE: up 10 days, 21:57 Last reboot due to lightning strike. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2000-07-14 9:17 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <396CAA52.A429F2C6@berger.to> 2000-07-14 4:37 ` [ECOS] connect() to machine outside local network Nick Barnes 2000-07-14 5:30 ` Hugo 'NOx' Tyson 2000-07-14 5:34 ` Nick Barnes 2000-07-14 5:39 ` Andrew Lunn 2000-07-14 8:45 ` Hugo 'NOx' Tyson 2000-07-14 9:17 ` Andrew Lunn 2000-07-14 6:37 ` Nick Barnes 2000-07-12 7:36 Nick Barnes 2000-07-12 7:44 ` Gary Thomas 2000-07-12 7:48 ` Nick Barnes 2000-07-12 9:10 ` Nick Barnes
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).