1 // SPDX-License-Identifier: GPL-2.0 2 3 #include "vmlinux.h" 4 #include <bpf/bpf_helpers.h> 5 #include "bpf_misc.h" 6 7 SEC("lwt_xmit") 8 __success __retval(0) 9 int test_missing_dst(struct __sk_buff *skb) 10 { 11 struct iphdr iph; 12 13 __builtin_memset(&iph, 0, sizeof(struct iphdr)); 14 iph.ihl = 5; 15 iph.version = 4; 16 17 bpf_lwt_push_encap(skb, BPF_LWT_ENCAP_IP, &iph, sizeof(struct iphdr)); 18 19 return 0; 20 } 21 22 char _license[] SEC("license") = "GPL"; 23