Some protocols using TCP encapsulation (e.g., espintcp, openvpn) deliver userspace-bound packets through a custom skb queue rather than the standard sk_receive_queue. Introduce datagram_poll_queue that accepts an explicit receive queue, and convert datagram_poll into a wrapper around datagram_poll_queue. This allows protocols with custom skb queues to reuse the core polling logic without relying on sk_receive_queue.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -4204,6 +4204,9 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, · 4203 unmodified lines | ||
| 4204 | 4204 | struct sk_buff_head *sk_queue, |
| 4205 | 4205 | unsigned int flags, int *off, int *err); |
| 4206 | 4206 | struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned int flags, int *err); |
| 4207 | +__poll_t datagram_poll_queue(struct file *file, struct socket *sock, | |
| 4208 | + struct poll_table_struct *wait, | |
| 4209 | + struct sk_buff_head *rcv_queue); | |
| 4207 | 4210 | __poll_t datagram_poll(struct file *file, struct socket *sock, |
| 4208 | 4211 | struct poll_table_struct *wait); |
| 4209 | 4212 | int skb_copy_datagram_iter(const struct sk_buff *from, int offset, |