From 26141ee2b515fd2533a3b3c494e8482d511b6601 Mon Sep 17 00:00:00 2001 From: Robert Dash Date: Wed, 28 Jun 2023 17:55:19 -0400 Subject: [PATCH] fix boot-looping of UPF with interface in TAP mode --- src/upf/arp-nd.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/upf/arp-nd.cpp b/src/upf/arp-nd.cpp index acf5db727..1fc26fec4 100644 --- a/src/upf/arp-nd.cpp +++ b/src/upf/arp-nd.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "arp-nd.h" @@ -69,8 +70,14 @@ uint8_t arp_reply(uint8_t *reply_data, uint8_t *request_data, uint len, bool _parse_nd(EthernetII &pdu) { if (pdu.payload_type() == ETHERTYPE_IPV6) { - const ICMPv6& icmp6 = pdu.rfind_pdu(); - return icmp6.type() == ICMPv6::NEIGHBOUR_SOLICIT; + try { + const ICMPv6& icmp6 = pdu.rfind_pdu(); + return icmp6.type() == ICMPv6::NEIGHBOUR_SOLICIT; + } + catch (Tins::pdu_not_found& e) { + /* If it is not an ICMPv6 message, it can not be a NEIGHBOUR_SOLICIT */ + return false; + } } return false; }