Skip to content

Commit

Permalink
decode/gre: decode arp packets
Browse files Browse the repository at this point in the history
  • Loading branch information
glongo authored and victorjulien committed May 16, 2024
1 parent 8a171c9 commit b728916
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/decode-gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ int DecodeGRE(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *p
break;
}

case ETHERNET_TYPE_ARP: {
Packet *tp = PacketTunnelPktSetup(
tv, dtv, p, pkt + header_len, len - header_len, DECODE_TUNNEL_ARP);
if (tp != NULL) {
PKT_SET_SRC(tp, PKT_SRC_DECODER_GRE);
PacketEnqueueNoLock(&tv->decode_pq, tp);
}
break;
}

default:
return TM_ECODE_OK;
}
Expand Down
3 changes: 3 additions & 0 deletions src/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "decode-geneve.h"
#include "decode-erspan.h"
#include "decode-teredo.h"
#include "decode-arp.h"

#include "defrag-hash.h"

Expand Down Expand Up @@ -177,6 +178,8 @@ static int DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const
return DecodeERSPANTypeI(tv, dtv, p, pkt, len);
case DECODE_TUNNEL_NSH:
return DecodeNSH(tv, dtv, p, pkt, len);
case DECODE_TUNNEL_ARP:
return DecodeARP(tv, dtv, p, pkt, len);
default:
SCLogDebug("FIXME: DecodeTunnel: protocol %" PRIu32 " not supported.", proto);
break;
Expand Down
1 change: 1 addition & 0 deletions src/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ enum DecodeTunnelProto {
DECODE_TUNNEL_IPV6_TEREDO, /**< separate protocol for stricter error handling */
DECODE_TUNNEL_PPP,
DECODE_TUNNEL_NSH,
DECODE_TUNNEL_ARP,
DECODE_TUNNEL_UNSET
};

Expand Down

0 comments on commit b728916

Please sign in to comment.