Re: [9fans] [PATCH 1/3] Add swapip read in lookupip()

2019-01-22 Thread cinap_lenrek
yeah, rootserver makes much more sense.

--
cinap



Re: [9fans] [PATCH 2/3] Send vendor ndb attribute if available

2019-01-22 Thread k0ga
> all looks good. except that "swap" is kind of crazy name to mean
> the nfs server.

If you want we an change it to rootserver. If I am not wrong,
NetBSD uses "swap", OpenBSD uses "nextserver" and linux uses
"rootserver". As rootpath is an accepted attribute name (everyone
uses that name), maybe the best option is rootserver.




[9fans] [PATCH 1/3] Add swapip read in lookupip()

2019-01-22 Thread k0ga
Lookupip() was already reading rootpath, but it didn't read
the address of the swap server (called rootserver in some
systems). 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. 

diff -r b1cb12e81f18 sys/src/cmd/ip/dhcpd/ndb.c
--- a/sys/src/cmd/ip/dhcpd/ndb.cSun Jan 20 12:55:31 2019 +0100
+++ b/sys/src/cmd/ip/dhcpd/ndb.cTue Jan 22 18:50:26 2019 +
@@ -116,10 +116,11 @@
*p++ = "@tftp2";
*p++ = "rootpath";
*p++ = "dhcp";
-   *p++ = "vendorclass";
+   *p++ = "vendor";
*p++ = "dom";
*p++ = "@fs";
*p++ = "@auth";
+   *p++ = "@swap";
}
if(hwattr != nil)
*p++ = hwattr;
@@ -153,6 +154,9 @@
if(strcmp(nt->attr, "ipgw") == 0)
setipaddr(iip->gwip, nt->val);
else
+   if(strcmp(nt->attr, "swap") == 0)
+   setipaddr(iip->swapip, nt->val);
+   else
if(strcmp(nt->attr, "dhcp") == 0){
if(iip->dhcpgroup[0] == 0)
strncpy(iip->dhcpgroup, nt->val, 
sizeof(iip->dhcpgroup)-1);




Re: [9fans] [PATCH 2/3] Send vendor ndb attribute if available

2019-01-22 Thread cinap_lenrek
all looks good. except that "swap" is kind of crazy name to mean
the nfs server.

--
cinap



[9fans] [PATCH 3/3] Update ndb(6) and dhcpd(8)

2019-01-22 Thread k0ga


diff -r b1cb12e81f18 sys/man/6/ndb
--- a/sys/man/6/ndb Sun Jan 20 12:55:31 2019 +0100
+++ b/sys/man/6/ndb Tue Jan 22 18:54:46 2019 +
@@ -189,6 +189,12 @@
 .B /386/9bootpxe
 to boot a PC via PXE.
 .TP
+.B vendor
+Specific vendor attribute for dhcp and bootp
+.TP
+.B swap
+used by Unix machines for boot NFS server
+.TP
 .B tftp
 an TFTP server to use for PXE bootstrap
 .TP
diff -r b1cb12e81f18 sys/man/8/dhcpd
--- a/sys/man/8/dhcpd   Sun Jan 20 12:55:31 2019 +0100
+++ b/sys/man/8/dhcpd   Tue Jan 22 18:54:46 2019 +
@@ -162,6 +162,9 @@
 .TP
 .B swap
 used by Unix machines for boot NFS server
+.TP
+.B vendor
+Specific vendor attribute for dhcp and bootp
 .PD
 .PP
 .I Dhcpd




Re: [9fans] Plan 9 DNS server and dnsflagday

2019-01-22 Thread Steve Simon
my understanding is that this is fine, as long as the other RR’s in the message 
are processed correctly.

 -Steve


> On 22 Jan 2019, at 5:05 pm, cinap_len...@felloff.net wrote:
> 
> we do not support edns at all. the Topt rr type is just ignored.
> 
> --
> cinap




[9fans] [PATCH 1/3] Add swapip read in lookupip()

2019-01-22 Thread k0ga
Lookupip() was already reading rootpath, but it didn't read
the address of the swap server (called rootserver in some
systems). 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. 

diff -r b1cb12e81f18 sys/src/cmd/ip/dhcpd/ndb.c
--- a/sys/src/cmd/ip/dhcpd/ndb.cSun Jan 20 12:55:31 2019 +0100
+++ b/sys/src/cmd/ip/dhcpd/ndb.cTue Jan 22 18:50:26 2019 +
@@ -116,10 +116,11 @@
*p++ = "@tftp2";
*p++ = "rootpath";
*p++ = "dhcp";
-   *p++ = "vendorclass";
+   *p++ = "vendor";
*p++ = "dom";
*p++ = "@fs";
*p++ = "@auth";
+   *p++ = "@swap";
}
if(hwattr != nil)
*p++ = hwattr;
@@ -153,6 +154,9 @@
if(strcmp(nt->attr, "ipgw") == 0)
setipaddr(iip->gwip, nt->val);
else
+   if(strcmp(nt->attr, "swap") == 0)
+   setipaddr(iip->swapip, nt->val);
+   else
if(strcmp(nt->attr, "dhcp") == 0){
if(iip->dhcpgroup[0] == 0)
strncpy(iip->dhcpgroup, nt->val, 
sizeof(iip->dhcpgroup)-1);




[9fans] [PATCH 2/3] Send vendor ndb attribute if available

2019-01-22 Thread k0ga
At this moment plan9 is using vendorinfo to communicate
some specific plan9 parameters, but there are some boards
that use this attribute to set specific values. This
patch allows netbooting of these boards using ndb attributes
instead of hard coded solutions in dhcpd(1). Vendor attribute
is used for that purpose because it is also used for the
same purpose in bootp.

diff -r b1cb12e81f18 sys/src/cmd/ip/dhcpd/dhcpd.c
--- a/sys/src/cmd/ip/dhcpd/dhcpd.c  Sun Jan 20 12:55:31 2019 +0100
+++ b/sys/src/cmd/ip/dhcpd/dhcpd.c  Tue Jan 22 18:06:01 2019 +
@@ -1277,8 +1277,7 @@
}
 
-   /* add plan9 specific options */
-   if(strncmp((char*)rp->vendorclass, "plan9_", 6) == 0
-   || strncmp((char*)rp->vendorclass, "p9-", 3) == 0){
+   if (*rp->vendorclass != '\0') {
/* point to temporary area */
op = rp->p;
omax = rp->max;
@@ -1286,15 +1285,21 @@
rp->p = vopts;
rp->max = vopts + sizeof(vopts) - 1;
 
-   /* emit old v4 addresses first to make sure that they fit */
-   addrsopt(rp, OP9fsv4, addrs, lookupserver("fs", addrs, 
nelem(addrs), t));
-   addrsopt(rp, OP9authv4, addrs, lookupserver("auth", addrs, 
nelem(addrs), t));
+   if (*rp->ii.vendor != '\0')
+   stringopt(rp, OBvendorinfo, rp->ii.vendor);
 
-   p9addrsopt(rp, OP9fs, addrs, lookupserver("fs", addrs, 
nelem(addrs), t));
-   p9addrsopt(rp, OP9auth, addrs, lookupserver("auth", addrs, 
nelem(addrs), t));
-   p9addrsopt(rp, OP9ipaddr, addrs, lookupserver("ip", addrs, 
nelem(addrs), t));
-   p9addrsopt(rp, OP9ipmask, addrs, lookupserver("ipmask", addrs, 
nelem(addrs), t));
-   p9addrsopt(rp, OP9ipgw, addrs, lookupserver("ipgw", addrs, 
nelem(addrs), t));
+   /* add plan9 specific options */
+   if (strncmp((char*)rp->vendorclass, "p9-", 3) == 0
+   ||  strncmp((char*)rp->vendorclass, "plan9_", 6) == 0){
+   /* emit old v4 addresses first to make sure that they 
fit */
+   addrsopt(rp, OP9fsv4, addrs, lookupserver("fs", addrs, 
nelem(addrs), t));
+   addrsopt(rp, OP9authv4, addrs, lookupserver("auth", 
addrs, nelem(addrs), t));
+
+   p9addrsopt(rp, OP9fs, addrs, lookupserver("fs", addrs, 
nelem(addrs), t));
+   p9addrsopt(rp, OP9auth, addrs, lookupserver("auth", 
addrs, nelem(addrs), t));
+   p9addrsopt(rp, OP9ipaddr, addrs, lookupserver("ip", 
addrs, nelem(addrs), t));
+   p9addrsopt(rp, OP9ipmask, addrs, lookupserver("ipmask", 
addrs, nelem(addrs), t));
+   p9addrsopt(rp, OP9ipgw, addrs, lookupserver("ipgw", 
addrs, nelem(addrs), t));
+   }
 
/* point back to packet, encapsulate vopts into packet */
j = rp->p - vopts;




Re: [9fans] Plan 9 DNS server and dnsflagday

2019-01-22 Thread cinap_lenrek
we do not support edns at all. the Topt rr type is just ignored.

--
cinap



Re: [9fans] Plan 9 DNS server and dnsflagday

2019-01-22 Thread Kurt H Maier
On Tue, Jan 22, 2019 at 02:48:31PM +0300, Sergey Zhilkin wrote:
> Hi all!
> 
> Are we ready for this ?

It's not real.

khm



[9fans] Plan 9 DNS server and dnsflagday

2019-01-22 Thread Sergey Zhilkin
Hi all!

Are we ready for this ?

-- 
С наилучшими пожеланиями
Жилкин Сергей
With best regards
Zhilkin Sergey