aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/eth.h4
-rw-r--r--include/net/filter.h1
-rw-r--r--include/net/net.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/include/net/eth.h b/include/net/eth.h
index 09054a506d..e6dc8a7ba0 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -194,7 +194,9 @@ struct tcp_hdr {
#define PKT_GET_IP_HDR(p) \
((struct ip_header *)(((uint8_t *)(p)) + eth_get_l2_hdr_length(p)))
#define IP_HDR_GET_LEN(p) \
- ((((struct ip_header *)(p))->ip_ver_len & 0x0F) << 2)
+ ((ldub_p(p + offsetof(struct ip_header, ip_ver_len)) & 0x0F) << 2)
+#define IP_HDR_GET_P(p) \
+ (ldub_p(p + offsetof(struct ip_header, ip_p)))
#define PKT_GET_IP_HDR_LEN(p) \
(IP_HDR_GET_LEN(PKT_GET_IP_HDR(p)))
#define PKT_GET_IP6_HDR(p) \
diff --git a/include/net/filter.h b/include/net/filter.h
index 0c4a2ea6c9..435acd6f82 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -9,6 +9,7 @@
#ifndef QEMU_NET_FILTER_H
#define QEMU_NET_FILTER_H
+#include "qapi/qapi-types-net.h"
#include "qom/object.h"
#include "qemu-common.h"
#include "net/queue.h"
diff --git a/include/net/net.h b/include/net/net.h
index cd1708c18b..a943e968a3 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -2,7 +2,7 @@
#define QEMU_NET_H
#include "qemu/queue.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-net.h"
#include "net/queue.h"
#include "migration/vmstate.h"