[klibc] [patch] ipconfig add dhcp file preseeding support
Geert Stappers
stappers at debian.org
Mon Jul 3 06:19:29 PDT 2006
On Mon, Jul 03, 2006 at 02:50:44PM +0200, Geert Stappers wrote:
>
> My proposal/request is to split the patch in two parts;
> an include filename part and the controversial "Vendor Class" part.
>
> Attached is the "filename part", in a follow-up the "Vendor Class" part.
Second attempt, sorry.
GSt
-------------- next part --------------
--- a/usr/kinit/ipconfig/bootp_proto.c
+++ b/usr/kinit/ipconfig/bootp_proto.c
@@ -74,6 +74,7 @@ int bootp_parse(struct netdev *dev, stru
dev->hostname[0] = '\0';
dev->nisdomainname[0] = '\0';
dev->bootpath[0] = '\0';
+ memcpy(&dev->filename, &hdr->boot_file, FNLEN);
if (extlen >= 4 && exts[0] == 99 && exts[1] == 130 &&
exts[2] == 83 && exts[3] == 99) {
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -71,6 +71,7 @@ static void print_device_config(struct n
printf(" nisdomain: %-64s\n", dev->nisdomainname);
printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server));
printf("rootpath: %s\n", dev->bootpath);
+ printf(" filename : %s\n", dev->filename);
}
static void configure_device(struct netdev *dev)
@@ -112,6 +113,7 @@ static void dump_device_config(struct ne
fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname);
fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server));
fprintf(f, "ROOTPATH=%s\n", dev->bootpath);
+ fprintf(f, "FILENAME=%s\n", dev->filename);
fclose(f);
}
}
--- a/usr/kinit/ipconfig/netdev.h
+++ b/usr/kinit/ipconfig/netdev.h
@@ -9,6 +9,7 @@ #include <sys/utsname.h>
#include <net/if.h>
#define BPLEN 40
+#define FNLEN 128 /* from RFC 2131, DHCP */
struct netdev {
const char *name; /* Device name */
@@ -42,6 +43,7 @@ struct netdev {
char dnsdomainname[SYS_NMLN]; /* dns domain name */
char nisdomainname[SYS_NMLN]; /* nis domain name */
char bootpath[BPLEN]; /* boot path */
+ char filename[FNLEN]; /* filename */
struct netdev *next; /* next configured i/f */
};
More information about the klibc
mailing list