summaryrefslogtreecommitdiff
path: root/overlays/preserve-dscp/kern_env.patch
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2023-03-10 22:36:47 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2023-03-10 22:36:47 +0100
commit5d45ddbfaa44d29eb6077153248806d73ceabde9 (patch)
treef6563406cdd540062a0ece5c4c540d0a9cf5572f /overlays/preserve-dscp/kern_env.patch
parentc2fbcde4449ffaf798f9ba4f742b942d33a1c1c8 (diff)
downloadnixos-5d45ddbfaa44d29eb6077153248806d73ceabde9.tar
nixos-5d45ddbfaa44d29eb6077153248806d73ceabde9.tar.gz
nixos-5d45ddbfaa44d29eb6077153248806d73ceabde9.tar.bz2
nixos-5d45ddbfaa44d29eb6077153248806d73ceabde9.tar.xz
nixos-5d45ddbfaa44d29eb6077153248806d73ceabde9.zip
surtr: bifrost dscp
Diffstat (limited to 'overlays/preserve-dscp/kern_env.patch')
-rw-r--r--overlays/preserve-dscp/kern_env.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/overlays/preserve-dscp/kern_env.patch b/overlays/preserve-dscp/kern_env.patch
new file mode 100644
index 00000000..7fe57b19
--- /dev/null
+++ b/overlays/preserve-dscp/kern_env.patch
@@ -0,0 +1,24 @@
1diff --git a/preserve-dscp/preserve-dscp.c b/preserve-dscp/preserve-dscp.c
2index 8c66186..5916fc5 100644
3--- a/preserve-dscp/preserve-dscp.c
4+++ b/preserve-dscp/preserve-dscp.c
5@@ -13,7 +13,7 @@
6
7 int main(int argc, char *argv[])
8 {
9- const char *filename = "preserve_dscp_kern.o";
10+ char *filename = 0;
11 char *ifname_pre, *ifname_post;
12 int ifindex_pre, ifindex_post;
13 struct bpf_map *map = NULL;
14@@ -26,6 +26,10 @@ int main(int argc, char *argv[])
15 DECLARE_LIBBPF_OPTS(bpf_tc_opts, attach_post);
16
17
18+ if (!(filename = getenv("PRESERVE_DSCP_KERN")))
19+ filename = "preserve_dscp_kern.o";
20+
21+
22 if (argc < 3) {
23 fprintf(stderr, "Usage: %s <if pre> <if post> [--unload]\n", argv[0]);
24 return 1;