@@ -94,6 +94,9 @@ def initialize(hash, context = {})
94
94
self . pxealtconfigfile = "update0"
95
95
self . pxepathprefix = ""
96
96
self . pxereboottime = 2000
97
+
98
+ self . domainname = hash [ 'DOMAINNAME' ] if hash . include? ( 'DOMAINNAME' )
99
+ self . url = hash [ 'URL' ] if hash . include? ( 'URL' )
97
100
end
98
101
99
102
def report ( &block )
@@ -126,7 +129,7 @@ def set_option(opts)
126
129
allowed_options = [
127
130
:serveOnce , :pxealtconfigfile , :servePXE , :relayip , :leasetime , :dnsserv ,
128
131
:pxeconfigfile , :pxepathprefix , :pxereboottime , :router ,
129
- :give_hostname , :served_hostname , :served_over , :serveOnlyPXE
132
+ :give_hostname , :served_hostname , :served_over , :serveOnlyPXE , :domainname , :url
130
133
]
131
134
132
135
opts . each_pair { |k , v |
@@ -154,7 +157,7 @@ def send_packet(ip, pkt)
154
157
attr_accessor :sock , :thread , :myfilename , :ipstring , :served , :serveOnce
155
158
attr_accessor :current_ip , :start_ip , :end_ip , :broadcasta , :netmaskn
156
159
attr_accessor :servePXE , :pxeconfigfile , :pxealtconfigfile , :pxepathprefix , :pxereboottime , :serveOnlyPXE
157
- attr_accessor :give_hostname , :served_hostname , :served_over , :reporter
160
+ attr_accessor :give_hostname , :served_hostname , :served_over , :reporter , :domainname , :url
158
161
159
162
protected
160
163
@@ -317,6 +320,8 @@ def dispatch_request(from, buf)
317
320
pkt << dhcpoption ( OpHostname , send_hostname )
318
321
end
319
322
end
323
+ pkt << dhcpoption ( OpDomainname , self . domainname ) if self . domainname
324
+ pkt << dhcpoption ( OpURL , self . url ) if self . url
320
325
pkt << dhcpoption ( OpEnd )
321
326
322
327
pkt << ( "\x00 " * 32 ) #padding
0 commit comments