Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/packet.c | 4 ++--
src/packet.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/packet.c b/src/packet.c
index 60d40b5..fbd94f1 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -46,7 +46,7 @@ static int packet_adjust(struct pkt_hdr *pkt)
switch (pkt->pkt_hatype) {
case ARPHRD_ETHER:
case ARPHRD_LOOPBACK:
- pkt_cast_hdrp(ethhdr, pkt);
+ pkt_cast_hdrp(ethhdr, pkt, 0);
pkt->pkt_payload = pkt->pkt_buf;
pkt->pkt_payload += ETH_HLEN;
pkt->pkt_len -= ETH_HLEN;
@@ -76,7 +76,7 @@ static int packet_adjust(struct pkt_hdr *pkt)
pkt->pkt_len -= 4;
break;
case ARPHRD_FDDI:
- pkt_cast_hdrp(fddihdr, pkt);
+ pkt_cast_hdrp(fddihdr, pkt, 0);
pkt->pkt_payload = pkt->pkt_buf;
pkt->pkt_payload += sizeof(struct fddihdr);
pkt->pkt_len -= sizeof(struct fddihdr);
diff --git a/src/packet.h b/src/packet.h
index dea4417..72a7062 100644
--- a/src/packet.h
+++ b/src/packet.h
@@ -38,9 +38,9 @@ struct pkt_hdr {
char pkt_buf[MAX_PACKET_SIZE];
};
-#define pkt_cast_hdrp(hdr, pkt) \
- do { \
- pkt->hdr = (struct hdr *) pkt->pkt_buf; \
+#define pkt_cast_hdrp(hdr, pkt, off) \
+ do { \
+ pkt->hdr = (struct hdr *) pkt->pkt_buf + off; \
} while (0)
--
1.7.10.2