[syslinux] Sending UDP packets from comboot
Stefan Thomanek
stefan at thomanek.eu
Sat May 30 10:00:03 PDT 2009
Seems i need some help on this again.
I'm already able to send UDP packets from my module, with the correct
destination IP, source and destination port.
But: When i try to send some test data, the result is.. somehow weird.
my struct is
struct teststruct {
uint16_t var1;
uint8_t var2;
uint16_t var3; };
and i fill it with
var1 = 12345;
var2 = 0xFE;
var3 = 54321;
When i capture this packet with wireshark, i receive an udp broadcast
with the following content
> Data (6 bytes)
Data: 0000FFFFFFFF
It looks like the pointer to my data isn't correct. I expected something
like this
> Data (5 bytes)
Data: 3930FE31D4
Well, not exact, but the struct is 5 bytes long, isn't it?
The complete source code is attached to this mail.
Could anyone please take a look inside the text file and tell me where
i've made mistakes?
Thanks!
H. Peter Anvin schrieb:
> H. Peter Anvin wrote:
>
>>> args.gw = inet_addr("0.0.0.0");
>>> args.src_port = 4711;
>>>
>> For what it's worth, Syslinux itself uses port numbers between 49152 and
>> 57343.
>>
>>
>>> args.dst_port = 4799;
>>>
>
> Oh yes, you need to use htons() on these, I'm pretty sure.
>
> -hpa
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: udp_broadcast.c.txt
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20090530/dcc03c1f/attachment.txt>
More information about the Syslinux
mailing list