]> xenbits.xensource.com Git - libvirt.git/commitdiff
netdev: Use the correct pointer type for virSocketAddrFormat()
authorAndrea Bolognani <abologna@redhat.com>
Fri, 8 Apr 2016 09:07:16 +0000 (11:07 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 8 Apr 2016 11:05:31 +0000 (13:05 +0200)
virSocketAddrFormat() wants a single pointer, not a double pointer.

Fixes the following compilation error on FreeBSD:

  util/virnetdev.c:1448:72: error: incompatible pointer types passing
   'virSocketAddr **' to parameter of type 'const virSocketAddr *';
   remove & [-Werror,-Wincompatible-pointer-types]
      if (VIR_SOCKET_ADDR_VALID(peer) && !(peerstr = virSocketAddrFormat(&peer)))
                                                                         ^~~~~
  ./util/virsocketaddr.h:92:48: note: passing argument to parameter 'addr' here
  char *virSocketAddrFormat(const virSocketAddr *addr);
                                                 ^

src/util/virnetdev.c

index 6e32ebbf6cee8a9711a8065bc0baf169f58974aa..712c3bcc32c49c13867707449d6ae78fc16755c7 100644 (file)
@@ -1445,7 +1445,7 @@ int virNetDevSetIPAddress(const char *ifname,
     if (!(addrstr = virSocketAddrFormat(addr)))
         goto cleanup;
 
-    if (VIR_SOCKET_ADDR_VALID(peer) && !(peerstr = virSocketAddrFormat(&peer)))
+    if (VIR_SOCKET_ADDR_VALID(peer) && !(peerstr = virSocketAddrFormat(peer)))
         goto cleanup;
 
     /* format up a broadcast address if this is IPv4 */