[syslinux] Domain name search path use during PXE booting

Celelibi celelibi at gmail.com
Fri Jan 8 07:15:32 PST 2016


2016-01-08 10:46 UTC+01:00, Stephen Bleazard <sbleazard at janestreet.com>:
> Domain naming parsing wise, I couldn't find any code or any cases
> where the domain search option (119) is processed.
>
> Pointer loop handling: I agree that 32 is pretty arbitrary, the issue
> I was trying to prevent is a pointer at the end of a label pointing at
> the same label. This would still be backwards but infinite.  However,
> this does suggest a solution: The pointer must be before the current
> label. I will update the code

That's the idea. :) But I'm not sure a finite state automaton is the
most clear implementation ever. It's a 2.5 times longer than my
(imperfect) implementation (see below) and seems to have some code
redundancy.

>
> Malformed packets are handled by the finite state machine, after each
> byte the possible error conditions are checked. Pointing before the
> buffer is handled as all dhcp pointers are offsets from the buffer
> start and have no sign bit.  When an error is detected the current
> entry is aborted and is not included in the final list.
>
> I agree that the local domain could be merged into the DomanSearch
> list. To maintain compatibility with the current semantics it would be
> at the end of the list.  I searched the code for other usages of
> LocalDomain but didn't find any.
>
> Thanks for the feedback
>
> Steve Bleazard

I had implemented some similar DNS demangling in a patch for DNS
support in UEFI (don't use it, there are a few bugs).
http://www.syslinux.org/archives/2015-September/024141.html

It would be great if we could have a single implementation for both
cases. So, maybe you could split out this function in two parts: one
that demangles a single name given a buffer+length and a start pointer
and return the size of data read before encountering a pointer. The
other function that just loop over all the names.

If you do this and your patch is merged, I could make it non-static
and move it to an appropriate file when submitting a second version of
my patch.

As a general note: Please reply under the message you're replying to.

Best regards,
Celelibi


More information about the Syslinux mailing list