summaryrefslogtreecommitdiffstats
path: root/src/extra/pktbuff.c
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2019-11-14 10:05:32 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-11-16 00:06:18 +0100
commit4d546fa824731c285a9d601e16a415c7e7269fc0 (patch)
treefa2dfaf756c15d1112c6338d88700f2856f8ee33 /src/extra/pktbuff.c
parente01e4fe5ac1acab58a4c0f53a66f6f1e88aea022 (diff)
src: Make sure pktb_alloc() works for IPv6 over AF_BRIDGE
At least on the local interface, the MAC header of an IPv6 packet specifies IPv6 protocol (rather than IP). This surprised me, since the first octet of the IP datagram is the IP version, but I guess it's an efficiency thing. Without this patch, pktb_alloc() returns NULL when an IPv6 packet is encountered. Updated: src/extra/pktbuff.c: - Treat ETH_P_IPV6 the same as ETH_P_IP. Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra/pktbuff.c')
-rw-r--r--src/extra/pktbuff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index c52b674..f1f8323 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -73,6 +73,7 @@ struct pkt_buff *pktb_alloc(int family, void *data, size_t len, size_t extra)
switch(ethhdr->h_proto) {
case ETH_P_IP:
+ case ETH_P_IPV6:
pktb->network_header = pktb->data + ETH_HLEN;
break;
default: