[syslinux] tftp-hpa backport to openbsd tftpd

julien Touche julien.touche at lycos.com
Thu Dec 26 15:07:16 PST 2002


H. Peter Anvin wrote:
> julien Touche wrote:
> 
> I recommend using tcpdump and capturing a packet trace.
i give a glimpse to packet but nothing (maybe need more time, maybe
useless if there is merge, ...)

>>
>>> It would also be very interesting to know what modifications I would 
>>> need to add to tftp-hpa to make it compile on OpenBSD, so please send 
>>> me your changes.
>>
>>
>> i investigate little but i manage to compile with the following 
>> changes in MCONFIG CFLAGS:
>> i delete: -D_XOPEN_SOURCE
>> and add: -DHAVE_U_SHORT -DHAVE_U_LONG
>> now it compiles (i haven't test it for now)
> 
> 
> OK, unfortunately that's a hack (meaning you're bypassing the configure 
> script.)  Does _XOPEN_SOURCE really have to *not* be defined?  Where is 
> u_short and u_long defined on OpenBSD?

u_* are in /usr/include/sys/types.h (conflict types if flags undeclared)

about _XOPEN_SOURCE, i do not dig much but it's the only flag which
resolves issue. i test nearly all base flags and find this one to create
the header issue and no other

what's this flag about ? i don't see with grep part of the code which
hold by it ? license flag ?

> 
>> (note for archives: problem was seen from sys/socket.h and arpa/inet.h 
>> header, error about u_short and some others)
>>
>> i'll test it to know if it works but i thing it would be best if base 
>> openbsd could support tsize option in tftpd ...
> 
i check it and it works well

> 
> Yes, however, if we have a working tftp-hpa it should be easy enough to 
> drop it into the OpenBSD CVS tree.  It would make future merges easier, 
> too.
> 
>     -hpa
> 

that's true, but, as changes are important, openbsd team may be
reluctant to include it. Also note, i see some strcpy or sprintf in the
code ... better change to strncpy/snprintf (openbsd also have a strlcpy,
see man on openbsd.org) if you want to ask for a merge, as it will
reduce the amount of audit they will do.


Regards

		Julien




More information about the Syslinux mailing list