summaryrefslogtreecommitdiff
path: root/include/netinet/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/netinet/udp.h')
-rw-r--r--include/netinet/udp.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/include/netinet/udp.h b/include/netinet/udp.h
index 7d4976885..ac6f23413 100644
--- a/include/netinet/udp.h
+++ b/include/netinet/udp.h
@@ -52,27 +52,28 @@
/* UDP header as specified by RFC 768, August 1980. */
-#ifdef __FAVOR_BSD
struct udphdr
{
- u_int16_t uh_sport; /* source port */
- u_int16_t uh_dport; /* destination port */
- u_int16_t uh_ulen; /* udp length */
- u_int16_t uh_sum; /* udp checksum */
+ __extension__ union
+ {
+ struct
+ {
+ uint16_t uh_sport; /* source port */
+ uint16_t uh_dport; /* destination port */
+ uint16_t uh_ulen; /* udp length */
+ uint16_t uh_sum; /* udp checksum */
+ };
+ struct
+ {
+ uint16_t source;
+ uint16_t dest;
+ uint16_t len;
+ uint16_t check;
+ };
+ };
};
-#else
-
-struct udphdr
-{
- u_int16_t source;
- u_int16_t dest;
- u_int16_t len;
- u_int16_t check;
-};
-#endif
-
/* UDP socket options */
#define UDP_CORK 1 /* Never send partially complete segments. */
#define UDP_ENCAP 100 /* Set the socket to accept