Giter Club home page Giter Club logo

gamemann / xdp-firewall Goto Github PK

View Code? Open in Web Editor NEW
459.0 23.0 87.0 135 KB

A firewall that utilizes the Linux kernel's XDP hook. The XDP hook allows for very fast network processing on Linux systems. This is great for dropping malicious traffic from a (D)DoS attack. IPv6 is supported with this firewall! I hope this helps network engineers/programmers interested in utilizing XDP!

Home Page: https://deaconn.net/

License: MIT License

C 94.05% Makefile 5.95%
xdp firewall bpf ebpf anti-ddos ddos ddos-protection ddos-mitigation fast fw

xdp-firewall's Introduction

XDP Firewall

XDP Firewall Build Workflow XDP Firewall Run Workflow

Description

A stateless firewall that attaches to the Linux kernel's XDP hook through (e)BPF for fast packet processing. This firewall is designed to read filtering rules based off of a config file on disk and filter incoming packets. Both IPv4 and IPv6 are supported! The protocols currently supported are TCP, UDP, and ICMP. With that said, the program comes with accepted and dropped/blocked packet statistics which may be disabled if need to be.

Additionally, if the host's network configuration or network interface card (NIC) doesn't support the XDP DRV hook (AKA native; occurs before SKB creation), the program will attempt to attach to the XDP SKB hook (AKA generic; occurs after SKB creation which is where IPTables and NFTables are processed via the netfilter kernel module). You may use overrides through the command-line to force SKB or offload modes.

With that said, reasons for a host's network configuration not supporting XDP's DRV hook may be the following.

  • Running an outdated kernel that doesn't support your NIC's driver.
  • Your NIC's driver not yet being supported. Here's a NIC driver XDP support list. With enough Linux kernel development knowledge, you could try implementing XDP DRV support into your non-supported NIC's driver (I'd highly recommend giving this video a watch!).
  • You don't have enough RX/TX queues (e.g. not enabling multi-queue) or your RX/TX queue counts aren't matching. From the information I gathered, it's recommended to have one RX and TX queue per CPU core/thread. You could try learning how to use ethtool and try altering the NIC's RX/TX queue settings (this article may be helpful!).

I hope this project helps existing network engineers/programmers interested in utilizing XDP or anybody interested in getting into those fields! (D)DoS mitigation/prevention is such an important part of Cyber Security and understanding the concept of networking and packet flow on a low-medium level would certainly help those who are pursuing a career in the field 🙂

Command Line Usage

The following command line arguments are supported:

  • --config -c => Location to config file. Default => /etc/xdpfw/xdpfw.conf.
  • --offload -o => Tries to load the XDP program in hardware/offload mode (please read Offload Information below).
  • --skb -s => Forces the program to load in SKB mode instead of DRV.
  • --time -t => How long to run the program for in seconds before exiting. 0 or not set = infinite.
  • --list -l => List all filtering rules scanned from config file.
  • --help -h => Print help menu for command line options.

Offload Information

Offloading your XDP/BPF program to your system's NIC allows for the fastest packet processing you can achieve due to the NIC dropping the packets with its hardware. However, for one, there are not many NIC manufacturers that do support this feature and you're limited to the NIC's memory/processing (e.g. your BPF map sizes will be extremely limited). Additionally, there are usually stricter BPF verifier limitations for offloaded BPF programs, but you may try reaching out to the NIC's manufacturer to see if they will give you a special version of their NIC driver raising these limitations (this is what I did with one manufacturer I used).

As of this time, I am not aware of any NIC manufacturers that will be able to offload this firewall completely to the NIC due to its BPF complexity. To be honest, in the current networking age, I believe it's best to leave offloaded programs to BPF map lookups and minimum packet inspection. For example, a BPF blacklist map lookup for malicious source IPs or ports. However, XDP is still very new and I would imagine we're going to see these limitations loosened or lifted in the next upcoming years. This is why I added support for offload mode on this firewall.

Configuration File Options

Main

  • interface => The interface for the XDP program to attach to.
  • updatetime => How often to update the config and filtering rules. Leaving this at 0 disables auto-updating.
  • nostats => If true, no accepted/blocked packet statistics will be displayed in stdout.

Filters

Config option filters is an array. Each filter includes the following options:

  • enabled => If true, this rule is enabled.
  • action => What action to perform against the packet if matched. 0 = Block. 1 = Allow.
  • srcip => The source IP address the packet must match (e.g. 10.50.0.3).
  • dstip => The destination IP address the packet must match (e.g. 10.50.0.4).
  • srcip6 => The source IPv6 address the packet must match (e.g. fe80::18c4:dfff:fe70:d8a6).
  • dstip6 => The destination IPv6 address the packet must match (e.g. fe80::ac21:14ff:fe4b:3a6d).
  • min_ttl => The minimum TTL (time to live) the packet must match.
  • max_ttl => The maximum TTL (time to live) the packet must match.
  • max_len => The maximum packet length the packet must match. This includes the entire frame (ethernet header, IP header, L4 header, and data).
  • min_len => The minimum packet length the packet must match. This includes the entire frame (ethernet header, IP header, L4 header, and data).
  • tos => The TOS (type of service) the packet must match.
  • pps => The maximum packets per second a source IP can send before matching.
  • bps => The maximum amount of bytes per second a source IP can send before matching.
  • blocktime => The time in seconds to block the source IP if the rule matches and the action is block (0). Default value is 1.

TCP Options

