Add option to disable IPv6 to speed up performance of XDP program.
This commit is contained in:
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
log_msg(&cfg, 3, 0, "BPF map 'map_block' pinned to '%s/map_block'.", XDP_MAP_PIN_DIR);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
if ((ret = pin_bpf_map(obj, XDP_MAP_PIN_DIR, "map_block6")) != 0)
|
||||
{
|
||||
log_msg(&cfg, 1, 0, "[WARNING] Failed to pin 'map_block6' to file system (%d)...", ret);
|
||||
@@ -330,6 +330,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
log_msg(&cfg, 3, 0, "BPF map 'map_block6' pinned to '%s/map_block6'.", XDP_MAP_PIN_DIR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_IP_RANGE_DROP
|
||||
// Pin the IPv4 range drop map.
|
||||
|
||||
@@ -304,7 +304,8 @@ int update_filter(int map_filters, filter_rule_cfg_t* filter_cfg, int idx)
|
||||
filter.ip.dst_ip = ip_range.ip;
|
||||
filter.ip.dst_cidr = ip_range.cidr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
if (filter_cfg->ip.src_ip6)
|
||||
{
|
||||
struct in6_addr in;
|
||||
@@ -322,6 +323,7 @@ int update_filter(int map_filters, filter_rule_cfg_t* filter_cfg, int idx)
|
||||
|
||||
memcpy(filter.ip.dst_ip6, in.__in6_u.__u6_addr32, 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (filter_cfg->ip.min_ttl > -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user