aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorBryan Venteicher <bryanv@FreeBSD.org>2014-10-10 06:08:59 +0000
committerBryan Venteicher <bryanv@FreeBSD.org>2014-10-10 06:08:59 +0000
commit81d3ec17636f208c744fdc071ee11b2653f7cd56 (patch)
tree42cfffd82364faa255dc0fcee6b4f0c1a17e1803 /sys/netinet/udp_usrreq.c
parent1482f98247f00bcbd7e5593bec614df7748c5af6 (diff)
downloadsrc-81d3ec17636f208c744fdc071ee11b2653f7cd56.tar.gz
src-81d3ec17636f208c744fdc071ee11b2653f7cd56.zip
Add context pointer and source address to the UDP tunnel callback
These are needed for the forthcoming vxlan implementation. The context pointer means we do not have to use a spare pointer field in the inpcb, and the source address is required to populate vxlan's forwarding table. While I highly doubt there is an out of tree consumer of the UDP tunneling callback, this change may be a difficult to eventually MFC. Phabricator: https://reviews.freebsd.org/D383 Reviewed by: gnn
Notes
Notes: svn path=/head/; revision=272886
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index ce449cd612b6..3a3d60e1b2f3 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -312,7 +312,8 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
*/
up = intoudpcb(inp);
if (up->u_tun_func != NULL) {
- (*up->u_tun_func)(n, off, inp);
+ (*up->u_tun_func)(n, off, inp, (struct sockaddr *)udp_in,
+ up->u_tun_ctx);
return;
}
@@ -1717,7 +1718,7 @@ udp_attach(struct socket *so, int proto, struct thread *td)
#endif /* INET */
int
-udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f)
+udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, void *ctx)
{
struct inpcb *inp;
struct udpcb *up;
@@ -1733,6 +1734,7 @@ udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f)
return (EBUSY);
}
up->u_tun_func = f;
+ up->u_tun_ctx = ctx;
INP_WUNLOCK(inp);
return (0);
}