[SLOF] [PATCH] libnet: Cosmetical clean-up

Thomas Huth thuth at redhat.com
Tue Jun 13 16:29:17 AEST 2017


Replace indentation spaces with tabs, remove superfluous prototype
(ip6addr_add() is declared in ipv6.h already) and fix the old-style
declaration of ip6_create_prefix_info(). No functional changes done.

Signed-off-by: Thomas Huth <thuth at redhat.com>
---
 lib/libnet/icmpv6.c  | 18 ++++++++----------
 lib/libnet/ipv6.c    |  3 +--
 lib/libnet/netload.c |  4 ++--
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/lib/libnet/icmpv6.c b/lib/libnet/icmpv6.c
index 2e0cf7c..d44ce84 100644
--- a/lib/libnet/icmpv6.c
+++ b/lib/libnet/icmpv6.c
@@ -230,11 +230,10 @@ send_neighbour_solicitation (int fd, ip6_addr_t *dest_ip6)
 	snma.addr[13]          = dest_ip6->addr[13];
 	snma.addr[14]          = dest_ip6->addr[14];
 	snma.addr[15]          = dest_ip6->addr[15];
-        fill_ip6hdr((uint8_t *) headers.ip6h,
-                   ICMPv6_HEADER_SIZE +
-		   sizeof(struct neighbour_solicitation),
-		   0x3a, //ICMPv6
-                   get_ipv6_address(), &snma);
+	fill_ip6hdr((uint8_t *) headers.ip6h,
+		    ICMPv6_HEADER_SIZE + sizeof(struct neighbour_solicitation),
+		    0x3a, //ICMPv6
+		    get_ipv6_address(), &snma);
 
 	/* Fill ICMPv6 message */
 	headers.icmp6h->type = ICMPV6_NEIGHBOUR_SOLICITATION;
@@ -280,11 +279,10 @@ send_neighbour_advertisement (int fd, struct neighbor *target)
 			  sizeof(struct ip6hdr));
 
 	/* Fill IPv6 header */
-        fill_ip6hdr(ether_packet + sizeof(struct ethhdr),
-                   ICMPv6_HEADER_SIZE +
-		   sizeof(struct neighbour_advertisement),
-		   0x3a, //ICMPv6
-                   get_ipv6_address(), (ip6_addr_t *) &(target->ip.addr));
+	fill_ip6hdr(ether_packet + sizeof(struct ethhdr),
+		    ICMPv6_HEADER_SIZE + sizeof(struct neighbour_advertisement),
+		    0x3a, //ICMPv6
+		    get_ipv6_address(), (ip6_addr_t *) &(target->ip.addr));
 
 	/* Fill ICMPv6 message */
 	memcpy( &(headers.icmp6h->icmp6body.nghb_adv.target),
diff --git a/lib/libnet/ipv6.c b/lib/libnet/ipv6.c
index 49de5c7..62a444e 100644
--- a/lib/libnet/ipv6.c
+++ b/lib/libnet/ipv6.c
@@ -32,7 +32,6 @@
 #endif
 
 /****************************** PROTOTYPES *******************************/
-int8_t ip6addr_add (struct ip6addr_list_entry *new_address);
 static void ipv6_init(int fd);
 static int ip6_is_multicast (ip6_addr_t * ip);
 
@@ -252,7 +251,7 @@ int8_t unknown_prefix(ip6_addr_t *ip)
  * @return NULL - malloc failed
  *	   ! NULL - pointer to new prefix_info
  */
-struct prefix_info *ip6_create_prefix_info()
+struct prefix_info *ip6_create_prefix_info(void)
 {
 	struct prefix_info *prfx_info;
 
diff --git a/lib/libnet/netload.c b/lib/libnet/netload.c
index 848609d..cd3720a 100644
--- a/lib/libnet/netload.c
+++ b/lib/libnet/netload.c
@@ -856,8 +856,8 @@ int parse_tftp_args(char buffer[], char *server_ip, char filename[], int fd,
 		strcpy(domainname, tmp);
 		if (dns_get_ip(fd, domainname, server_ip6, 6) == 0) {
 			printf("\n DNS failed for IPV6\n");
-                        return -1;
-                }
+			return -1;
+		}
 		ipv6_to_str(server_ip6, server_ip);
 
 		strcpy(filename,(tmp1+1));
-- 
1.8.3.1



More information about the SLOF mailing list