@@ -442,11 +442,11 @@ static void trie_insert (struct trie_node *this, const struct sockaddr *sa, int
442
442
u32 addr [4 ] = {0 };
443
443
u32 mask [4 ] = {0 };
444
444
if (!sockaddr_to_addr (sa , addr )) {
445
- log_debug ("Unknown address family %u, address not inserted.\n " , sa -> sa_family );
445
+ log_debug ("Unknown address family %u, address not inserted." , sa -> sa_family );
446
446
return ;
447
447
}
448
448
if (!sockaddr_to_mask (sa , bits , mask )) {
449
- log_debug ("Bad netmask length %d for address family %u, address not inserted.\n " , bits , sa -> sa_family );
449
+ log_debug ("Bad netmask length %d for address family %u, address not inserted." , bits , sa -> sa_family );
450
450
return ;
451
451
}
452
452
/* First node doesn't have a mask or address of its own; we have to check the
@@ -497,7 +497,7 @@ static int trie_match (const struct trie_node *this, const struct sockaddr *sa)
497
497
{
498
498
u32 addr [4 ] = {0 };
499
499
if (!sockaddr_to_addr (sa , addr )) {
500
- log_debug ("Unknown address family %u, cannot match.\n " , sa -> sa_family );
500
+ log_debug ("Unknown address family %u, cannot match." , sa -> sa_family );
501
501
return 0 ;
502
502
}
503
503
/* Manually check first bit to decide which branch to match against */
@@ -620,7 +620,7 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
620
620
errno = 0 ;
621
621
netmask_bits = parse_long (netmask_s , & tail );
622
622
if (errno != 0 || * tail != '\0' || tail == netmask_s ) {
623
- log_user ("Error parsing netmask in \"%s\".\n " , spec );
623
+ log_user ("Error parsing netmask in \"%s\"." , spec );
624
624
free (local_spec );
625
625
return 0 ;
626
626
}
@@ -637,14 +637,14 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
637
637
|| (addr -> ai_family == AF_INET6 && netmask_bits > 128 )
638
638
#endif
639
639
) {
640
- log_user ("Illegal netmask in \"%s\". Must be smaller than address bit length.\n " , spec );
640
+ log_user ("Illegal netmask in \"%s\". Must be smaller than address bit length." , spec );
641
641
free (local_spec );
642
642
freeaddrinfo (addrs );
643
643
return 0 ;
644
644
}
645
645
address_to_string (addr -> ai_addr , addr -> ai_addrlen , addr_string , sizeof (addr_string ));
646
646
trie_insert (set -> trie , addr -> ai_addr , netmask_bits );
647
- log_debug ("Add IP %s/%d to addrset (trie).\n " , addr_string , netmask_bits );
647
+ log_debug ("Add IP %s/%d to addrset (trie)." , addr_string , netmask_bits );
648
648
}
649
649
free (local_spec );
650
650
freeaddrinfo (addrs );
@@ -657,13 +657,13 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
657
657
/* Check if this is an IPv4 address, with optional ranges and wildcards. */
658
658
if (parse_ipv4_ranges (elem , local_spec )) {
659
659
if (netmask_bits > 32 ) {
660
- log_user ("Illegal netmask in \"%s\". Must be between 0 and 32.\n " , spec );
660
+ log_user ("Illegal netmask in \"%s\". Must be between 0 and 32." , spec );
661
661
free (local_spec );
662
662
free (elem );
663
663
return 0 ;
664
664
}
665
665
apply_ipv4_netmask_bits (elem , netmask_bits );
666
- log_debug ("Add IPv4 range %s/%ld to addrset.\n " , local_spec , netmask_bits > 0 ? netmask_bits : 32 );
666
+ log_debug ("Add IPv4 range %s/%ld to addrset." , local_spec , netmask_bits > 0 ? netmask_bits : 32 );
667
667
elem -> next = set -> head ;
668
668
set -> head = elem ;
669
669
free (local_spec );
@@ -675,12 +675,12 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
675
675
/* When all else fails, resolve the name. */
676
676
rc = resolve_name (local_spec , & addrs , af , dns );
677
677
if (rc != 0 ) {
678
- log_user ("Error resolving name \"%s\": %s\n " , local_spec , gai_strerror (rc ));
678
+ log_user ("Error resolving name \"%s\": %s" , local_spec , gai_strerror (rc ));
679
679
free (local_spec );
680
680
return 0 ;
681
681
}
682
682
if (addrs == NULL )
683
- log_user ("Warning: no addresses found for %s.\n " , local_spec );
683
+ log_user ("Warning: no addresses found for %s." , local_spec );
684
684
free (local_spec );
685
685
686
686
/* Walk the list of addresses and add them all to the set with netmasks. */
@@ -698,23 +698,23 @@ int addrset_add_spec(struct addrset *set, const char *spec, int af, int dns)
698
698
if (addr -> ai_family == AF_INET ) {
699
699
700
700
if (netmask_bits > 32 ) {
701
- log_user ("Illegal netmask in \"%s\". Must be between 0 and 32.\n " , spec );
701
+ log_user ("Illegal netmask in \"%s\". Must be between 0 and 32." , spec );
702
702
freeaddrinfo (addrs );
703
703
return 0 ;
704
704
}
705
- log_debug ("Add IPv4 %s/%ld to addrset (trie).\n " , addr_string , netmask_bits > 0 ? netmask_bits : 32 );
705
+ log_debug ("Add IPv4 %s/%ld to addrset (trie)." , addr_string , netmask_bits > 0 ? netmask_bits : 32 );
706
706
707
707
#ifdef HAVE_IPV6
708
708
} else if (addr -> ai_family == AF_INET6 ) {
709
709
if (netmask_bits > 128 ) {
710
- log_user ("Illegal netmask in \"%s\". Must be between 0 and 128.\n " , spec );
710
+ log_user ("Illegal netmask in \"%s\". Must be between 0 and 128." , spec );
711
711
freeaddrinfo (addrs );
712
712
return 0 ;
713
713
}
714
- log_debug ("Add IPv6 %s/%ld to addrset (trie).\n " , addr_string , netmask_bits > 0 ? netmask_bits : 128 );
714
+ log_debug ("Add IPv6 %s/%ld to addrset (trie)." , addr_string , netmask_bits > 0 ? netmask_bits : 128 );
715
715
#endif
716
716
} else {
717
- log_debug ("ignoring address %s for %s. Family %d socktype %d protocol %d.\n " , addr_string , spec , addr -> ai_family , addr -> ai_socktype , addr -> ai_protocol );
717
+ log_debug ("ignoring address %s for %s. Family %d socktype %d protocol %d." , addr_string , spec , addr -> ai_family , addr -> ai_socktype , addr -> ai_protocol );
718
718
continue ;
719
719
}
720
720
@@ -751,7 +751,7 @@ int addrset_add_file(struct addrset *set, FILE *fd, int af, int dns)
751
751
if (i + 1 > sizeof (buf ) - 1 ) {
752
752
/* Truncate the specification to give a little context. */
753
753
buf [11 ] = '\0' ;
754
- log_user ("Host specification starting with \"%s\" is too long.\n " , buf );
754
+ log_user ("Host specification starting with \"%s\" is too long." , buf );
755
755
return 0 ;
756
756
}
757
757
buf [i ++ ] = c ;
0 commit comments