[syslinux] Support DHCP sname field in PXELINUX

Dyks, Axel (XL) xl at xlsigned.net
Fri Jun 29 05:48:17 PDT 2007


H. Peter Anvin wrote:
> Dyks, Axel (XL) wrote:
>> Priority settings did arrive a little late ...
>>
>> BTW, what are you refering to as "third priority"?
>> Having _any_ workaround for missing "next-server" or
>> using option 54 for this purpose?
>>
> 
> I mean, the right thing to do is probably, in order:
> 
> 1. Use siaddr
> 2. Use sname
> 3. Use option 54.
> 
Hmmh,

I've created the attached patch against 3.52 (git), fixed a few of my bugs,
and experimented a little bit with different "server-name" values (ISC dhcpd).

While the "server-name" value is an _optional_ string value which is empty
by default, the "server-identifer" value which is equivalent to the
"dhcp-server-identifier" option is not recommended to be set under
normal circumstances, because it overrides the _default_value_ which is the
first IP address associated with the physical network interface on which
the request arrived.

<quote `man dhcpd.conf`>

       The server-identifier statement

         server-identifier hostname;

         The server-identifier statement can be used to define the value that is sent in the DHCP  Server  Identifier
         option  for  a  given  scope.    The  value specified must be an IP address for the DHCP server, and must be
         reachable by all clients served by a particular scope.

         The use of the server-identifier statement is not recommended - the only reason to use  it  is  to  force  a
         value other than the default value to be sent on occasions where the default value would be incorrect.   The
         default value is the first IP address associated with the physical network interface on  which  the  request
         arrived.

         The  usual case where the server-identifier statement needs to be sent is when a physical interface has more
         than one IP address, and the one being sent by default isn't appropriate for some or all clients  served  by
         that  interface.   Another common case is when an alias is defined for the purpose of having a consistent IP
         address for the DHCP server, and it is desired that the clients use this  IP  address  when  contacting  the
         server.

         Supplying  a value for the dhcp-server-identifier option is equivalent to using the server-identifier state-
         ment.

       The server-name statement

         server-name name ;

         The server-name statement can be used to inform the client of the name of the server from which it is  boot-
         ing.   Name should be the name that will be provided to the client.
</quote>

>From this follows that option 54 is ALWAYS send and _guaranteed_ to be an IP address,
whereas "sname" isn't set by default, and if it's set, then one shouldn't expect it
to be an IP address or a resolveable DNS name.

Furthermore it seems
  * a wrong "server-identifier" prevents my (vmware) PXE-ROM to load pxelinux in case that
    "next-server" is missing

  * if "next-server" is set, then receiving a wrong "server-identifier" doesn't stop my
    PXE-ROM to load pxelinux

  * missing "next-server" and having both "server-identifer" and "server-name" set to
    IP addresses results in my PXE-ROM to use the "server-identifier"

In other words:

  * "sname" is ignored by my PXE-ROM entirely
  * "next-server" is prefered over "server-identifier" (option 54), i. e. "server-identifier"
    is used as fallback when "next-server" is empty.

To me it seems that the best way to "mimic" the "liberal" behavior of my PXE-ROM
(possibly many PXE-ROMs), would be to handle "option 54" with 2nd priority (after siaddr)
and forget about "sname" entirely.

Furthermore it would compensate for the changed behavior of "ISC dhcpd" which used to
set "next-server" to "server-identifier" in case that "next-server" hasn't been
specified.

Cheers,
Axel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-next-server.patch
Type: text/x-patch
Size: 3609 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-next-server-sname-empty.png
Type: image/png
Size: 13090 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-next-server-sname-ip.png
Type: image/png
Size: 13541 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-next-server-sname-ip-ignored.png
Type: image/png
Size: 13563 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-next-server-sname-random.png
Type: image/png
Size: 13480 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: with-next-server-bad-server-identifier.png
Type: image/png
Size: 13497 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070629/3b105fbd/attachment-0004.png>


More information about the Syslinux mailing list