View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003192 | GNUnet | portability | public | 2013-12-10 22:08 | 2013-12-24 20:53 |
Reporter | shedatc | Assigned To | Christian Grothoff | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | FreeBSD | OS | FreeBSD | OS Version | 9.2 |
Product Version | Git master | ||||
Target Version | 0.10.0 | Fixed in Version | 0.10.0 | ||
Summary | 0003192: FreeBSD: EINVAL returned by sendto() in the client NAT helper | ||||
Description | On FreeBSD the IP packet length must be flipped. From PR kern/21737: An IPPROTO_RAW socket, set with IP_HDRINCL option via setsockopt, won't let any raw packet out and return EINVAL. This is due to the fact that FreeBSD kernel uses flipped ip_len to speed up handling, where the user just supplied a htons'ed one. Then, a check in rip_output() forbids the case where : ip->ip_len < m->m_pkthdr.len A user supplied IP header is seen as 10240 bytes long and denied. | ||||
Additional Information | Patch raw-ip-pkt-len.patch is against r31267. | ||||
Tags | No tags attached. | ||||
Attached Files | raw-ip-pkt-len.patch (847 bytes)
Index: src/nat/gnunet-helper-nat-client.c =================================================================== --- src/nat/gnunet-helper-nat-client.c (revision 31267) +++ src/nat/gnunet-helper-nat-client.c (working copy) @@ -237,7 +237,11 @@ off = 0; ip_pkt.vers_ihl = 0x45; ip_pkt.tos = 0; +#ifdef FREEBSD + ip_pkt.pkt_len = sizeof (packet); /* Workaround PR kern/21737 */ +#else ip_pkt.pkt_len = htons (sizeof (packet)); +#endif ip_pkt.id = htons (PACKET_ID); ip_pkt.flags_frag_offset = 0; ip_pkt.ttl = 128; @@ -334,7 +338,11 @@ off = 0; ip_pkt.vers_ihl = 0x45; ip_pkt.tos = 0; +#ifdef FREEBSD + ip_pkt.pkt_len = sizeof (packet); /* Workaround PR kern/21737 */ +#else ip_pkt.pkt_len = htons (sizeof (packet)); +#endif ip_pkt.id = htons (PACKET_ID); ip_pkt.flags_frag_offset = 0; ip_pkt.ttl = IPDEFTTL; | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2013-12-10 22:08 | shedatc | New Issue | |
2013-12-10 22:08 | shedatc | File Added: raw-ip-pkt-len.patch | |
2013-12-10 23:14 | Christian Grothoff | Note Added: 0007832 | |
2013-12-10 23:14 | Christian Grothoff | Status | new => resolved |
2013-12-10 23:14 | Christian Grothoff | Fixed in Version | => 0.10.0 |
2013-12-10 23:14 | Christian Grothoff | Resolution | open => fixed |
2013-12-10 23:14 | Christian Grothoff | Assigned To | => Christian Grothoff |
2013-12-10 23:14 | Christian Grothoff | Target Version | => 0.10.0 |
2013-12-24 20:53 | Christian Grothoff | Status | resolved => closed |