I got errors on the console like: LHNET_Write: sendto returned error
This beause of filling 'family' variable of lhnetaddress_inet4_s structure with host-byte-ordered value.
I fixed this by correcting lhnetaddress_inet4_s structure (see file lhnet.h):
- Code: Select all
// compatible with sockaddr_in
typedef struct lhnetaddress_inet4_s
{
- unsigned short family; // 2
+ unsigned char sin_len;
+ unsigned char family; // 2
unsigned short port;
unsigned char address[4];
unsigned char padding[8]; // to match sockaddr_in
Alternatively, you can use htons() when assigning family variable (in lhnet.c).
BTW: on FreeBSD LHNETADDRESSTYPE_INET6_FAMILY should be == 28, not 10.