Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165246369
D5875.id15291.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D5875.id15291.diff
View Options
Index: net/if_vxlan.c
===================================================================
--- net/if_vxlan.c
+++ net/if_vxlan.c
@@ -930,7 +930,7 @@
}
error = udp_set_kernel_tunneling(vso->vxlso_sock,
- vxlan_rcv_udp_packet, vso);
+ vxlan_rcv_udp_packet, NULL, vso);
if (error) {
if_printf(ifp, "cannot set tunneling function: %d\n", error);
return (error);
Index: netinet/sctputil.c
===================================================================
--- netinet/sctputil.c
+++ netinet/sctputil.c
@@ -7092,7 +7092,7 @@
}
/* Call the special UDP hook. */
if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket),
- sctp_recv_udp_tunneled_packet, NULL))) {
+ sctp_recv_udp_tunneled_packet, NULL, NULL))) {
sctp_over_udp_stop();
return (ret);
}
@@ -7116,7 +7116,7 @@
}
/* Call the special UDP hook. */
if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket),
- sctp_recv_udp_tunneled_packet, NULL))) {
+ sctp_recv_udp_tunneled_packet, NULL, NULL))) {
sctp_over_udp_stop();
return (ret);
}
Index: netinet/udp_usrreq.c
===================================================================
--- netinet/udp_usrreq.c
+++ netinet/udp_usrreq.c
@@ -792,6 +792,21 @@
udp_notify(inp, inetctlerrmap[cmd]);
}
INP_RUNLOCK(inp);
+ } else {
+ inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport,
+ ip->ip_src, uh->uh_sport,
+ INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL);
+ if (inp != NULL) {
+ struct udpcb *up;
+
+ up = intoudpcb(inp);
+ if (up->u_icmp_func != NULL) {
+ INP_RUNLOCK(inp);
+ (*up->u_icmp_func)(cmd, sa, vip, up->u_tun_ctx);
+ } else {
+ INP_RUNLOCK(inp);
+ }
+ }
}
} else
in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd],
@@ -1748,7 +1763,7 @@
#endif /* INET */
int
-udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, void *ctx)
+udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx)
{
struct inpcb *inp;
struct udpcb *up;
@@ -1759,11 +1774,13 @@
KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL"));
INP_WLOCK(inp);
up = intoudpcb(inp);
- if (up->u_tun_func != NULL) {
+ if ((up->u_tun_func != NULL) ||
+ (up->u_icmp_func != NULL)) {
INP_WUNLOCK(inp);
return (EBUSY);
}
up->u_tun_func = f;
+ up->u_icmp_func = i;
up->u_tun_ctx = ctx;
INP_WUNLOCK(inp);
return (0);
Index: netinet6/udp6_usrreq.c
===================================================================
--- netinet6/udp6_usrreq.c
+++ netinet6/udp6_usrreq.c
@@ -553,6 +553,29 @@
bzero(&uh, sizeof(uh));
m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh);
+ if (!PRC_IS_REDIRECT(cmd)) {
+ /* Check to see if its tunneled */
+ struct inpcb *inp;
+ inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_src,
+ uh.uh_sport, &ip6->ip6_dst, uh.uh_dport,
+ INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB,
+ m->m_pkthdr.rcvif, m);
+ if (inp != NULL) {
+ struct udpcb *up;
+
+ up = intoudpcb(inp);
+ if (up->u_icmp_func) {
+ /* Yes it is. */
+ INP_RUNLOCK(inp);
+ (*up->u_icmp_func)(cmd, (struct sockaddr *)ip6cp->ip6c_src,
+ d, up->u_tun_ctx);
+ return;
+ } else {
+ /* Can't find it. */
+ INP_RUNLOCK(inp);
+ }
+ }
+ }
(void)in6_pcbnotify(pcbinfo, sa, uh.uh_dport,
(struct sockaddr *)ip6cp->ip6c_src, uh.uh_sport, cmd,
cmdarg, notify);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 8, 3:44 AM (5 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36208526
Default Alt Text
D5875.id15291.diff (3 KB)
Attached To
Mode
D5875: UDP Kernel Tunneling ICMP
Attached
Detach File
Event Timeline
Log In to Comment