fix boot-looping of UPF with interface in TAP mode

This commit is contained in:
Robert Dash 2023-06-28 17:55:19 -04:00 committed by Sukchan Lee
parent d1f3ce304d
commit 26141ee2b5
1 changed files with 9 additions and 2 deletions

View File

@ -21,6 +21,7 @@
#include <tins/ethernetII.h>
#include <tins/hw_address.h>
#include <tins/icmpv6.h>
#include <tins/exceptions.h>
#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<ICMPv6>();
return icmp6.type() == ICMPv6::NEIGHBOUR_SOLICIT;
try {
const ICMPv6& icmp6 = pdu.rfind_pdu<ICMPv6>();
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;
}