diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-01-23 20:49:50 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-01-23 20:49:50 +0100 |
commit | ad6e6444f9c1bf3a2d65c67ab8f4f48ac6468104 (patch) | |
tree | 8f6e7d3916ab85387427c3ca683624711c36b0e7 /sys | |
parent | 3cf63ee15fce37647fb3e5ce3d757b7cdaf5e872 (diff) |
ip/dhcpd: add rootserverip read in lookupip() (thanks k0ga)
Lookupip() was already reading rootpath, but it didn't read the
address of the rootserver. As they are very related it makes sense to
read them at the same time.
This patch also fixes a typo, where vendorclass was used instead of
vendor, resulting that vendor ndb attribute was never used.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/ip/dhcpd/dat.h | 1 | ||||
-rw-r--r-- | sys/src/cmd/ip/dhcpd/ndb.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/cmd/ip/dhcpd/dat.h b/sys/src/cmd/ip/dhcpd/dat.h index d8c96a886..f2e64c729 100644 --- a/sys/src/cmd/ip/dhcpd/dat.h +++ b/sys/src/cmd/ip/dhcpd/dat.h @@ -42,6 +42,7 @@ struct Info uchar gwip[NDB_IPlen]; /* gateway ip address */ uchar fsip[NDB_IPlen]; /* file system ip address */ uchar auip[NDB_IPlen]; /* authentication server ip address */ + uchar rootserverip[NDB_IPlen]; /* ip addr of root nfs server */ char rootpath[Maxstr]; /* rootfs for diskless nfs clients */ char dhcpgroup[Maxstr]; char vendor[Maxstr]; /* vendor info */ diff --git a/sys/src/cmd/ip/dhcpd/ndb.c b/sys/src/cmd/ip/dhcpd/ndb.c index d750248c2..0aea361cf 100644 --- a/sys/src/cmd/ip/dhcpd/ndb.c +++ b/sys/src/cmd/ip/dhcpd/ndb.c @@ -116,10 +116,11 @@ lookupip(uchar *ipaddr, char *hwattr, char *hwval, Info *iip, int gate) *p++ = "@tftp2"; *p++ = "rootpath"; *p++ = "dhcp"; - *p++ = "vendorclass"; + *p++ = "vendor"; *p++ = "dom"; *p++ = "@fs"; *p++ = "@auth"; + *p++ = "@rootserver"; } if(hwattr != nil) *p++ = hwattr; @@ -153,6 +154,9 @@ lookupip(uchar *ipaddr, char *hwattr, char *hwval, Info *iip, int gate) if(strcmp(nt->attr, "ipgw") == 0) setipaddr(iip->gwip, nt->val); else + if(strcmp(nt->attr, "rootserver") == 0) + setipaddr(iip->rootserverip, nt->val); + else if(strcmp(nt->attr, "dhcp") == 0){ if(iip->dhcpgroup[0] == 0) strncpy(iip->dhcpgroup, nt->val, sizeof(iip->dhcpgroup)-1); |