*** From dhcp-server -- To unsubscribe, see the end of this message. ***

There has been a bit of discussion of the problems associated with the
limited size of BOOTP replies, but I don't think this particular aspect
has been mentioned - at least I couldn't find it in the archives: I have
a BOOTP client that specifically needs the "root-path" option, and from
what I understand even "asks" for it in the BOOTREQUEST:

19:46:49.374518 0:80:37:b0:8d:37 Broadcast ip 406: 0.0.0.0.bootpc >
  255.255.255.255.bootps: xid:0xa741c1bc vend-rfc1048 SM:0.0.0.0 DG:0.0.0.0
  HN:"^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@"
  T40:0,0,0,0,0,0,0,0
  RP:"^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@"

However due to the way I have my config setup (below), the client
doesn't get this option in the reply:

19:46:49.411430 8:0:20:86:dd:21 0:80:37:b0:8d:37 ip 342: super.bootps >
  255.255.255.255.bootpc: xid:0xa741c1bc Y:ebox2 S:super vend-rfc1048
  SM:255.255.254.0 DG:router-34
  NS:super,malmen.ericsson.se,ericom.ericsson.se HN:"ebox2"
  DN:"du.etx.ericsson.se" T46:8

Now, I can "fix" this by putting all options that this client isn't
interested in (together with the declarations for hosts that *are*
interested in them) in a "group" clause instead of at the top level, but
this becomes rather cumbersome if there are multiple BOOTP clients with
varying desires...

The patch below is an attempt to have dhcpd prioritize the options that
the client "asked" for when composing the reply - I'll admit that I have
a rather limited understanding both of the BOOTP protocol and of dhcpd
internals, so it may be way off base - but it seems to have the desired
result:

19:50:44.889765 8:0:20:86:dd:21 0:80:37:b0:8d:37 ip 342: super.bootps >
  255.255.255.255.bootpc: xid:0x8c47259c Y:ebox2 S:super vend-rfc1048
  SM:255.255.254.0 DG:router-34 HN:"ebox2" RP:"/export/exec/ebox"
  NS:super,malmen.ericsson.se,ericom.ericsson.se T46:8

An alternative/complementary method could be to have dhcpd prioritize
based on which options are specified in the "host" clause, but perhaps
that's a bit more dubious.

--Per Hedeland
[EMAIL PROTECTED]

Config file snippet:

option domain-name "du.etx.ericsson.se";
option domain-name-servers super, malmen.ericsson.se, ericom.ericsson.se;
option netbios-name-servers super;
option netbios-node-type 8;
option ntp-servers super, router-34, gandalf;

subnet 130.100.34.0 netmask 255.255.254.0 {
    option subnet-mask 255.255.254.0;
    option broadcast-address 130.100.35.255;
    option routers router-34;
}

host ebox2 {
    hardware ethernet 0:80:37:b0:8d:37;
    option root-path "/export/exec/ebox";
    fixed-address ebox2;
}

(other host declarations...)


*** dhcp-2.0b1pl18/common/options.c.ORIG        Thu Jun 25 23:11:30 1998
--- dhcp-2.0b1pl18/common/options.c     Thu Mar 11 19:31:30 1999
***************
*** 216,225 ****
                                [DHO_DHCP_PARAMETER_REQUEST_LIST].data, prlen);
                priority_len += prlen;
        } else {
                memcpy (&priority_list [priority_len],
                        dhcp_option_default_priority_list,
!                       sizeof_dhcp_option_default_priority_list);
!               priority_len += sizeof_dhcp_option_default_priority_list;
        }
  
        /* Copy the options into the big buffer... */
--- 216,237 ----
                                [DHO_DHCP_PARAMETER_REQUEST_LIST].data, prlen);
                priority_len += prlen;
        } else {
+               int i, prlen;
+               if (bootpp && inpacket) {
+                       for (i = 0;
+                            i < 256 && priority_len < sizeof priority_list;
+                            i++) {
+                               if (inpacket -> options [i].data)
+                                       priority_list [priority_len++] = i;
+                       }
+               }
+               prlen = sizeof_dhcp_option_default_priority_list;
+               if (prlen + priority_len > sizeof priority_list)
+                       prlen = (sizeof priority_list) - priority_len;
                memcpy (&priority_list [priority_len],
                        dhcp_option_default_priority_list,
!                       prlen);
!               priority_len += prlen;
        }
  
        /* Copy the options into the big buffer... */


------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dhcp/lists
If you are without web access, or if you are having trouble with the web page,
please send mail to [EMAIL PROTECTED]   Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------

Reply via email to