TCP options exist in the main filter array and start with tcp_. Please see below.

  • tcp_enabled => If true, check for TCP-specific matches.
  • tcp_sport => The source port the packet must match.
  • tcp_dport => The destination port the packet must match.
  • tcp_urg => If true, the packet must have the URG flag set to match.
  • tcp_ack => If true, the packet must have the ACK flag set to match.
  • tcp_rst => If true, the packet must have the RST flag set to match.
  • tcp_psh => If true, the packet must have the PSH flag set to match.
  • tcp_syn => If true, the packet must have the SYN flag set to match.
  • tcp_fin => If true, the packet must have the FIN flag set to match.
  • tcp_ece => If true, the packet must have the ECE flag set to match.
  • tcp_cwr => If true, the packet must have the CWR flag set to match.

UDP Options

UDP options exist in the main filter array and start with udp_. Please see below.

  • udp_enabled => If true, check for UDP-specific matches.
  • udp_sport => The source port the packet must match.
  • udp_dport => The destination port the packet must match.

ICMP Options

ICMP options exist in the main filter array and start with icmp_. Please see below.

  • icmp_enabled => If true, check for ICMP-specific matches.
  • icmp_code => The ICMP code the packet must match.
  • icmp_type => The ICMP type the packet must match.

Everything besides the main enabled and action options within a filter are not required. This means you do not have to define them within your config.

Note - As of right now, you can specify up to 80 maximum filters. This is due to BPF's limitations with complexity and jumps. If you want more than 80 filters, you may increase BPF limitations manually or with a patch. If you want to do this, please read this README from my XDP Forwarding project. Afterwards, feel free to raise the MAX_FILTERS constant in the src/xdpfw.h file and then recompile the firewall.

Configuration Example

Here's an example of a config:

interface = "ens18";
updatetime = 15;

filters = (
    {
        enabled = true,
        action = 0,

        udp_enabled = true,
        udp_dport = 27015
    },
    {
        enabled = true,
        action = 1,

        tcp_enabled = true,
        tcp_syn = true,
        tcp_dport = 27015
    },
    {
        enabled = true,
        action = 0,

        icmp_enabled = true,
        icmp_code = 0
    },
    {
        enabled = true,
        action = 0,
        srcip = "10.50.0.4"
    }
);

Building & Installation

Before building, ensure the following packages are installed. These packages are installed via apt (Ubuntu, Debian, etc.), but there should be similar package names in other package managers.

# Install dependencies.
sudo apt install -y libconfig-dev llvm clang libelf-dev build-essential

# Install dependencies for building LibXDP and LibBPF.
sudo apt install -y libpcap-dev m4 gcc-multilib

# You need tools for your kernel since we need BPFTool. If this doesn't work, I'd suggest building BPFTool from source (https://github.com/libbpf/bpftool).
sudo apt install -y linux-tools-$(uname -r)

You can use git and make to build this project. The following should work:

# Clone repository via Git. Use recursive flag to download LibBPF sub-module.
git clone --recursive https://github.com/gamemann/XDP-Firewall.git

# Change directory to repository.
cd XDP-Firewall

# Build XDP-Tools and install LibXDP & LibBPF to /usr/include.
# Warning - This command uses Sudo for root access! 
# Feel free to remove sudo from the Makefile and execute as root otherwise.
make libxdp

# Build main project and install as root via Sudo.
make && sudo make install

Notes

Move To LibXDP

On June 6th, 2023, support for LibXDP from XDP Tools was added. This requires additional packages and tools to install and use with this XDP firewall as noted above.

If you're having issues with LibXDP, you may go back to commit b54c466 to use an older version of LibBPF that has worked for years for this XDP firewall.

# Make sure we're in the repository's directory.
cd XDP-Firewall

# Checkout old commit.
git checkout b54c466

# Build and install using old commit & LibBPF.
make && sudo make install

Issues On Ubuntu 20.04

If you have issues on Ubuntu 20.04 or earlier, please refer to the reply on this issue.

Basically, Clang/LLVM 12 or above is required and I'd recommend running Linux kernel 5.15 or above.

BPF For/While Loop Support + Performance Notes

This project requires for/while loop support with BPF. Older kernels will not support this and output an error such as:

libbpf: load bpf program failed: Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
back-edge from insn 113 to 100

libbpf: -- END LOG --
libbpf: failed to load program 'xdp_prog'
libbpf: failed to load object '/etc/xdpfw/xdpfw_kern.o'

It looks like BPF while/for loop support was added in kernel 5.3. Therefore, you'll need kernel 5.3 or above for this program to run properly.

Performance With For Loops

