Linux jobworks 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:53:05 UTC 2026 x86_64
Apache/2.4.58 (Ubuntu)
Server IP : 10.0.1.5 & Your IP : 216.73.217.52
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
linux-headers-6.8.0-136 /
include /
net /
Delete
Unzip
Name
Size
Permission
Date
Action
9p
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
bluetooth
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
caif
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
iucv
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
mana
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
netfilter
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
netns
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
nfc
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
page_pool
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
phonet
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
sctp
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
tc_act
[ DIR ]
drwxr-xr-x
2026-07-17 06:29
6lowpan.h
10.03
KB
-rw-r--r--
2024-03-10 20:38
Space.h
455
B
-rw-r--r--
2024-03-10 20:38
act_api.h
9.35
KB
-rw-r--r--
2026-07-01 19:48
addrconf.h
14.28
KB
-rw-r--r--
2026-07-01 19:48
af_ieee802154.h
1.19
KB
-rw-r--r--
2024-03-10 20:38
af_rxrpc.h
3.3
KB
-rw-r--r--
2024-03-10 20:38
af_unix.h
3.76
KB
-rw-r--r--
2026-07-01 19:48
af_vsock.h
8.41
KB
-rw-r--r--
2026-07-01 19:48
ah.h
382
B
-rw-r--r--
2024-03-10 20:38
amt.h
8.35
KB
-rw-r--r--
2024-03-10 20:38
arp.h
1.95
KB
-rw-r--r--
2024-03-10 20:38
atmclip.h
1.48
KB
-rw-r--r--
2024-03-10 20:38
ax25.h
14.94
KB
-rw-r--r--
2026-07-01 19:48
ax88796.h
1.43
KB
-rw-r--r--
2024-03-10 20:38
bareudp.h
333
B
-rw-r--r--
2024-03-10 20:38
bond_3ad.h
9.5
KB
-rw-r--r--
2026-07-01 19:48
bond_alb.h
6.1
KB
-rw-r--r--
2024-03-10 20:38
bond_options.h
4.88
KB
-rw-r--r--
2026-07-01 19:48
bonding.h
21.5
KB
-rw-r--r--
2026-07-01 19:48
bpf_sk_storage.h
1.74
KB
-rw-r--r--
2024-03-10 20:38
busy_poll.h
4.28
KB
-rw-r--r--
2026-07-01 19:48
calipso.h
1.55
KB
-rw-r--r--
2024-03-10 20:38
cfg80211-wext.h
1.86
KB
-rw-r--r--
2024-03-10 20:38
cfg80211.h
336.64
KB
-rw-r--r--
2026-07-01 19:48
cfg802154.h
16.68
KB
-rw-r--r--
2026-07-01 19:48
checksum.h
4.98
KB
-rw-r--r--
2026-07-01 19:48
cipso_ipv4.h
7.37
KB
-rw-r--r--
2024-03-10 20:38
cls_cgroup.h
2.04
KB
-rw-r--r--
2026-07-01 19:48
codel.h
5.86
KB
-rw-r--r--
2024-03-10 20:38
codel_impl.h
8.3
KB
-rw-r--r--
2024-03-10 20:38
codel_qdisc.h
2.95
KB
-rw-r--r--
2024-03-10 20:38
compat.h
2.48
KB
-rw-r--r--
2024-03-10 20:38
datalink.h
590
B
-rw-r--r--
2024-03-10 20:38
dcbevent.h
766
B
-rw-r--r--
2024-03-10 20:38
dcbnl.h
4.98
KB
-rw-r--r--
2024-03-10 20:38
devlink.h
70.92
KB
-rw-r--r--
2024-03-10 20:38
dropreason-core.h
14.76
KB
-rw-r--r--
2026-07-01 19:48
dropreason.h
1.36
KB
-rw-r--r--
2024-03-10 20:38
dsa.h
41.09
KB
-rw-r--r--
2026-07-01 19:48
dsa_stubs.h
1.28
KB
-rw-r--r--
2024-03-10 20:38
dsfield.h
1.12
KB
-rw-r--r--
2024-03-10 20:38
dst.h
15.12
KB
-rw-r--r--
2026-07-01 19:48
dst_cache.h
2.96
KB
-rw-r--r--
2024-03-10 20:38
dst_metadata.h
6.34
KB
-rw-r--r--
2024-03-10 20:38
dst_ops.h
2.07
KB
-rw-r--r--
2026-07-01 19:48
erspan.h
9.04
KB
-rw-r--r--
2024-03-10 20:38
esp.h
1.18
KB
-rw-r--r--
2024-03-10 20:38
espintcp.h
966
B
-rw-r--r--
2024-03-10 20:38
ethoc.h
439
B
-rw-r--r--
2024-03-10 20:38
failover.h
1.18
KB
-rw-r--r--
2024-03-10 20:38
fib_notifier.h
1.35
KB
-rw-r--r--
2024-03-10 20:38
fib_rules.h
5.39
KB
-rw-r--r--
2024-03-10 20:38
firewire.h
599
B
-rw-r--r--
2024-03-10 20:38
flow.h
4.96
KB
-rw-r--r--
2024-03-10 20:38
flow_dissector.h
11.95
KB
-rw-r--r--
2024-03-10 20:38
flow_offload.h
17.37
KB
-rw-r--r--
2024-03-10 20:38
fou.h
578
B
-rw-r--r--
2024-03-10 20:38
fq.h
2.41
KB
-rw-r--r--
2024-03-10 20:38
fq_impl.h
7.96
KB
-rw-r--r--
2024-03-10 20:38
garp.h
2.67
KB
-rw-r--r--
2024-03-10 20:38
gen_stats.h
2.99
KB
-rw-r--r--
2024-03-10 20:38
genetlink.h
19.62
KB
-rw-r--r--
2026-07-01 19:48
geneve.h
1.84
KB
-rw-r--r--
2024-03-10 20:38
gre.h
3.29
KB
-rw-r--r--
2024-03-10 20:38
gro.h
13.38
KB
-rw-r--r--
2026-07-01 19:48
gro_cells.h
443
B
-rw-r--r--
2024-03-10 20:38
gso.h
3.2
KB
-rw-r--r--
2024-03-10 20:38
gtp.h
1.46
KB
-rw-r--r--
2024-03-10 20:38
gue.h
3.29
KB
-rw-r--r--
2024-03-10 20:38
handshake.h
1.39
KB
-rw-r--r--
2024-03-10 20:38
hwbm.h
995
B
-rw-r--r--
2024-03-10 20:38
icmp.h
1.87
KB
-rw-r--r--
2024-03-10 20:38
ieee80211_radiotap.h
23.22
KB
-rw-r--r--
2026-07-01 19:48
ieee802154_netdev.h
13.02
KB
-rw-r--r--
2024-03-10 20:38
if_inet6.h
6.6
KB
-rw-r--r--
2024-03-10 20:38
ife.h
1.03
KB
-rw-r--r--
2024-03-10 20:38
inet6_connection_sock.h
794
B
-rw-r--r--
2024-03-10 20:38
inet6_hashtables.h
5.57
KB
-rw-r--r--
2026-07-01 19:48
inet_common.h
2.83
KB
-rw-r--r--
2024-03-10 20:38
inet_connection_sock.h
11.7
KB
-rw-r--r--
2026-07-01 19:48
inet_dscp.h
1.55
KB
-rw-r--r--
2024-03-10 20:38
inet_ecn.h
7.83
KB
-rw-r--r--
2024-03-10 20:38
inet_frag.h
5.25
KB
-rw-r--r--
2026-07-01 19:48
inet_hashtables.h
16.91
KB
-rw-r--r--
2026-07-01 19:48
inet_sock.h
11.36
KB
-rw-r--r--
2026-07-01 19:48
inet_timewait_sock.h
3.71
KB
-rw-r--r--
2026-07-01 19:48
inetpeer.h
3.23
KB
-rw-r--r--
2026-07-01 19:48
ioam6.h
1.24
KB
-rw-r--r--
2026-07-01 19:48
ip.h
23.13
KB
-rw-r--r--
2026-07-01 19:48
ip6_checksum.h
2.3
KB
-rw-r--r--
2024-03-10 20:38
ip6_fib.h
17.6
KB
-rw-r--r--
2026-07-01 19:48
ip6_route.h
10.18
KB
-rw-r--r--
2026-07-01 19:48
ip6_tunnel.h
5.31
KB
-rw-r--r--
2026-07-01 19:48
ip_fib.h
16.13
KB
-rw-r--r--
2026-07-01 19:48
ip_tunnels.h
16.89
KB
-rw-r--r--
2026-07-01 19:48
ip_vs.h
53.83
KB
-rw-r--r--
2024-03-10 20:38
ipcomp.h
737
B
-rw-r--r--
2024-03-10 20:38
ipconfig.h
837
B
-rw-r--r--
2024-03-10 20:38
ipv6.h
37.62
KB
-rw-r--r--
2026-07-01 19:48
ipv6_frag.h
3.38
KB
-rw-r--r--
2024-03-10 20:38
ipv6_stubs.h
3.75
KB
-rw-r--r--
2026-07-01 19:48
iw_handler.h
20.66
KB
-rw-r--r--
2024-03-10 20:38
kcm.h
4.84
KB
-rw-r--r--
2026-07-01 19:48
l3mdev.h
7.03
KB
-rw-r--r--
2026-07-01 19:48
lag.h
409
B
-rw-r--r--
2024-03-10 20:38
lapb.h
4.82
KB
-rw-r--r--
2026-07-01 19:48
lib80211.h
3.92
KB
-rw-r--r--
2024-03-10 20:38
llc.h
4.41
KB
-rw-r--r--
2024-03-10 20:38
llc_c_ac.h
9.32
KB
-rw-r--r--
2024-03-10 20:38
llc_c_ev.h
10.61
KB
-rw-r--r--
2024-03-10 20:38
llc_c_st.h
1.77
KB
-rw-r--r--
2024-03-10 20:38
llc_conn.h
4.11
KB
-rw-r--r--
2024-03-10 20:38
llc_if.h
2.17
KB
-rw-r--r--
2024-03-10 20:38
llc_pdu.h
14.46
KB
-rw-r--r--
2024-03-10 20:38
llc_s_ac.h
1.59
KB
-rw-r--r--
2024-03-10 20:38
llc_s_ev.h
2.22
KB
-rw-r--r--
2024-03-10 20:38
llc_s_st.h
1.03
KB
-rw-r--r--
2024-03-10 20:38
llc_sap.h
1.08
KB
-rw-r--r--
2024-03-10 20:38
lwtunnel.h
6.69
KB
-rw-r--r--
2026-07-01 19:48
mac80211.h
293.31
KB
-rw-r--r--
2026-07-01 19:48
mac802154.h
14.88
KB
-rw-r--r--
2024-03-10 20:38
macsec.h
10.53
KB
-rw-r--r--
2026-07-01 19:48
mctp.h
8.1
KB
-rw-r--r--
2026-07-01 19:48
mctpdevice.h
1.26
KB
-rw-r--r--
2024-03-10 20:38
mip6.h
1016
B
-rw-r--r--
2024-03-10 20:38
mld.h
2.85
KB
-rw-r--r--
2024-03-10 20:38
mpls.h
943
B
-rw-r--r--
2024-03-10 20:38
mpls_iptunnel.h
481
B
-rw-r--r--
2024-03-10 20:38
mptcp.h
7.41
KB
-rw-r--r--
2024-03-10 20:38
mrp.h
3.13
KB
-rw-r--r--
2024-03-10 20:38
ncsi.h
1.94
KB
-rw-r--r--
2024-03-10 20:38
ndisc.h
14.64
KB
-rw-r--r--
2024-03-10 20:38
neighbour.h
16.55
KB
-rw-r--r--
2026-07-01 19:48
net_debug.h
5.08
KB
-rw-r--r--
2026-07-01 19:48
net_failover.h
1023
B
-rw-r--r--
2024-03-10 20:38
net_namespace.h
14.36
KB
-rw-r--r--
2026-07-01 19:48
net_ratelimit.h
220
B
-rw-r--r--
2024-03-10 20:38
net_trackers.h
424
B
-rw-r--r--
2024-03-10 20:38
netdev_queues.h
5.75
KB
-rw-r--r--
2024-03-10 20:38
netdev_rx_queue.h
1.32
KB
-rw-r--r--
2024-03-10 20:38
netevent.h
1.04
KB
-rw-r--r--
2024-03-10 20:38
netkit.h
1.16
KB
-rw-r--r--
2024-03-10 20:38
netlabel.h
20.15
KB
-rw-r--r--
2026-07-01 19:48
netlink.h
64.18
KB
-rw-r--r--
2024-03-10 20:38
netprio_cgroup.h
1.02
KB
-rw-r--r--
2024-03-10 20:38
netrom.h
7.73
KB
-rw-r--r--
2024-03-10 20:38
nexthop.h
11.91
KB
-rw-r--r--
2024-03-10 20:38
nl802154.h
16.04
KB
-rw-r--r--
2024-03-10 20:38
nsh.h
12.3
KB
-rw-r--r--
2024-03-10 20:38
p8022.h
403
B
-rw-r--r--
2024-03-10 20:38
pie.h
3.61
KB
-rw-r--r--
2026-07-01 19:48
ping.h
2.66
KB
-rw-r--r--
2024-03-10 20:38
pkt_cls.h
25.52
KB
-rw-r--r--
2026-07-01 19:48
pkt_sched.h
7.74
KB
-rw-r--r--
2026-07-01 19:48
pptp.h
604
B
-rw-r--r--
2024-03-10 20:38
protocol.h
3.81
KB
-rw-r--r--
2024-03-10 20:38
psample.h
1.06
KB
-rw-r--r--
2024-03-10 20:38
psnap.h
430
B
-rw-r--r--
2024-03-10 20:38
raw.h
2.46
KB
-rw-r--r--
2024-03-10 20:38
rawv6.h
862
B
-rw-r--r--
2024-03-10 20:38
red.h
11.33
KB
-rw-r--r--
2024-03-10 20:38
regulatory.h
9.96
KB
-rw-r--r--
2024-03-10 20:38
request_sock.h
6.5
KB
-rw-r--r--
2024-03-10 20:38
rose.h
8.06
KB
-rw-r--r--
2026-07-01 19:48
route.h
11.32
KB
-rw-r--r--
2026-07-01 19:48
rpl.h
749
B
-rw-r--r--
2024-03-10 20:38
rsi_91x.h
1.67
KB
-rw-r--r--
2024-03-10 20:38
rtnetlink.h
7.58
KB
-rw-r--r--
2026-07-01 19:48
rtnh.h
859
B
-rw-r--r--
2024-03-10 20:38
sch_generic.h
35.08
KB
-rw-r--r--
2026-07-01 19:48
scm.h
5.36
KB
-rw-r--r--
2026-07-01 19:48
secure_seq.h
868
B
-rw-r--r--
2024-03-10 20:38
seg6.h
2.18
KB
-rw-r--r--
2024-03-10 20:38
seg6_hmac.h
1.44
KB
-rw-r--r--
2024-03-10 20:38
seg6_local.h
644
B
-rw-r--r--
2024-03-10 20:38
selftests.h
582
B
-rw-r--r--
2024-03-10 20:38
slhc_vj.h
6.67
KB
-rw-r--r--
2024-03-10 20:38
smc.h
2.5
KB
-rw-r--r--
2026-07-01 19:48
snmp.h
5.14
KB
-rw-r--r--
2024-03-10 20:38
sock.h
85.78
KB
-rw-r--r--
2026-07-01 19:48
sock_reuseport.h
1.83
KB
-rw-r--r--
2024-03-10 20:38
stp.h
412
B
-rw-r--r--
2024-03-10 20:38
strparser.h
4.34
KB
-rw-r--r--
2026-07-01 19:48
switchdev.h
15.1
KB
-rw-r--r--
2024-03-10 20:38
tc_wrapper.h
6.29
KB
-rw-r--r--
2026-07-01 19:48
tcp.h
85.12
KB
-rw-r--r--
2026-07-01 19:48
tcp_ao.h
12.08
KB
-rw-r--r--
2026-07-01 19:48
tcp_states.h
1.3
KB
-rw-r--r--
2024-03-10 20:38
tcx.h
4.3
KB
-rw-r--r--
2026-07-01 19:48
timewait_sock.h
925
B
-rw-r--r--
2024-03-10 20:38
tipc.h
2.35
KB
-rw-r--r--
2024-03-10 20:38
tls.h
13.28
KB
-rw-r--r--
2026-07-01 19:48
tls_prot.h
1.84
KB
-rw-r--r--
2024-03-10 20:38
tls_toe.h
2.94
KB
-rw-r--r--
2024-03-10 20:38
transp_v6.h
1.88
KB
-rw-r--r--
2024-03-10 20:38
tso.h
721
B
-rw-r--r--
2024-03-10 20:38
tun_proto.h
1015
B
-rw-r--r--
2024-03-10 20:38
udp.h
15.88
KB
-rw-r--r--
2026-07-01 19:48
udp_tunnel.h
12.49
KB
-rw-r--r--
2026-07-01 19:48
udplite.h
2.3
KB
-rw-r--r--
2024-03-10 20:38
vsock_addr.h
662
B
-rw-r--r--
2024-03-10 20:38
vxlan.h
15.83
KB
-rw-r--r--
2026-07-01 19:48
wext.h
1.47
KB
-rw-r--r--
2024-03-10 20:38
x25.h
9.46
KB
-rw-r--r--
2024-03-10 20:38
x25device.h
387
B
-rw-r--r--
2024-03-10 20:38
xdp.h
16.93
KB
-rw-r--r--
2026-07-01 19:48
xdp_priv.h
427
B
-rw-r--r--
2024-03-10 20:38
xdp_sock.h
6.3
KB
-rw-r--r--
2026-07-01 19:48
xdp_sock_drv.h
10.15
KB
-rw-r--r--
2026-07-01 19:48
xfrm.h
58.29
KB
-rw-r--r--
2026-07-01 19:48
xsk_buff_pool.h
7.09
KB
-rw-r--r--
2026-07-01 19:48
Save
Rename
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Definitions for the UDP module. * * Version: @(#)udp.h 1.0.2 05/07/93 * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * * Fixes: * Alan Cox : Turned on udp checksums. I don't want to * chase 'memory corruption' bugs that aren't! */ #ifndef _UDP_H #define _UDP_H #include <linux/list.h> #include <linux/bug.h> #include <net/inet_sock.h> #include <net/gso.h> #include <net/sock.h> #include <net/snmp.h> #include <net/ip.h> #include <linux/ipv6.h> #include <linux/seq_file.h> #include <linux/poll.h> #include <linux/indirect_call_wrapper.h> /** * struct udp_skb_cb - UDP(-Lite) private variables * * @header: private variables used by IPv4/IPv6 * @cscov: checksum coverage length (UDP-Lite only) * @partial_cov: if set indicates partial csum coverage */ struct udp_skb_cb { union { struct inet_skb_parm h4; #if IS_ENABLED(CONFIG_IPV6) struct inet6_skb_parm h6; #endif } header; __u16 cscov; __u8 partial_cov; }; #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) /** * struct udp_hslot - UDP hash slot * * @head: head of list of sockets * @count: number of sockets in 'head' list * @lock: spinlock protecting changes to head/count */ struct udp_hslot { struct hlist_head head; int count; spinlock_t lock; } __attribute__((aligned(2 * sizeof(long)))); /** * struct udp_table - UDP table * * @hash: hash table, sockets are hashed on (local port) * @hash2: hash table, sockets are hashed on (local port, local address) * @mask: number of slots in hash tables, minus 1 * @log: log2(number of slots in hash table) */ struct udp_table { struct udp_hslot *hash; struct udp_hslot *hash2; unsigned int mask; unsigned int log; }; extern struct udp_table udp_table; void udp_table_init(struct udp_table *, const char *); static inline struct udp_hslot *udp_hashslot(struct udp_table *table, const struct net *net, unsigned int num) { return &table->hash[udp_hashfn(net, num, table->mask)]; } /* * For secondary hash, net_hash_mix() is performed before calling * udp_hashslot2(), this explains difference with udp_hashslot() */ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, unsigned int hash) { return &table->hash2[hash & table->mask]; } extern struct proto udp_prot; extern atomic_long_t udp_memory_allocated; DECLARE_PER_CPU(int, udp_memory_per_cpu_fw_alloc); /* sysctl variables for udp */ extern long sysctl_udp_mem[3]; extern int sysctl_udp_rmem_min; extern int sysctl_udp_wmem_min; struct sk_buff; /* * Generic checksumming routines for UDP(-Lite) v4 and v6 */ static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb) { return (UDP_SKB_CB(skb)->cscov == skb->len ? __skb_checksum_complete(skb) : __skb_checksum_complete_head(skb, UDP_SKB_CB(skb)->cscov)); } static inline int udp_lib_checksum_complete(struct sk_buff *skb) { return !skb_csum_unnecessary(skb) && __udp_lib_checksum_complete(skb); } /** * udp_csum_outgoing - compute UDPv4/v6 checksum over fragments * @sk: socket we are writing to * @skb: sk_buff containing the filled-in UDP header * (checksum field must be zeroed out) */ static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb) { __wsum csum = csum_partial(skb_transport_header(skb), sizeof(struct udphdr), 0); skb_queue_walk(&sk->sk_write_queue, skb) { csum = csum_add(csum, skb->csum); } return csum; } static inline __wsum udp_csum(struct sk_buff *skb) { __wsum csum = csum_partial(skb_transport_header(skb), sizeof(struct udphdr), skb->csum); for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next) { csum = csum_add(csum, skb->csum); } return csum; } static inline __sum16 udp_v4_check(int len, __be32 saddr, __be32 daddr, __wsum base) { return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, base); } void udp_set_csum(bool nocheck, struct sk_buff *skb, __be32 saddr, __be32 daddr, int len); static inline void udp_csum_pull_header(struct sk_buff *skb) { if (!skb->csum_valid && skb->ip_summed == CHECKSUM_NONE) skb->csum = csum_partial(skb->data, sizeof(struct udphdr), skb->csum); skb_pull_rcsum(skb, sizeof(struct udphdr)); UDP_SKB_CB(skb)->cscov -= sizeof(struct udphdr); } typedef struct sock *(*udp_lookup_t)(const struct sk_buff *skb, __be16 sport, __be16 dport); void udp_v6_early_demux(struct sk_buff *skb); INDIRECT_CALLABLE_DECLARE(int udpv6_rcv(struct sk_buff *)); struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, netdev_features_t features, bool is_ipv6); static inline void udp_lib_init_sock(struct sock *sk) { struct udp_sock *up = udp_sk(sk); skb_queue_head_init(&up->reader_queue); up->forward_threshold = sk->sk_rcvbuf >> 2; set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags); } /* hash routines shared between UDPv4/6 and UDP-Litev4/6 */ static inline int udp_lib_hash(struct sock *sk) { BUG(); return 0; } void udp_lib_unhash(struct sock *sk); void udp_lib_rehash(struct sock *sk, u16 new_hash); static inline void udp_lib_close(struct sock *sk, long timeout) { sk_common_release(sk); } int udp_lib_get_port(struct sock *sk, unsigned short snum, unsigned int hash2_nulladdr); u32 udp_flow_hashrnd(void); static inline __be16 udp_flow_src_port(struct net *net, struct sk_buff *skb, int min, int max, bool use_eth) { u32 hash; if (min >= max) { /* Use default range */ inet_get_local_port_range(net, &min, &max); } hash = skb_get_hash(skb); if (unlikely(!hash)) { if (use_eth) { /* Can't find a normal hash, caller has indicated an * Ethernet packet so use that to compute a hash. */ hash = jhash(skb->data, 2 * ETH_ALEN, (__force u32) skb->protocol); } else { /* Can't derive any sort of hash for the packet, set * to some consistent random value. */ hash = udp_flow_hashrnd(); } } /* Since this is being sent on the wire obfuscate hash a bit * to minimize possbility that any useful information to an * attacker is leaked. Only upper 16 bits are relevant in the * computation for 16 bit port value. */ hash ^= hash << 16; return htons((((u64) hash * (max - min)) >> 32) + min); } static inline int udp_rqueue_get(struct sock *sk) { return sk_rmem_alloc_get(sk) - READ_ONCE(udp_sk(sk)->forward_deficit); } static inline bool udp_sk_bound_dev_eq(const struct net *net, int bound_dev_if, int dif, int sdif) { #if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) return inet_bound_dev_eq(!!READ_ONCE(net->ipv4.sysctl_udp_l3mdev_accept), bound_dev_if, dif, sdif); #else return inet_bound_dev_eq(true, bound_dev_if, dif, sdif); #endif } /* net/ipv4/udp.c */ void udp_destruct_common(struct sock *sk); void skb_consume_udp(struct sock *sk, struct sk_buff *skb, int len); int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb); void udp_skb_destructor(struct sock *sk, struct sk_buff *skb); struct sk_buff *__skb_recv_udp(struct sock *sk, unsigned int flags, int *off, int *err); static inline struct sk_buff *skb_recv_udp(struct sock *sk, unsigned int flags, int *err) { int off = 0; return __skb_recv_udp(sk, flags, &off, err); } int udp_v4_early_demux(struct sk_buff *skb); bool udp_sk_rx_dst_set(struct sock *sk, struct dst_entry *dst); int udp_err(struct sk_buff *, u32); int udp_abort(struct sock *sk, int err); int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len); void udp_splice_eof(struct socket *sock); int udp_push_pending_frames(struct sock *sk); void udp_flush_pending_frames(struct sock *sk); int udp_cmsg_send(struct sock *sk, struct msghdr *msg, u16 *gso_size); void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); int udp_rcv(struct sk_buff *skb); int udp_ioctl(struct sock *sk, int cmd, int *karg); int udp_init_sock(struct sock *sk); int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); int __udp_disconnect(struct sock *sk, int flags); int udp_disconnect(struct sock *sk, int flags); __poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait); struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, netdev_features_t features, bool is_ipv6); int udp_lib_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); int udp_lib_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, unsigned int optlen, int (*push_pending_frames)(struct sock *)); struct sock *udp4_lib_lookup(const struct net *net, __be32 saddr, __be16 sport, __be32 daddr, __be16 dport, int dif); struct sock *__udp4_lib_lookup(const struct net *net, __be32 saddr, __be16 sport, __be32 daddr, __be16 dport, int dif, int sdif, struct udp_table *tbl, struct sk_buff *skb); struct sock *udp4_lib_lookup_skb(const struct sk_buff *skb, __be16 sport, __be16 dport); struct sock *udp6_lib_lookup(const struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, __be16 dport, int dif); struct sock *__udp6_lib_lookup(const struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, __be16 dport, int dif, int sdif, struct udp_table *tbl, struct sk_buff *skb); struct sock *udp6_lib_lookup_skb(const struct sk_buff *skb, __be16 sport, __be16 dport); int udp_read_skb(struct sock *sk, skb_read_actor_t recv_actor); /* UDP uses skb->dev_scratch to cache as much information as possible and avoid * possibly multiple cache miss on dequeue() */ struct udp_dev_scratch { /* skb->truesize and the stateless bit are embedded in a single field; * do not use a bitfield since the compiler emits better/smaller code * this way */ u32 _tsize_state; #if BITS_PER_LONG == 64 /* len and the bit needed to compute skb_csum_unnecessary * will be on cold cache lines at recvmsg time. * skb->len can be stored on 16 bits since the udp header has been * already validated and pulled. */ u16 len; bool is_linear; bool csum_unnecessary; #endif }; static inline struct udp_dev_scratch *udp_skb_scratch(struct sk_buff *skb) { return (struct udp_dev_scratch *)&skb->dev_scratch; } #if BITS_PER_LONG == 64 static inline unsigned int udp_skb_len(struct sk_buff *skb) { return udp_skb_scratch(skb)->len; } static inline bool udp_skb_csum_unnecessary(struct sk_buff *skb) { return udp_skb_scratch(skb)->csum_unnecessary; } static inline bool udp_skb_is_linear(struct sk_buff *skb) { return udp_skb_scratch(skb)->is_linear; } #else static inline unsigned int udp_skb_len(struct sk_buff *skb) { return skb->len; } static inline bool udp_skb_csum_unnecessary(struct sk_buff *skb) { return skb_csum_unnecessary(skb); } static inline bool udp_skb_is_linear(struct sk_buff *skb) { return !skb_is_nonlinear(skb); } #endif static inline int copy_linear_skb(struct sk_buff *skb, int len, int off, struct iov_iter *to) { int n; n = copy_to_iter(skb->data + off, len, to); if (n == len) return 0; iov_iter_revert(to, n); return -EFAULT; } /* * SNMP statistics for UDP and UDP-Lite */ #define UDP_INC_STATS(net, field, is_udplite) do { \ if (is_udplite) SNMP_INC_STATS((net)->mib.udplite_statistics, field); \ else SNMP_INC_STATS((net)->mib.udp_statistics, field); } while(0) #define __UDP_INC_STATS(net, field, is_udplite) do { \ if (is_udplite) __SNMP_INC_STATS((net)->mib.udplite_statistics, field); \ else __SNMP_INC_STATS((net)->mib.udp_statistics, field); } while(0) #define __UDP6_INC_STATS(net, field, is_udplite) do { \ if (is_udplite) __SNMP_INC_STATS((net)->mib.udplite_stats_in6, field);\ else __SNMP_INC_STATS((net)->mib.udp_stats_in6, field); \ } while(0) #define UDP6_INC_STATS(net, field, __lite) do { \ if (__lite) SNMP_INC_STATS((net)->mib.udplite_stats_in6, field); \ else SNMP_INC_STATS((net)->mib.udp_stats_in6, field); \ } while(0) #if IS_ENABLED(CONFIG_IPV6) #define __UDPX_MIB(sk, ipv4) \ ({ \ ipv4 ? (IS_UDPLITE(sk) ? sock_net(sk)->mib.udplite_statistics : \ sock_net(sk)->mib.udp_statistics) : \ (IS_UDPLITE(sk) ? sock_net(sk)->mib.udplite_stats_in6 : \ sock_net(sk)->mib.udp_stats_in6); \ }) #else #define __UDPX_MIB(sk, ipv4) \ ({ \ IS_UDPLITE(sk) ? sock_net(sk)->mib.udplite_statistics : \ sock_net(sk)->mib.udp_statistics; \ }) #endif #define __UDPX_INC_STATS(sk, field) \ __SNMP_INC_STATS(__UDPX_MIB(sk, (sk)->sk_family == AF_INET), field) #ifdef CONFIG_PROC_FS struct udp_seq_afinfo { sa_family_t family; struct udp_table *udp_table; }; struct udp_iter_state { struct seq_net_private p; int bucket; }; void *udp_seq_start(struct seq_file *seq, loff_t *pos); void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos); void udp_seq_stop(struct seq_file *seq, void *v); extern const struct seq_operations udp_seq_ops; extern const struct seq_operations udp6_seq_ops; int udp4_proc_init(void); void udp4_proc_exit(void); #endif /* CONFIG_PROC_FS */ int udpv4_offload_init(void); void udp_init(void); DECLARE_STATIC_KEY_FALSE(udp_encap_needed_key); void udp_encap_enable(void); void udp_encap_disable(void); #if IS_ENABLED(CONFIG_IPV6) DECLARE_STATIC_KEY_FALSE(udpv6_encap_needed_key); void udpv6_encap_enable(void); #endif static inline struct sk_buff *udp_rcv_segment(struct sock *sk, struct sk_buff *skb, bool ipv4) { netdev_features_t features = NETIF_F_SG; struct sk_buff *segs; int drop_count; /* * Segmentation in UDP receive path is only for UDP GRO, drop udp * fragmentation offload (UFO) packets. */ if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP) { drop_count = 1; goto drop; } /* Avoid csum recalculation by skb_segment unless userspace explicitly * asks for the final checksum values */ if (!inet_get_convert_csum(sk)) features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; /* UDP segmentation expects packets of type CHECKSUM_PARTIAL or * CHECKSUM_NONE in __udp_gso_segment. UDP GRO indeed builds partial * packets in udp_gro_complete_segment. As does UDP GSO, verified by * udp_send_skb. But when those packets are looped in dev_loopback_xmit * their ip_summed CHECKSUM_NONE is changed to CHECKSUM_UNNECESSARY. * Reset in this specific case, where PARTIAL is both correct and * required. */ if (skb->pkt_type == PACKET_LOOPBACK) skb->ip_summed = CHECKSUM_PARTIAL; /* the GSO CB lays after the UDP one, no need to save and restore any * CB fragment */ segs = __skb_gso_segment(skb, features, false); if (IS_ERR_OR_NULL(segs)) { drop_count = skb_shinfo(skb)->gso_segs; goto drop; } consume_skb(skb); return segs; drop: atomic_add(drop_count, &sk->sk_drops); SNMP_ADD_STATS(__UDPX_MIB(sk, ipv4), UDP_MIB_INERRORS, drop_count); kfree_skb(skb); return NULL; } static inline void udp_post_segment_fix_csum(struct sk_buff *skb) { /* UDP-lite can't land here - no GRO */ WARN_ON_ONCE(UDP_SKB_CB(skb)->partial_cov); /* UDP packets generated with UDP_SEGMENT and traversing: * * UDP tunnel(xmit) -> veth (segmentation) -> veth (gro) -> UDP tunnel (rx) * * can reach an UDP socket with CHECKSUM_NONE, because * __iptunnel_pull_header() converts CHECKSUM_PARTIAL into NONE. * SKB_GSO_UDP_L4 or SKB_GSO_FRAGLIST packets with no UDP tunnel will * have a valid checksum, as the GRO engine validates the UDP csum * before the aggregation and nobody strips such info in between. * Instead of adding another check in the tunnel fastpath, we can force * a valid csum after the segmentation. * Additionally fixup the UDP CB. */ UDP_SKB_CB(skb)->cscov = skb->len; if (skb->ip_summed == CHECKSUM_NONE && !skb->csum_valid) skb->csum_valid = 1; } #ifdef CONFIG_BPF_SYSCALL struct sk_psock; int udp_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore); #endif #endif /* _UDP_H */