1 --- open62541-1.3.3/plugins/ua_pubsub_ethernet.c.orig 2022-08-03 10:12:48.000000000 +0200
2 +++ open62541-1.3.3/plugins/ua_pubsub_ethernet.c 2022-10-23 19:33:13.718556139 +0200
3 @@ -43,7 +43,7 @@ static UA_THREAD_LOCAL UA_Byte ReceiveMs
4 #include <linux/if_link.h>
6 #if defined __has_include
7 -# if __has_include(<bpf/bpf.h>) && __has_include(<bpf/libbpf.h>) && __has_include(<bpf/xsk.h>)
8 +# if __has_include(<bpf/bpf.h>) && __has_include(<bpf/libbpf.h>) && __has_include(<xdp/xsk.h>)
12 @@ -51,7 +51,7 @@ static UA_THREAD_LOCAL UA_Byte ReceiveMs
16 -# include <bpf/xsk.h>
17 +# include <xdp/xsk.h>
21 @@ -292,7 +292,7 @@ static xdpsock *xsk_configure(xdp_umem *
23 if (!xdp_socket->umem) {
24 UA_close(xsk_socket__fd(xdp_socket->xskfd));
25 - bpf_set_link_xdp_fd(ifindex, -1, xdp_flags);
26 + bpf_xdp_attach(ifindex, -1, xdp_flags, NULL);
30 @@ -335,13 +335,13 @@ static xdpsock *xsk_configure(xdp_umem *
31 (void)xsk_umem__delete(xdp_socket->umem->umem);
32 UA_free(xdp_socket->umem);
33 UA_close(xsk_socket__fd(xdp_socket->xskfd));
34 - bpf_set_link_xdp_fd(ifindex, -1, xdp_flags);
35 + bpf_xdp_attach(ifindex, -1, xdp_flags, NULL);
41 - ret = bpf_get_link_xdp_id(ifindex, &xdp_socket->bpf_prog_id, xdp_flags);
42 + ret = bpf_xdp_query_id(ifindex, (int)xdp_flags, &xdp_socket->bpf_prog_id);
44 UA_LOG_ERROR (UA_Log_Stdout, UA_LOGCATEGORY_SERVER,
45 "PubSub Connection creation failed. Unable to retrieve XDP program.");
46 @@ -349,7 +349,7 @@ static xdpsock *xsk_configure(xdp_umem *
47 (void)xsk_umem__delete(xdp_socket->umem->umem);
48 UA_free(xdp_socket->umem);
49 UA_close(xsk_socket__fd(xdp_socket->xskfd));
50 - bpf_set_link_xdp_fd(ifindex, -1, xdp_flags);
51 + bpf_xdp_attach(ifindex, -1, xdp_flags, NULL);
55 @@ -378,8 +378,8 @@ UA_PubSubChannelEthernetXDP_open(UA_PubS
56 sockOptions->xdp_bind_flags);
57 if(!channelDataEthernet->xdpsocket) {
58 UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "XDP Socket configuration failed");
59 - bpf_set_link_xdp_fd(channelDataEthernet->ifindex, -1,
60 - sockOptions->xdp_flags);
61 + bpf_xdp_attach(channelDataEthernet->ifindex, -1,
62 + sockOptions->xdp_flags, NULL);
63 return UA_STATUSCODE_BADINTERNALERROR;
66 @@ -477,7 +477,7 @@ UA_PubSubChannelEthernetXDP_receive(UA_P
73 xdp_socket = channelDataEthernet->xdpsocket;
75 @@ -1283,7 +1283,7 @@ UA_PubSubChannelEthernet_close(UA_PubSub
76 xsk_socket__delete(channelDataEthernet->xdpsocket->xskfd);
77 (void)xsk_umem__delete(channelDataEthernet->xdpsocket->umem->umem);
78 /* Detach XDP program from the interface */
79 - bpf_set_link_xdp_fd(channelDataEthernet->ifindex, -1, channelDataEthernet->xdp_flags);
80 + bpf_xdp_attach(channelDataEthernet->ifindex, -1, channelDataEthernet->xdp_flags, NULL);
81 UA_free(channelDataEthernet->xdpsocket->umem->buffer);
82 UA_free(channelDataEthernet->xdpsocket->umem);
83 UA_free(channelDataEthernet->xdpsocket);