Skip to content

Commit

Permalink
fix boot-looping of UPF with interface in TAP mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rdash-fenix authored and acetcom committed Jul 1, 2023
1 parent d1f3ce3 commit 26141ee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/upf/arp-nd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 26141ee

Please sign in to comment.