diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-10 17:46:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-10 17:46:08 +0100 |
commit | 5199de0279e0825285c294a537d17f8ccee8e148 (patch) | |
tree | c9bf19653e68c7a6890a0ac0b51dff244e0ecb17 /src/vpn | |
parent | fb5328f889339c21bf45079ff2f5de1fc9d58a4d (diff) | |
download | gnunet-5199de0279e0825285c294a537d17f8ccee8e148.tar.gz gnunet-5199de0279e0825285c294a537d17f8ccee8e148.zip |
fix ICMP IPv4/IPv6 type conversion logic
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index aa0ea51a3..aab0a143f 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -2061,6 +2061,7 @@ route_packet (struct DestinationEntry *destination, | |||
2061 | void *payload; | 2061 | void *payload; |
2062 | uint8_t new_type; | 2062 | uint8_t new_type; |
2063 | 2063 | ||
2064 | new_type = icmp->type; | ||
2064 | /* Perform ICMP protocol-translation (depending on destination AF and source AF) | 2065 | /* Perform ICMP protocol-translation (depending on destination AF and source AF) |
2065 | and throw away ICMP payload depending on ICMP message type */ | 2066 | and throw away ICMP payload depending on ICMP message type */ |
2066 | switch (af) | 2067 | switch (af) |
@@ -2111,8 +2112,8 @@ route_packet (struct DestinationEntry *destination, | |||
2111 | switch (icmp->type) | 2112 | switch (icmp->type) |
2112 | { | 2113 | { |
2113 | case GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE: | 2114 | case GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE: |
2114 | if (destination->details.exit_destination.af == AF_INET6) | 2115 | if (destination->details.exit_destination.af == AF_INET) |
2115 | new_type = GNUNET_TUN_ICMPTYPE6_DESTINATION_UNREACHABLE; | 2116 | new_type = GNUNET_TUN_ICMPTYPE_DESTINATION_UNREACHABLE; |
2116 | /* throw away IP-payload, exit will have to make it up anyway */ | 2117 | /* throw away IP-payload, exit will have to make it up anyway */ |
2117 | payload_length = sizeof (struct GNUNET_TUN_IcmpHeader); | 2118 | payload_length = sizeof (struct GNUNET_TUN_IcmpHeader); |
2118 | break; | 2119 | break; |