For historical reasons, iPXE sets the current working URI to the root of the TFTP server whenever the TFTP server address is changed. This was originally implemented in the hope of allowing a DHCP-provided TFTP filename to be treated simply as a relative URI. This usage turns out to be impractical since DHCP-provided TFTP filenames may include characters which would have special significance to the URI parser, and so the DHCP next-server+filename combination is now handled by the dedicated pxe_uri() function instead. The practice of setting the current working URI to the root of the TFTP server is potentially helpful for interactive uses of iPXE, allowing a user to type e.g. iPXE> dhcp Configuring (net0 52:54:00:12:34:56)... ok iPXE> chain pxelinux.0 and have the URI "pxelinux.0" interpreted as being relative to the root of the TFTP server provided via DHCP. The current implementation of tftp_apply_settings() has an unintended flaw. When the "dhcp" command is used to renew a DHCP lease (or to pick up potentially modified DHCP options), the old settings block will be unregistered before the new settings block is registered. This causes tftp_apply_settings() to believe that the TFTP server has been changed twice (to 0.0.0.0 and back again), and so the current working URI will always be set to the root of the TFTP server, even if the DHCP response provides exactly the same TFTP server as previously. Fix by doing nothing in tftp_apply_settings() whenever there is no TFTP server address. Debugged-by: Andrew Widdersheim <awiddersheim@inetu.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
1180 |
|
1180 |
|
1181 |
|
1181 |
|
1182 |
|
1182 |
|
1183 |
|
|
|
|
1183 |
|
|
1184 |
|
1184 |
|
1185 |
|
1185 |
|
1186 |
|
1186 |
|
1187 |
|
1187 |
|
1188 |
|
|
|
1189 |
|
|
|
|
1188 |
|
|
1190 |
|
1189 |
|
1191 |
|
1190 |
|
1192 |
|
1191 |
|
|
|
||
1195 |
|
1194 |
|
1196 |
|
1195 |
|
1197 |
|
1196 |
|
1198 |
|
|
|
1199 |
|
|
|
1200 |
|
|
|
1201 |
|
|
|
1202 |
|
|
|
1203 |
|
|
|
1204 |
|
|
|
1205 |
|
|
|
1206 |
|
|
|
1207 |
|
|
|
|
1197 |
|
|
|
1198 |
|
|
|
1199 |
|
|
|
1200 |
|
|
|
1201 |
|
|
|
1202 |
|
|
|
1203 |
|
|
|
1204 |
|
|
|
1205 |
|
|
|
1206 |
|
|
1208 |
|
1207 |
|
1209 |
|
1208 |
|
|
1209 |
|
|
1210 |
|
1210 |
|
1211 |
|
1211 |
|
1212 |
|
1212 |
|