Fix the compiler attribute test to work with Clang.
[tinc] / src / net_socket.c
index 15d32db..dcf8372 100644 (file)
@@ -210,6 +210,7 @@ int setup_listen_socket(const sockaddr_t *sa) {
 
                memset(&ifr, 0, sizeof(ifr));
                strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
+               ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0;
 
                if(setsockopt(nfd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr))) {
                        closesocket(nfd);
@@ -623,6 +624,7 @@ begin:
 }
 
 void setup_outgoing_connection(outgoing_t *outgoing, bool verbose) {
+       (void)verbose;
        timeout_del(&outgoing->ev);
 
        node_t *n = outgoing->node;
@@ -654,6 +656,7 @@ remove:
   new connection
 */
 void handle_new_meta_connection(void *data, int flags) {
+       (void)flags;
        listen_socket_t *l = data;
        connection_t *c;
        sockaddr_t sa;
@@ -746,6 +749,7 @@ void handle_new_meta_connection(void *data, int flags) {
   accept a new UNIX socket connection
 */
 void handle_new_unix_connection(void *data, int flags) {
+       (void)flags;
        io_t *io = data;
        connection_t *c;
        sockaddr_t sa;