Added --ignore-vlanid / -I to exclude VLAN ids for flow hash calculation. #1073 (#1085)

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni 2020-12-11 21:01:51 +01:00 committed by GitHub
parent edf3a57a6a
commit 74a77e7b3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -779,7 +779,10 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
flow.protocol = iph->protocol, flow.vlan_id = vlan_id;
flow.src_ip = iph->saddr, flow.dst_ip = iph->daddr;
flow.src_port = htons(*sport), flow.dst_port = htons(*dport);
flow.hashval = hashval = flow.protocol + flow.vlan_id + flow.src_ip + flow.dst_ip + flow.src_port + flow.dst_port;
flow.hashval = hashval = flow.protocol + flow.src_ip + flow.dst_ip + flow.src_port + flow.dst_port;
if (workflow->prefs.ignore_vlanid == 0) {
flow.hashval += flow.vlan_id;
}
#if 0
printf("hashval=%u [%u][%u][%u:%u][%u:%u]\n", hashval, flow.protocol, flow.vlan_id,