summaryrefslogtreecommitdiff
path: root/multimedia/farsight2/patches/patch-aj
blob: 9682dcc4fb5c511f6f2c47532ed9149a4013c07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$NetBSD: patch-aj,v 1.4 2013/04/14 19:51:05 wiz Exp $

--- gst-libs/gst/farsight/fs-interfaces.c.orig	2011-10-09 21:06:33.000000000 +0000
+++ gst-libs/gst/farsight/fs-interfaces.c
@@ -58,6 +58,10 @@ GST_DEBUG_CATEGORY_EXTERN (fs_base_confe
  #include <sys/socket.h>
  #include <ifaddrs.h>
 #endif
+#include <netinet/in.h>
+#ifdef __sun
+#include <sys/sockio.h>
+#endif
 
 /**
  * fs_interfaces_get_local_interfaces:
@@ -326,8 +330,8 @@ gchar *
 fs_interfaces_get_ip_for_interface (gchar *interface_name)
 {
   union  {
-    struct sockaddr  s_addr;
-    struct sockaddr_in sin_addr;
+    struct sockaddr  u_s_addr;
+    struct sockaddr_in u_sin_addr;
   } sockaddr_union;
   struct ifreq ifr;
   gint sockfd;
@@ -350,10 +354,10 @@ fs_interfaces_get_ip_for_interface (gcha
   }
 
   close (sockfd);
-  sockaddr_union.s_addr = ifr.ifr_addr;
+  sockaddr_union.u_s_addr = ifr.ifr_addr;
   GST_DEBUG ("Address for %s: %s", interface_name,
-      inet_ntoa (sockaddr_union.sin_addr.sin_addr));
-  return g_strdup (inet_ntoa (sockaddr_union.sin_addr.sin_addr));
+      inet_ntoa (sockaddr_union.u_sin_addr.sin_addr));
+  return g_strdup (inet_ntoa (sockaddr_union.u_sin_addr.sin_addr));
 }
 
 #else /* G_OS_UNIX */