| @@ -1,12 +1,40 @@ | | | @@ -1,12 +1,40 @@ |
1 | $NetBSD: patch-aj,v 1.2 2010/08/05 18:55:18 drochner Exp $ | | 1 | $NetBSD: patch-aj,v 1.3 2011/10/13 13:28:12 hans Exp $ |
2 | | | 2 | |
3 | --- gst-libs/gst/farsight/fs-interfaces.c.orig 2010-05-31 19:20:03.000000000 +0000 | | 3 | --- gst-libs/gst/farsight/fs-interfaces.c.orig 2011-02-10 20:29:39.000000000 +0100 |
4 | +++ gst-libs/gst/farsight/fs-interfaces.c | | 4 | +++ gst-libs/gst/farsight/fs-interfaces.c 2011-10-12 18:58:16.132751166 +0200 |
5 | @@ -44,6 +44,7 @@ | | 5 | @@ -44,6 +44,10 @@ |
6 | #include <sys/socket.h> | | 6 | #include <sys/socket.h> |
7 | #include <ifaddrs.h> | | 7 | #include <ifaddrs.h> |
8 | #endif | | 8 | #endif |
9 | +#include <netinet/in.h> | | 9 | +#include <netinet/in.h> |
| | | 10 | +#ifdef __sun |
| | | 11 | +#include <sys/sockio.h> |
| | | 12 | +#endif |
10 | | | 13 | |
11 | #include <gst/gst.h> | | 14 | #include <gst/gst.h> |
12 | | | 15 | |
| | | 16 | @@ -327,8 +329,8 @@ gchar * |
| | | 17 | fs_interfaces_get_ip_for_interface (gchar *interface_name) |
| | | 18 | { |
| | | 19 | union { |
| | | 20 | - struct sockaddr s_addr; |
| | | 21 | - struct sockaddr_in sin_addr; |
| | | 22 | + struct sockaddr u_s_addr; |
| | | 23 | + struct sockaddr_in u_sin_addr; |
| | | 24 | } sockaddr_union; |
| | | 25 | struct ifreq ifr; |
| | | 26 | gint sockfd; |
| | | 27 | @@ -351,10 +353,10 @@ fs_interfaces_get_ip_for_interface (gcha |
| | | 28 | } |
| | | 29 | |
| | | 30 | close (sockfd); |
| | | 31 | - sockaddr_union.s_addr = ifr.ifr_addr; |
| | | 32 | + sockaddr_union.u_s_addr = ifr.ifr_addr; |
| | | 33 | GST_DEBUG ("Address for %s: %s", interface_name, |
| | | 34 | - inet_ntoa (sockaddr_union.sin_addr.sin_addr)); |
| | | 35 | - return g_strdup (inet_ntoa (sockaddr_union.sin_addr.sin_addr)); |
| | | 36 | + inet_ntoa (sockaddr_union.u_sin_addr.sin_addr)); |
| | | 37 | + return g_strdup (inet_ntoa (sockaddr_union.u_sin_addr.sin_addr)); |
| | | 38 | } |
| | | 39 | |
| | | 40 | #else /* G_OS_UNIX */ |