summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-05-07 14:29:19 +0000
committerphk <phk@FreeBSD.org>2000-05-07 14:29:19 +0000
commit204a9e7fbafadf5dfd470354ae48be680eea7a32 (patch)
treed4a608977057a9a05bedca10bbcb90a52522f823 /sys/nfs
parent28230a763f4daad5c035f53b8bc38824b6eb52a1 (diff)
downloadFreeBSD-src-204a9e7fbafadf5dfd470354ae48be680eea7a32.zip
FreeBSD-src-204a9e7fbafadf5dfd470354ae48be680eea7a32.tar.gz
Include a RFC 1533 "Maximum DHCP Message Size" option in our request.
ISC DHCP will limit the reply length to 64 bytes for bootp replies unless we explicitly tell it we can do more. We tell it that we can do 1200 bytes.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/bootp_subr.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c
index 3295248..d580c55 100644
--- a/sys/nfs/bootp_subr.c
+++ b/sys/nfs/bootp_subr.c
@@ -834,11 +834,23 @@ bootpc_init(void)
call.xid = txdr_unsigned(xid);
bcopy(LLADDR(sdl),&call.chaddr,sdl->sdl_alen);
- call.vend[0]=99;
- call.vend[1]=130;
- call.vend[2]=83;
- call.vend[3]=99;
- call.vend[4]=255;
+ j = 0;
+ call.vend[j++]=99;
+ call.vend[j++]=130;
+ call.vend[j++]=83;
+ call.vend[j++]=99;
+
+ /*
+ * We send an RFC 1533 "Maximum DHCP Message Size" option, saying we
+ * can do 1200 bytes. If we don't ISC DHCPD will limit the answer to
+ * 64 bytes and root/swap and similar will be dropped.
+ */
+ call.vend[j++]=57;
+ call.vend[j++]=2;
+ call.vend[j++]=(1200) % 256;
+ call.vend[j++]=(1200) / 256;
+
+ call.vend[j++]=255;
call.secs = 0;
call.flags = htons(0x8000); /* We need an broadcast answer */
OpenPOWER on IntegriCloud