hc
2024-08-12 33276c6b0b8513a340de65b0ef99993023df46ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <linux/stddef.h>
#include <linux/ipv6.h>
#include <linux/bpf.h>
#include <linux/in.h>
#include <sys/socket.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
 
SEC("freplace/do_bind")
int new_do_bind(struct bpf_sock_addr *ctx)
{
  struct sockaddr_in sa = {};
 
  bpf_bind(ctx, (struct sockaddr *)&sa, sizeof(sa));
  return 0;
}
 
char _license[] SEC("license") = "GPL";