Initialize struct ip and icmp
This commit is contained in:
parent
3b3bdf72d4
commit
9ab8d025ca
1 changed files with 8 additions and 3 deletions
11
src/route.c
11
src/route.c
|
@ -115,13 +115,16 @@ static void swap_mac_addresses(vpn_packet_t *packet) {
|
|||
/* RFC 792 */
|
||||
|
||||
static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, length_t ether_size, uint8_t type, uint8_t code) {
|
||||
struct ip ip = {0};
|
||||
struct icmp icmp = {0};
|
||||
struct ip ip;
|
||||
struct icmp icmp;
|
||||
|
||||
struct in_addr ip_src;
|
||||
struct in_addr ip_dst;
|
||||
uint32_t oldlen;
|
||||
|
||||
memset(&ip, 0x00, sizeof(struct ip));
|
||||
memset(&icmp, 0x00, sizeof(struct icmp));
|
||||
|
||||
if(ratelimit(3))
|
||||
return;
|
||||
|
||||
|
@ -210,7 +213,7 @@ static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, length_
|
|||
|
||||
static void route_ipv6_unreachable(node_t *source, vpn_packet_t *packet, length_t ether_size, uint8_t type, uint8_t code) {
|
||||
struct ip6_hdr ip6;
|
||||
struct icmp6_hdr icmp6 = {0};
|
||||
struct icmp6_hdr icmp6;
|
||||
uint16_t checksum;
|
||||
|
||||
struct {
|
||||
|
@ -220,6 +223,8 @@ static void route_ipv6_unreachable(node_t *source, vpn_packet_t *packet, length_
|
|||
uint32_t next;
|
||||
} pseudo;
|
||||
|
||||
memset(&icmp6, 0x00, sizeof(struct icmp6_hdr));
|
||||
|
||||
if(ratelimit(3))
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue