aboutsummaryrefslogtreecommitdiff
path: root/src/dhtu
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-01-18 21:55:13 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-19 12:41:01 +0100
commit5e041b56a98c49a944804420ad53e18707c9f823 (patch)
treede2bf458bb44c86bff53f0a5a73d7f1d4fdef0c2 /src/dhtu
parent0bd15d392c8c1c4dab56c794ec88fdbd7245cc51 (diff)
downloadgnunet-5e041b56a98c49a944804420ad53e18707c9f823.tar.gz
gnunet-5e041b56a98c49a944804420ad53e18707c9f823.zip
-got basics to work with dhtu and udp+ip underlay
Diffstat (limited to 'src/dhtu')
-rw-r--r--src/dhtu/plugin_dhtu_ip.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dhtu/plugin_dhtu_ip.c b/src/dhtu/plugin_dhtu_ip.c
index 617f722b5..2f6d6161e 100644
--- a/src/dhtu/plugin_dhtu_ip.c
+++ b/src/dhtu/plugin_dhtu_ip.c
@@ -809,7 +809,7 @@ read_cb (void *cls)
809 (cmsg->cmsg_level == IPPROTO_IPV6), 809 (cmsg->cmsg_level == IPPROTO_IPV6),
810 cmsg->cmsg_type, 810 cmsg->cmsg_type,
811 (cmsg->cmsg_type == IP_PKTINFO), 811 (cmsg->cmsg_type == IP_PKTINFO),
812 (cmsg->cmsg_type == IPV6_RECVPKTINFO)); 812 (cmsg->cmsg_type == IPV6_PKTINFO));
813 if ( (cmsg->cmsg_level == IPPROTO_IP) && 813 if ( (cmsg->cmsg_level == IPPROTO_IP) &&
814 (cmsg->cmsg_type == IP_PKTINFO) ) 814 (cmsg->cmsg_type == IP_PKTINFO) )
815 { 815 {
@@ -824,7 +824,8 @@ read_cb (void *cls)
824 { 824 {
825 struct sockaddr_in sa = { 825 struct sockaddr_in sa = {
826 .sin_family = AF_INET, 826 .sin_family = AF_INET,
827 .sin_addr = pi.ipi_addr 827 .sin_addr = pi.ipi_addr,
828 .sin_port = htons (plugin->port16)
828 }; 829 };
829 830
830 src = find_source (plugin, 831 src = find_source (plugin,
@@ -837,7 +838,7 @@ read_cb (void *cls)
837 GNUNET_break (0); 838 GNUNET_break (0);
838 } 839 }
839 if ( (cmsg->cmsg_level == IPPROTO_IPV6) && 840 if ( (cmsg->cmsg_level == IPPROTO_IPV6) &&
840 (cmsg->cmsg_type == IPV6_RECVPKTINFO) ) 841 (cmsg->cmsg_type == IPV6_PKTINFO) )
841 { 842 {
842 if (CMSG_LEN (sizeof (struct in6_pktinfo)) == 843 if (CMSG_LEN (sizeof (struct in6_pktinfo)) ==
843 cmsg->cmsg_len) 844 cmsg->cmsg_len)
@@ -851,6 +852,7 @@ read_cb (void *cls)
851 struct sockaddr_in6 sa = { 852 struct sockaddr_in6 sa = {
852 .sin6_family = AF_INET6, 853 .sin6_family = AF_INET6,
853 .sin6_addr = pi.ipi6_addr, 854 .sin6_addr = pi.ipi6_addr,
855 .sin6_port = htons (plugin->port16),
854 .sin6_scope_id = pi.ipi6_ifindex 856 .sin6_scope_id = pi.ipi6_ifindex
855 }; 857 };
856 858
@@ -880,8 +882,8 @@ read_cb (void *cls)
880 return; 882 return;
881 } 883 }
882 plugin->env->receive_cb (plugin->env->cls, 884 plugin->env->receive_cb (plugin->env->cls,
883 dst->app_ctx, 885 &dst->app_ctx,
884 src->app_ctx, 886 &src->app_ctx,
885 &buf[sizeof(*pid)], 887 &buf[sizeof(*pid)],
886 ret - sizeof (*pid)); 888 ret - sizeof (*pid));
887} 889}