Switch to using std::ranges algorithms

This commit is contained in:
Tim Wojtulewicz 2025-07-18 17:06:09 -07:00
parent b4cbda4e02
commit 72c79006ac
42 changed files with 90 additions and 93 deletions

View file

@ -101,7 +101,7 @@ void UDPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int remai
constexpr auto eth_len = 14;
if ( validate_checksum && len > ((int)sizeof(struct udphdr) + vxlan_len + eth_len) && (data[0] & 0x08) == 0x08 ) {
if ( std::find(vxlan_ports.begin(), vxlan_ports.end(), ntohs(up->uh_dport)) != vxlan_ports.end() ) {
if ( std::ranges::find(vxlan_ports, ntohs(up->uh_dport)) != vxlan_ports.end() ) {
// Looks like VXLAN on a well-known port, so the checksum should be
// transmitted as zero, and we should accept that. If not
// transmitted as zero, then validating the checksum is optional.