1
0
mirror of https://code.semirocket.science/wrapsix synced 2025-12-28 10:16:48 +02:00

Simplified assigning of IP addresses

This commit is contained in:
Michal Zima
2013-02-14 14:04:33 +01:00
parent 378d3200c2
commit e722e80149
3 changed files with 8 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
/*
* WrapSix
* Copyright (C) 2008-2012 Michal Zima <xhire@mujmalysvet.cz>
* Copyright (C) 2008-2013 Michal Zima <xhire@mujmalysvet.cz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -125,7 +125,7 @@ int icmp_ipv4(struct s_ethernet *eth4, struct s_ipv4 *ip4,
ip6->next_header = IPPROTO_ICMPV6;
ip6->hop_limit = ip4->ttl;
ipv4_to_ipv6(&ip4->ip_src, &ip6->ip_src);
memcpy(&ip6->ip_dest, &connection->ipv6, sizeof(struct s_ipv6_addr));
ip6->ip_dest = connection->ipv6;
/* compute ICMP checksum */
icmp->checksum = 0x0;
@@ -247,8 +247,8 @@ int icmp_ipv6(struct s_ethernet *eth6, struct s_ipv6 *ip6, char *payload)
ip4->flags_offset = htons(IPV4_FLAG_DONT_FRAGMENT);
ip4->ttl = ip6->hop_limit;
ip4->proto = IPPROTO_ICMP;
ip4->ip_src = wrapsix_ipv4_addr;
ipv6_to_ipv4(&ip6->ip_dest, &ip4->ip_dest);
memcpy(&ip4->ip_src, &wrapsix_ipv4_addr, sizeof(struct s_ipv4_addr));
/* compute ICMP checksum */
icmp->checksum = 0x0;