[ECOS] build_bootp_record() support dns server address

Motoya Kurotsu kurotsu@allied-telesis.co.jp
Thu Jan 9 06:14:00 GMT 2003

Hi, all;

I would like to hear your advice about my idea regarding 

When ip address is staticaly set (i.e. CYGHWR_NET_DRIVER_ETHX_BOOTP is 
undefined), init_net() doesn't call cyg_dns_res_init(). So I think it is 
better to modify build_bootp_record() to have the dns server address 
like in the following:

    build_bootp_record(struct bootp *bp,
		       const char *if_name,
		       const char *addrs_ip,
		       const char *addrs_netmask,
		       const char *addrs_broadcast,
		       const char *addrs_gateway,
		       const char *addrs_server,
		       const char *addrs_dns_server);	<---

Also the dns server address might be added in cdl script like other addresses.
The attachment is my patch for network_support.c for reference.
How do you think about this idea?

Motoya Kurotsu
Allied Telesis K.K.

--- network_support.c.orig	Thu Jan  9 15:02:27 2003
+++ network_support.c	Thu Jan  9 15:01:06 2003
@@ -201,7 +201,8 @@
                    const char *addrs_netmask,
                    const char *addrs_broadcast,
                    const char *addrs_gateway,
-                   const char *addrs_server)
+                   const char *addrs_server,
+                   const char *addrs_dns_server)
     int i, s;
     in_addr_t addr;
@@ -241,6 +242,8 @@
     vp = add_tag(vp, TAG_IP_BROADCAST, &addr, sizeof(in_addr_t));
     addr = inet_addr(addrs_gateway);
     vp = add_tag(vp, TAG_GATEWAY, &addr, sizeof(in_addr_t));
+    addr = inet_addr(addrs_dns_server);
+    vp = add_tag(vp, TAG_DOMAIN_SERVER, &addr, sizeof(in_addr_t));
     *vp = TAG_END;
@@ -312,7 +315,8 @@
-                           string(CYGHWR_NET_DRIVER_ETH0_ADDRS_SERVER));
+                           string(CYGHWR_NET_DRIVER_ETH0_ADDRS_SERVER),
+                           string(CYGHWR_NET_DRIVER_ETH0_ADDRS_DNS_SERVER));
         show_bootp(eth0_name, &eth0_bootp_data);
@@ -366,7 +370,8 @@
-                           string(CYGHWR_NET_DRIVER_ETH1_ADDRS_SERVER));
+                           string(CYGHWR_NET_DRIVER_ETH1_ADDRS_SERVER),
+                           string(CYGHWR_NET_DRIVER_ETH1_ADDRS_DNS_SERVER));
         show_bootp(eth1_name, &eth1_bootp_data);

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

More information about the Ecos-discuss mailing list