Thread (16 messages) 16 messages, 5 authors, 2017-08-31

Re: [PATCH v2 net-next 2/6] udp: Constify skb argument in lookup functions

From: David Miller <davem@davemloft.net>
Date: 2017-08-30 00:58:35

From: Tom Herbert <redacted>
Date: Tue, 29 Aug 2017 16:27:07 -0700
For UDP socket lookup functions, and associateed functions that take an
skbuf as argument, declare the skb argument as constant.

One caveat is that reuseport_select_sock can be called from the UDP
lookup functions with an skb argument. This function temporarily
modifies the skbuff data pointer (in bpf_run via a pull/push sequence).
To resolve compiler warning I added a local skbuf declaration that is
not const and assigned to the skb argument with an explicit cast.

Signed-off-by: Tom Herbert <redacted>
Please don't do this.

If reuseport_select_sock() modifies anything in the SKB, especially
skb->data, it infects the entire call chain.  So you can't mark it
const in this family of calls.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help