From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Barnes To: ecos-discuss@sources.redhat.com Cc: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] connect() to machine outside local network Date: Fri, 14 Jul 2000 06:37:00 -0000 Message-id: <10156.963581842@raven.ravenbrook.com> References: X-SW-Source: 2000-07/msg00143.html At 2000-07-14 12:19:33+0000, "Hugo 'NOx' Tyson" writes: > > Nick Barnes 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)