From 5bfb3957c4f3707d6309e474687d363ea462f91b Mon Sep 17 00:00:00 2001 From: nfkd Date: Fri, 26 Jul 2013 13:25:51 -0300 Subject: Remove unnecessary braces --- core/LAN_discovery.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'core/LAN_discovery.c') diff --git a/core/LAN_discovery.c b/core/LAN_discovery.c index 7b6e0bd9..4ff2fcbf 100644 --- a/core/LAN_discovery.c +++ b/core/LAN_discovery.c @@ -21,38 +21,24 @@ IP broadcast_ip() int LAN_ip(IP ip) { if(ip.c[0] == 127)/* Loopback */ - { return 0; - } if(ip.c[0] == 10)/* 10.0.0.0 to 10.255.255.255 range */ - { return 0; - } if(ip.c[0] == 172 && ip.c[1] >= 16 && ip.c[1] <= 31)/* 172.16.0.0 to 172.31.255.255 range */ - { return 0; - } if(ip.c[0] == 192 && ip.c[1] == 168) /* 192.168.0.0 to 192.168.255.255 range */ - { return 0; - } if(ip.c[0] == 169 && ip.c[1] == 254 && ip.c[2] != 0 && ip.c[2] != 255)/* 169.254.1.0 to 169.254.254.255 range */ - { return 0; - } return -1; } int handle_LANdiscovery(uint8_t * packet, uint32_t length, IP_Port source) { if(LAN_ip(source.ip) == -1) - { return 1; - } if(length != crypto_box_PUBLICKEYBYTES + 1) - { return 1; - } DHT_bootstrap(source, packet + 1); return 0; } @@ -71,8 +57,6 @@ int send_LANdiscovery(uint16_t port) int LANdiscovery_handlepacket(uint8_t * packet, uint32_t length, IP_Port source) { if(packet[0] == 32) - { return handle_LANdiscovery(packet, length, source); - } return 1; } -- cgit v1.2.3