9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] [PATCH 2/3] Send vendor ndb attribute if available
@ 2019-01-22 19:16 cinap_lenrek
  0 siblings, 0 replies; 3+ messages in thread
From: cinap_lenrek @ 2019-01-22 19:16 UTC (permalink / raw)
  To: 9fans

all looks good. except that "swap" is kind of crazy name to mean
the nfs server.

--
cinap



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] [PATCH 2/3] Send vendor ndb attribute if available
@ 2019-01-22 19:26 k0ga
  0 siblings, 0 replies; 3+ messages in thread
From: k0ga @ 2019-01-22 19:26 UTC (permalink / raw)
  To: 9fans

> 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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] [PATCH 2/3] Send vendor ndb attribute if available
@ 2019-01-22 18:58 k0ga
  0 siblings, 0 replies; 3+ messages in thread
From: k0ga @ 2019-01-22 18:58 UTC (permalink / raw)
  To: 9fans

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 +0000
@@ -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;




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-22 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 19:16 [9fans] [PATCH 2/3] Send vendor ndb attribute if available cinap_lenrek
  -- strict thread matches above, loose matches on Subject: below --
2019-01-22 19:26 k0ga
2019-01-22 18:58 k0ga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).