Due to the usage of a for loop inside the XDP program that handles looping through all filtering rules inside of a BPF array map, performance will be impacted depending on how many filtering rules you have configured (ultimately, the firewall doesn't scale that well). This firewall was designed to be as flexible as possible regarding configuration and is most effective when configured to add malicious source IPs to the block map for a certain amount of time which are then dropped at the beginning of the XDP program for the best performance.

Unfortunately, we can't really eliminate the for loop with the current amount of flexibility we allow (especially minimum/maximum TTL, packet lengths, IDs, etc.), unless if we were to create more BPF maps and insert many more entries which would result in a lot more memory consumed and isn't ideal at all. If we were to remove flexibility, the best approach would be to store filtering rules inside a hashed BPF map using the packet's destination IP/port as the entry's key in my opinion (this would then eliminate flexibility related to being able to specify a filtering rule to match against a single destination IP without a port, unless if we implemented multiple BPF map lookups inside the XDP program which would then impact performance). However, there are currently no plans to switch to this format due to the amount of flexibility lost and also not having the time on my side (if somebody else creates a PR to implement this, I'd be willing to have a separate branch with the new functionality for others to use if the current branch isn't working out for their needs).

The firewall is still decent at filtering non-spoofed attacks, especially when a block time is specified so that malicious IPs are filtered at the beginning of the program for some time.

Error Related To Toolchain Hardening

As stated in issue #38 by g00g1, if you have toolchain hardening enabled, you may receive the following error when compiling.

error: <unknown>:0:0: in function xdp_prog_main i32 (ptr): A call to built-in function '__stack_chk_fail' is not supported.

In order to fix this, you'll need to pass the -fno-stack-protector flag to Clang when building LibBPF and the firewall itself. You'll want to modify the Makefile for each project to add this flag. Patches for this may be found here!

Will You Make This Firewall Stateful?

There is a possibility I may make this firewall stateful in the future when I have time, but this will require a complete overhaul along with implementing application-specific filters. With that said, I am still on contract from my previous employers for certain filters of game servers. If others are willing to contribute to the project and implement these features, feel free to make pull requests!

You may also be interested in this awesome project called FastNetMon!

Other XDP Project(s)

I just wanted to share other project(s) I've made using XDP for those interested.

This XDP project performs basic layer 3/4 forwarding using source port mapping similar to IPTables/NFTables. This is one of my newer projects and still a work in progress. I also feel the code is a lot neater in the XDP Forwarding project.

This is a complex packet processing/forwarding/dropping project I made for a gaming community I was a part of that utilizes XDP, AF_XDP, and the IPIP network protocol. I no longer work on the project, but the source code should be very helpful to other XDP developers, especially when it comes to manipulating packets inside of XDP and such.

Credits

xdp-firewall's People

Contributors

gamemann avatar omicronn88 avatar opensource03 avatar pettai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xdp-firewall's Issues

Build error

I have followed guidance from README but encountered the following error while executing make:
error: <unknown>:0:0: in function xdp_prog_main i32 (ptr): A call to built-in function '__stack_chk_fail' is not supported.

I have also tried to apply fix from #30 (cd libbpf && git checkout 7fc4d50), but that didn't solve the issue.

UPD: The host is AMD Ryzen 5 3600, Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller, gentoo-kernel-6.1.24 built from own config.txt

Segmentation Fault

SetConfigDefaults(conf);

Compiling went fine etc, however attempting to run this after building will segmentation fault at the line specified which I gather is caused by struct config_map *conf = malloc(sizeof(struct config_map));

Any ideas on the cause? This is an awesome project so far, we are currently very limited with IPTable filters in terms of speed and complexity

successful compilation, but xdpfw output errors then starting

Hi,

After successful build and installation on a vanilla Ubuntu 22.04,
running xdpfw doesn't work as intended:

Sys info:

root@bygg-u2204:/home/ubuntu# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

root@bygg-u2204:/home/ubuntu# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether fa:16:3e:88:7b:5f brd ff:ff:ff:ff:ff:ff
    altname enp0s3

Build info:

ubuntu@bygg-u2204:~/XDP-Firewall$ make
mkdir -p build/
clang -O2 -c -o build/config.o src/config.c
clang -O2 -c -o build/cmdline.o src/cmdline.c
make -C modules/xdp-tools
make[1]: Entering directory '/home/ubuntuXDP-Firewall/modules/xdp-tools'
sh configure
Found clang binary 'clang' with version 14 (from 'Ubuntu clang version 14.0.0-1ubuntu1.1')
using /usr/lib/linux-tools/5.15.0-86-generic/bpftool v5.15.122
libbpf support: submodule v1.0.0
  perf_buffer__consume support: yes (submodule)
  btf__load_from_kernel_by_id support: yes (submodule)
  btf__type_cnt support: yes (submodule)
  bpf_object__next_map support: yes (submodule)
  bpf_object__next_program support: yes (submodule)
  bpf_program__insn_cnt support: yes (submodule)
  bpf_program__type support: yes (submodule)
  bpf_program__flags support: yes (submodule)
  bpf_program__expected_attach_type support: yes (submodule)
  bpf_map_create support: yes (submodule)
  perf_buffer__new_raw support: yes (submodule)
  bpf_xdp_attach support: yes (submodule)
  bpf_map__set_autocreate support: yes (submodule)
  bpf_prog_test_run_opts support: yes (submodule)
zlib support: yes
ELF support: yes
pcap support: yes
secure_getenv support: yes

[...]

  INSTALL  ./libbpf.a ./libbpf.so ./libbpf.so.1 ./libbpf.so.1.0.0
make: Leaving directory '/home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libbpf/src'
sudo make -C modules/xdp-tools/lib/libxdp install
make: Entering directory '/home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libxdp'
make: Leaving directory '/home/ubuntu/XDP-Firewall/modules/xdp-tools/lib/libxdp'
mkdir -p build/
clang -lconfig -lelf -lz -lxdp -I modules/xdp-tools/lib/libbpf/src -I /usr/include -I /usr/local/include -o build/xdpfw modules/xdp-tools/lib/libbpf/src/staticobjs/bpf_prog_linfo.o modules/xdp-tools/lib/libbpf/src/staticobjs/bpf.o modules/xdp-tools/lib/libbpf/src/staticobjs/btf_dump.o modules/xdp-tools/lib/libbpf/src/staticobjs/btf.o modules/xdp-tools/lib/libbpf/src/staticobjs/gen_loader.o   modules/xdp-tools/lib/libbpf/src/staticobjs/hashmap.o modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf_errno.o modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf_probes.o  modules/xdp-tools/lib/libbpf/src/staticobjs/libbpf.o modules/xdp-tools/lib/libbpf/src/staticobjs/linker.o modules/xdp-tools/lib/libbpf/src/staticobjs/netlink.o  modules/xdp-tools/lib/libbpf/src/staticobjs/nlattr.o modules/xdp-tools/lib/libbpf/src/staticobjs/relo_core.o modules/xdp-tools/lib/libbpf/src/staticobjs/ringbuf.o modules/xdp-tools/lib/libbpf/src/staticobjs/str_error.o modules/xdp-tools/lib/libbpf/src/staticobjs/strset.o modules/xdp-tools/lib/libbpf/src/staticobjs/usdt.o modules/xdp-tools/lib/libxdp/sharedobjs/xsk.o modules/xdp-tools/lib/libxdp/sharedobjs/libxdp.o build/config.o build/cmdline.o src/xdpfw.c
mkdir -p build/
clang -I modules/xdp-tools/lib/libbpf/src -I /usr/include -I /usr/local/include -D__BPF__ -D __BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign -Wno-compare-distinct-pointer-types -O2 -emit-llvm -c -g -o build/xdpfw_kern.ll src/xdpfw_kern.c
/usr/lib/llvm-14/bin/llc -march=bpf -filetype=obj -o build/xdpfw_kern.o build/xdpfw_kern.ll

XDPFW info:

root@bygg-u2204:/home/ubuntu# cat /etc/xdpfw/xdpfw.conf
interface = "ens3";
updatetime = 0;

filters = (
    {
        enabled = true,
        action = 1
    }
);

root@bygg-u2204:/home/ubuntu# xdpfw -c /etc/xdpfw/xdpfw.conf
libbpf: elf: skipping unrecognized data section(7) .xdp_run_config
libbpf: elf: skipping unrecognized data section(8) xdp_metadata
libbpf: elf: skipping unrecognized data section(23) .eh_frame
libbpf: elf: skipping relo section(24) .rel.eh_frame for section(23) .eh_frame
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument
libbpf: prog 'xdp_pass': failed to load: -22
libbpf: failed to load object '/usr/local/lib/bpf/xdp-dispatcher.o'
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
^C

Daemon mode doesn't unload xdp when service stopped

Hi, really nice work you did. I find this tool very useful.
However, I noticed that when I start it via systemd service the xdp program doesn't get unloaded from an interface after I stopped it, hence the firewall continues working.
I fixed it by adding this line in the systemd unit but I don't know if it's the best solution
ExecStopPost=/bin/bash -c "/bin/ip link set dev $(grep -E ^interface /etc/xdpfw/xdpfw.conf | sed -En 's/^.+=|[\"; ]//gp') xdp off"

[Question] Loop, BPF MAP and xdp-filter

Disclaimer: I'm very new to eBPF and XDP and know very little about C.

Hello sir!

I'm willig to make a simple stateless "in the middle firewall" (I forgot the formal term :( ) using XDP, and was looking your code and also xdp-filter example¹.

I don't get why you are using loop² to look for the filters (and than having the 100 rules limit). Shouldn't you create a BPF MAP with the filters and use the lookup to find the rule in it like in the xdp-filter example³ and than get rid of the loop?

I have some requirements for this firewall I'm willing to make and would like your opinion about it (if you can, of course!). I was intended to extend the xdp-filter example for this, but your code looks so simple and already have many features that I wanted. Maybe I can try to help you extending your solution, but I think that xdp-filter code looks more structured and more easy to extend.

What do you think?


Simple 'diagram':
INSIDE NET <-> XDP FW <-> EXTERNAL NET

Current requirements:

-> Must match IP/Mask ranges/subnets (eg.: 192.168.0.0/24).
-> Must support IPv4, IPv6, ICMPv4, TCP and UDP.
-> Must support classic tuples (source ip, destination ip, source port, destination port, protocol). "any" keyword matches for anything.
    -> for ICMP: source ip, destination ip, code, type.
-> Must have permit/deny keyword on each rule.
-> Must match TCP flags.
-> Must have a "established" keyword: Accept TCP segments with ONLY ACK *OR* RST flags set. (only matters on the "API")
-> Must load rules from JSON file.
-> Must specify in (internal) and out (external) interfaces. (Routed Traffic, without full router capability).
    -> Must specify destination MAC Address for nexthop. (or get automated based on IP/ARP). - less processing on XDP program (does not need to have specific kernel lookup functions, just change the dst MAC)
    -> Will not have multiple destinations, specific routings or LB.

-> May have an API to write JSON rules file and reload rules.
-> May have a simple HTML interface talking to the API.
-> May have mutiple maps for each protocol (IP, UDP, TCP, ICMP, etc.) to enhance lookup performace. Is it doable?
-> (doesn't matter - just a note) May not have an IP address at in/out interfaces. XDP only cares about received packet on wire. Doesn't matter IP on interface neither MAC address.

Future:
-> NAT: 1-p-1 and n-p-1(PAT). Can be a separate program that can also be run on a different machine for more performance.
-> CONNTRACK or similar map before inspecting list of rules.

Thanks!


1- https://github.com/xdp-project/xdp-tools/tree/master/xdp-filter
2- https://github.com/gamemann/XDP-Firewall/blob/master/src/xdpfw_kern.c#L330
3- https://github.com/xdp-project/xdp-tools/blob/master/xdp-filter/xdpfilt_prog.h#L67

Min, Max Length matcher behavior

As your readme file state,

max_len: The maximum packet length the packet must match. This includes the entire frame...
min_len: The minimum packet length the packet must match. This includes the entire frame...

My expected behavior is when specific min and max length (eg. 100, 500), It should be matching packet size between 100-500.
But it seem to be other way around, When specific min_len with 100 it's matching every packet that have size lower than 100.
Also for max_len it matching packet that have size above the setting.

Is this expected behavior or my expectation is wrong?

After browsing the code, It's seem to occur with TTL as well.
https://github.com/gamemann/XDP-Firewall/blob/master/src/xdpfw_kern.c#L440

Improve the TCP flags checking process

Hello, I noticed that while filtering the packets, the filter check all TCP flags one after another.

I think we can make use of the tcp_flag_word() macro and TCP_FLAG_* defined in <linux/tcp.h> to simplify the process of checking flags.

Flags TCP ECE/CWR

Hello, I would like to ask you a question.
Why haven't you added the TCP ECE and CWR flags?

I've tried adding them manually and compiling it again, it seems to work, but I'm still not sure, I'm doing some tests.

Minimum kernel version?

This project requires for/while loop support with BPF. Older kernels will not support this

What is the minimum kernel version that supports this?

[Feature Request] Blacklist file

Your config file format is fine for a small number of entries but becomes a bit verbose for large block lists. Would it be possible to update the config format to support referencing an external file of IP addresses and CIDR ranges (example: https://github.com/firehol/blocklist-ipsets/blob/master/xroxy_30d.ipset )? It would essentially ignore any line that begins with # and then loop through each IP (expanding the CIDR entries) to set srcip and dstip and a high blocktime for all ports. For now, I'm creating a quick convert script that converts the list into the correct config format to test the performance impact (I'm hoping eBPF has better performance than iptable's ipset).

Customise This Program For My Requirements

Is it possible to add The Following To This Program Custom For My Needs Such As ; Layer 3. The rest of the tcp flags. Port ranges. Ip ranges. States and packet tracking. I will pay You If You Could Do That .

[Feature Request] New settings/things

Hello, Great project!!

I'm currently new in EBPF/XDP, so I have some questions:

  1. Can you add a feature like iptables "-m string --algo kmp --hex-string" like to match string/hex string?
  2. I see this is something like a standalone XDP Firewall (Can you give some advice to guys like me, how we can use it with iptables or what we have to do to match some specific rules like one above) I am currently new to this EBPF/XDP.
  3. I'm currently using it for gameservers and If I set port 27015 udp with pps like 10-15/s It will drop the whole connection.

Sorry If this is not for here. I am really a newbie in XDP...

Cidr/Subnet support & Some small things

Hello, is it possible to add a Cidr/subnet support?
Like: 11.11.11.11/22 or ip/24
A whitelist for certain ips would be also good.
Some statistics for dropped packets like a gui or dropped packets per sec while attack is going on would be also good.
Awsome project. Keep it up :)

Loading xdpfw in offload/hardware mode

when trying to load the xdpfw program using offload/hardware mode using the command xdpfw --offload i get the error

libbpf: map 'filters_map': failed to create: Invalid argument(-22)
libbpf: failed to load object '/etc/xdpfw/xdpfw_kern.o'
Could not load XDP BPF program :: Invalid argument.
Error loading eBPF object file. File name => /etc/xdpfw/xdpfw_kern.o.

Do you Know How to fix this error so it will load in offload/hardware mode?

igb driver not recognized by XDP

I have managed to run XDP in generic mode, however, it should run in native mode since igb driver should be supported.

Driver:

lspci

01:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

find /sys | grep drivers.*01:00

/sys/bus/platform/drivers/ipmi_si/IPI0001:00
/sys/bus/pci/drivers/igb/0000:01:00.0
/sys/bus/pci/drivers/igb/0000:01:00.1

After service xdpfw restart

Nov 23 15:17:31 hp1007 systemd[1]: Started XDP Firewall tool..
Nov 23 15:17:33 hp1007 xdpfw[7774]: libbpf: Kernel error message: underlying driver does not support XDP in native mode
Nov 23 15:17:33 hp1007 xdpfw[7774]: Could not attach with DRV/native mode (Operation not supported)(-95).
Nov 23 15:17:34 hp1007 xdpfw[7774]: Loaded XDP program in SKB/generic mode.

Error attaching XDP program :: Invalid argument (22)

I get the following error when trying to start xdpfw:

Could not attach with DRV/native mode (Invalid argument)(-22).
Could not attach with SKB/generic mode (Invalid argument)(-22).
Error attaching XDP program :: Invalid argument (22)

uname -r

5.4.0-72-generic

journalctl -xe

Nov 20 10:23:44 hp1007 xdpfw[1706]: Could not attach with DRV/native mode (Invalid argument)(-22).
Nov 20 10:23:44 hp1007 xdpfw[1706]: Could not attach with SKB/generic mode (Invalid argument)(-22).
Nov 20 10:23:44 hp1007 xdpfw[1706]: Error attaching XDP program :: Invalid argument (22)
Nov 20 10:23:44 hp1007 systemd[1]: xdpfw.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 10:23:44 hp1007 systemd[1]: xdpfw.service: Failed with result 'exit-code'.
Nov 20 10:23:45 hp1007 systemd[1]: xdpfw.service: Service hold-off time over, scheduling restart.
Nov 20 10:23:45 hp1007 systemd[1]: xdpfw.service: Scheduled restart job, restart counter is at 4.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit xdpfw.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Nov 20 10:23:45 hp1007 systemd[1]: Stopped XDP Firewall tool..
-- Subject: Unit xdpfw.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit xdpfw.service has finished shutting down.
Nov 20 10:23:45 hp1007 systemd[1]: Started XDP Firewall tool..
-- Subject: Unit xdpfw.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit xdpfw.service has finished starting up.
-- 
-- The start-up result is RESULT.

usage

I am trying to use this firewall but i could not understand completely, first I install
image
I open config file /etc/xdpfw/xdpfw.conf
and change it to
interface = "eno1";
updatetime = 0;

filters = (
{
enabled = true,
action = 0,
srcip = "103.22.221.170"
dstip = "103.22.221.170"
}
);

then I was assuming that the packets coming from 103.22.221.170 should be blocked.

then I capture packets from tcpdump from eno1

image

but still i am seeing packets from 103.22.221.170.

but i wanna block that IP 103.22.221.170 packets....

I am missing something or could not understand this?

this project have problem botnet attack 50-100Mpps

i have problem ddos attack 50-100mpps

xdp-firewall drop all connection is not processing.

{
    enabled = true,
    action = 0,

    udp_enabled = true,
    pps = 500,
    blocktime = 300
}

drop only 988 packet every have attack.

how to fix or optimize?

Quickstart guide?

Is there a quickstart guide to test basic functionality? Here's mine, which isn't working as expected:

apt install -y dnsutils

EXAMPLEIP=$(dig +short example.com)

cat > /etc/xdpfw/xdpfw.conf <<EOF
interface = "eth0";
updatetime = 15;
filters = (
    {
        enabled = true,
        dstip = "${EXAMPLEIP}",
        action = 0
    }
);
EOF

service xdpfw restart

curl -s -L -m 5 http://example.com | grep -q illustrative && echo FAIL || echo PASS

FAIL

A few questions

Hello, I'm trying to use this firewall to protect my HLDS server against attacks. Below is my xdpfw.conf file

interface = "eth0";
updatetime = 15;

filters = (
    {
        enabled = true,
        action = 0,
        pps = 10000,
        blocktime = 600,
        udp_enabled = true,
        udp_dport = 27015
    }
);

Is this config correct or will i need to do some changes as at the moment I'm trying to test it alone, below is what I see after starting the process. Even though I connect to the server I don't see any changes in Packets Allowed nor Packets dropped

root@ip-172-26-1-240:/etc/xdpfw# sudo xdpfw
libbpf: Kernel error message: Underlying driver does not support XDP in native mode
Could not attach with DRV/native mode (Operation not supported)(-95).
Loaded XDP program in SKB/generic mode.
Packets Allowed: 0 | Packets Dropped: 0

Also how do I get back to see the stats if I use Ctrl+C or Ctrl+Z to exit from the program. Using screen doesn't seem to work, program runs but screen doesnt. Even if I stop the service with systemctl to test again with a different config, I cannot run the program again as it says it's already running.

Thank you.

Ubuntu 22 and Ubuntu 20 failed to load dispatcher and xdp_pass

libbpf: elf: skipping unrecognized data section(7) .xdp_run_config
libbpf: elf: skipping unrecognized data section(8) xdp_metadata
libbpf: elf: skipping unrecognized data section(19) .eh_frame
libbpf: elf: skipping relo section(20) .rel.eh_frame for section(19) .eh_frame
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument
libbpf: prog 'xdp_pass': failed to load: -22
libbpf: failed to load object '/usr/local/lib/bpf/xdp-dispatcher.o'
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_pass': BPF program load failed: Argument list too long
libbpf: prog 'xdp_pass': failed to load: -7
libbpf: failed to load object '/usr/local/lib/bpf/xdp-dispatcher.o'
libxdp: Compatibility check for dispatcher program failed: Argument list too long
libxdp: Falling back to loading single prog without dispatcher
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument
libbpf: prog 'xdp_pass': failed to load: -22
libbpf: failed to load object '/usr/local/lib/bpf/xdp-dispatcher.o'

not support native?

Hi,this is my host info:
Linux ubuntu 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

build successful!

but, when i run xdpfm,it‘s appear:
# sudo xdpfw --time 60 libbpf: elf: skipping unrecognized data section(7) .xdp_run_config libbpf: elf: skipping unrecognized data section(8) xdp_metadata libbpf: elf: skipping unrecognized data section(23) .eh_frame libbpf: elf: skipping relo section(24) .rel.eh_frame for section(23) .eh_frame libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: Kernel error message: Underlying driver does not support XDP in native mode libxdp: Error attaching XDP program to ifindex 2: Operation not supported libxdp: XDP mode not supported; try using SKB mode Could not attach with mode DRV/native (Operation not supported) (95). libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: elf: skipping unrecognized data section(7) xdp_metadata Loaded XDP program on mode SKB/generic.

ifconfig:
`br-a4f7ea97f505: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 02:42:60:27:1f:b9 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 02:42:36:51:7a:4d txqueuelen 0 (Ethernet)
RX packets 332160 bytes 13680273 (13.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 574919 bytes 1747954660 (1.7 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.186.131 netmask 255.255.255.0 broadcast 192.168.186.255
inet6 fe80::993a:5a4:2f56:8390 prefixlen 64 scopeid 0x20
ether 00:0c:29:32:0b:3b txqueuelen 1000 (Ethernet)
RX packets 2408705 bytes 3211033293 (3.2 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 736981 bytes 120613148 (120.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 10353 bytes 1084265 (1.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10353 bytes 1084265 (1.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
`

xdpfw.conf:
`interface = "ens33";
updatetime = 15;

filters = (
{
enabled = true,
action = 0,

    udp_enabled = true,
    udp_dport = 27015
},
{
    enabled = true,
    action = 1,

    tcp_enabled = true,
    tcp_syn = true,
    tcp_dport = 27015
},
{
    enabled = true,
    action = 0,

    icmp_enabled = true,
    icmp_code = 0
}

);
`

so, but why? i hope i can get help...thanks!

LibBPF fails to load xdp_prog

I am sorry to bother you once more again, but since my previous issue (#38) I have tried to change environment where I am trying to evaluate and hack on this project.

The new host is:
CPU: 2x Intel(R) Xeon(R) Silver 4208
NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ (i40e)
Kernel: 5.14.0-70.13.1.el9_0.x86_64

I have successfully built xdpfw, but when running xdpfw -t 5 I have encountered LibBPF error, full log is attached below

xdpfw.txt

UPD: exactly the same behavior was reproduced on another machine (as in issue #38)

filter doesnt work

HEY!

sorry to bother you but the PPS filtering doesnt work or does not work properly. The strictest but most effective PPS limit which is 2500 does not filter anything, but in fact lets more traffic through then even block. with my following configuration:

interface = "eno1";
updatetime = 15;
filters = (

{
    enabled = true,
    action = 0,
    pps = 2500,
    bps = 500,
    blocktime = 1000
}

);

it does not even block anything.

Can you please help me understand why its not doing what its meant to do if its meant to help filter.

thank you.

-Johanson

Add feature to block invalid arps ?

First of all, thank you very much for taking the time to maintain this project. This project has been very helpful to me in the past period of time, not only because of the effect of the project, but also because I have learned a lot of relevant knowledge.

In recent studies, I found that xdp seems to be used to block arp requests. Considering the current proliferation of intranet broadcasts, is it possible to use xdp to write an arp whitelist and reject all arp requests that are not local requests?

for example:

10:58:36.239557 ARP, Request who-has 185.200.66.205 tell 185.200.66.1, length 46
10:58:36.246846 ARP, Request who-has 45.142.125.242.static.xtom.com tell 45.142.125.1.static.xtom.com, length 46
10:58:36.248497 ARP, Request who-has 45.142.126.65.static.xtom.com tell 45.142.126.1.static.xtom.com, length 46
10:58:36.250049 ARP, Request who-has 185.200.64.219.static.v.ps tell 185.200.64.1, length 46
10:58:36.251387 ARP, Request who-has 103.201.130.79.static.v.ps tell rg02nrt.v.ps, length 46
10:58:36.252702 ARP, Request who-has 45.142.125.243.static.xtom.com tell 45.142.125.1.static.xtom.com, length 46
10:58:36.253984 ARP, Request who-has 45.142.125.209.static.xtom.com tell 45.142.125.1.static.xtom.com, length 46
10:58:36.255239 ARP, Request who-has 185.200.64.63.static.v.ps tell 185.200.64.1, length 46
10:58:36.256391 ARP, Request who-has 45.142.125.140.static.xtom.com tell 45.142.125.1.static.xtom.com, length 46
10:58:36.257599 ARP, Request who-has 185.200.66.181 tell 185.200.66.1, length 46

Among the bunch of arp requests above, none of them are actually my IP.

Although the kernel will ignore these invalid requests, if it can be implemented using xdp, will the performance be better? My knowledge in this area is relatively lacking, please correct me if there is anything wrong.

Thanks again in advance.

How to check for stats

Hello, thank you really much for this great work.

I'm sorry for the newbie question, but I was wondering how could I display how many packets the firewall either dropped or accepted.

Tried to run cat /proc/<pID>/fd/1 but it returns "No such device or address"

Do you have any drifts? Thanks

New Update can't make

root@filter:/XDP-Firewall# make
mkdir -p build/
clang -O2 -c -o build/config.o src/config.c
clang -O2 -c -o build/cmdline.o src/cmdline.c
make -C modules/xdp-tools
make[1]: Entering directory '/root/XDP-Firewall/modules/xdp-tools'
sh configure
Found clang binary 'clang' with version 11 (from 'Ubuntu clang version 11.1.0-++20211011094159+1fdec59bffc1-1
exp120211011214622.5')
bpftool doesn't support skeleton generation
make[1]: *** [Makefile:49: config.mk] Error 1
make[1]: Leaving directory '/root/XDP-Firewall/modules/xdp-tools'
make: *** [Makefile:75: libxdp] Error 2
root@filter:
/XDP-Firewall# make libxdp
make -C modules/xdp-tools
make[1]: Entering directory '/root/XDP-Firewall/modules/xdp-tools'
sh configure
Found clang binary 'clang' with version 11 (from 'Ubuntu clang version 11.1.0-++20211011094159+1fdec59bffc1-1exp120211011214622.5')
bpftool doesn't support skeleton generation
make[1]: *** [Makefile:49: config.mk] Error 1
make[1]: Leaving directory '/root/XDP-Firewall/modules/xdp-tools'
make: *** [Makefile:75: libxdp] Error 2
root@filter:~/XDP-Firewall#

Adding some features for prevent DDoS

This project is awesome.

I'm looking for Prevention DDoS using XDP Firewall.

Can you add Threshold?

Set Max Throughput and automatically write WhiteListed IPs while under Max Throughtput.

in this case, when DDoS Occurred, WhiteListed IPs can connect to server and others will not.

this will be good and helpful features for Home and Small Buisiness Users.

VLAN mode? Several interfaces possible?

Hi,
i'm looking for a XDP solution to drop unwanted traffic when needed (like a DDoS) which is easy to handle. So i came to your firewall solution.
We will have several VLAN interfaces on a single bond (with 4 interfaces). If i load the filter for a VLAN interface everything is working as expected except XDP is running in skb and not in native mode but i think that is an issue which cannot get handled because it's not a physical interface, am i right?
And two more questions:

  • Is it possible to load a filter to more than one interface? I didn't get it working
  • Do you plan a "statistic" feature so it's possible to check is everything is working, check whole drops, check drops per second?

Thank you for your work :)
Andi

An error

Hello there!

Trying to execute make command, I'm getting the following error:

root@ubuntu-s-1vcpu-1gb-amd-lon1-01:~/XDP-Firewall# make
mkdir -p build/
clang -O2 -c -o build/config.o src/config.c
clang -O2 -c -o build/cmdline.o src/cmdline.c
make -C libbpf/src
make[1]: Entering directory '/root/XDP-Firewall/libbpf/src'
cc -I. -I../include -I../include/uapi -DCOMPAT_NEED_REALLOCARRAY -g -O2 -Werror -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64   -c libbpf.c -o staticobjs/libbpf.o
In file included from libbpf.c:47:
../include/tools/libc_compat.h:11:21: error: static declaration of 'reallocarray' follows non-static declaration
static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
                    ^
/usr/include/stdlib.h:559:14: note: previous declaration is here
extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
             ^
1 error generated.
make[1]: *** [Makefile:102: staticobjs/libbpf.o] Error 1
make[1]: Leaving directory '/root/XDP-Firewall/libbpf/src'
make: *** [Makefile:43: libbpf] Error 2

I installed all the required dependencies:

root@ubuntu-s-1vcpu-1gb-amd-lon1-01:~/XDP-Firewall# apt install libconfig-dev llvm clang libelf-dev make
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libelf-dev is already the newest version (0.176-1.1build1).
make is already the newest version (4.2.1-1.2).
clang is already the newest version (1:10.0-50~exp1).
libconfig-dev is already the newest version (1.5-0.4build1).
llvm is already the newest version (1:10.0-50~exp1).
0 upgraded, 0 newly installed, 0 to remove and 34 not upgraded.

OS: Ubuntu 20.04

not drop

{
    enabled = true,
    action = 0,

    udp_enabled = true,
    udp_dport = 30120,
    min_len = 0,
    max_len = 35
},

why not dropped? server have attack length 28

libbpf ERRO

ubuntu@ubunu2004:~/Desktop/XDP-Firewall$ sudo xdpfw -s
libbpf: elf: skipping unrecognized data section(8) .xdp_run_config
libbpf: elf: skipping unrecognized data section(9) xdp_metadata
libbpf: elf: skipping unrecognized data section(20) .eh_frame
libbpf: elf: skipping relo section(21) .rel.eh_frame for section(20) .eh_frame
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument
libbpf: prog 'xdp_pass': failed to load: -22
libbpf: failed to load object '/usr/local/lib/bpf/xdp-dispatcher.o'
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
Loaded XDP program on mode SKB/generic.
Packets Allowed: 0 | Packets Dropped: 0

Is that correctly working? should I ignore these above?

Blocking (All Protocols, not just TCP) Traffic Problem performing Deep Packet Inspection with eBPF

Working on a project using AF_XDP for both monitoring and filtering purposes.

I have below code on eBPF side. And also has userspace written by GoLang. With the userspace programming, I want to manipulate or modify a packet at the Ethernet/IPv4/TCP layers and then send it to the kernel. This way, for example, I can block it. I actually found that when I segmented the packet into Ethernet, IPv4, and TCP layers in the user space, setting TCP.rst = true, recalculating the checksum, modifying the packet, it worked, but not stable actually. I could send a TCP Connection Reset this way. However, this approach only applies to TCP.eBPF Packet Analysis and Blocking Implementation

I want to experiment with the scenario where TCP.rst = false, then block it. So with that way, I can block all the protocols included for example UDP in user space writing packet to socket.

SEC("xdp_sock")
int xdp_sock_prog(struct xdp_md *ctx) {
  int index = ctx->rx_queue_index;
  // L2
  __u32 *pkt_count;
  pkt_count = bpf_map_lookup_elem(&xdp_stats_map, &index);
  if (pkt_count) {
      /* We pass every other packet */
      if ((*pkt_count)++ & 1)
          return XDP_PASS;
  }
  /* A set entry here means that the correspnding queue_id
    * has an active AF_XDP socket bound to it. */
    if (bpf_map_lookup_elem(&xsks_map, &index)){
        return bpf_redirect_map(&xsks_map, index, 0);
    }
  return XDP_PASS;
}

Build issues

Hi Christian,

I'm trying to build the repo on debian 11 / Kernel 5.10.0-19-amd64 like this:

git clone https://github.com/gamemann/XDP-Firewall.git
cd XDP-Firewall
apt install clang libconfig++-dev
git clone https://github.com/libbpf/libbpf
cd libbpf/src
make
cd ../../

Unfortunately, I'm hitting a build error:

# make
mkdir -p build/
clang -O2 -c -o build/config.o src/config.c
clang -O2 -c -o build/cmdline.o src/cmdline.c
make -C libbpf/src
make[1]: Entering directory '/root/XDP-Firewall/libbpf/src'
make[1]: Leaving directory '/root/XDP-Firewall/libbpf/src'
mkdir -p build/
clang -lconfig -lelf -lz -I libbpf/src -o build/xdpfw libbpf/src/staticobjs/bpf_prog_linfo.o libbpf/src/staticobjs/bpf.o libbpf/src/staticobjs/btf_dump.o libbpf/src/staticobjs/btf.o libbpf/src/staticobjs/hashmap.o libbpf/src/staticobjs/libbpf_errno.o libbpf/src/staticobjs/libbpf_probes.o libbpf/src/staticobjs/libbpf.o libbpf/src/staticobjs/netlink.o libbpf/src/staticobjs/nlattr.o libbpf/src/staticobjs/str_error.o  libbpf/src/staticobjs/xsk.o build/config.o build/cmdline.o src/xdpfw.c
clang: error: no such file or directory: 'libbpf/src/staticobjs/xsk.o'
make: *** [Makefile:33: xdpfw] Error 1

Any hints on this? Could you share how you're building?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.