openbsd-ports/x11/gnome/gdm/patches/patch-gui_gdmchooser_c
jasper 88c7d3697c - update gdm to 2.20.1
- make the *beep* sounds work
- install the Xsession script with the executable bit, so gdm won't
  try to start gnome in failsafe mode. as reported by several users.

tested by fkr@
2007-11-27 20:26:13 +00:00

59 lines
1.4 KiB
Plaintext

$OpenBSD: patch-gui_gdmchooser_c,v 1.3 2007/11/27 20:26:13 jasper Exp $
--- gui/gdmchooser.c.orig Mon Oct 15 23:42:40 2007
+++ gui/gdmchooser.c Sat Oct 27 17:09:35 2007
@@ -40,6 +40,7 @@
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <ifaddrs.h>
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif
@@ -685,9 +686,38 @@ gdm_chooser_decode_packet (GIOChannel *source,
/* Find broadcast address for all active, non pointopoint interfaces */
+#ifdef __OpenBSD__
static void
gdm_chooser_find_bcaddr (void)
{
+ struct ifaddrs *ifa, *ifaddrs;
+ struct sockaddr_in *sin;
+ int i;
+
+ if (getifaddrs(&ifaddrs))
+ return;
+
+ for (ifa = ifaddrs, i = 0; ifa != NULL; ifa = ifa -> ifa_next) {
+ if (ifa->ifa_addr == NULL || !(ifa->ifa_flags & IFF_UP) ||
+ !(ifa->ifa_flags & IFF_BROADCAST))
+ continue;
+
+ switch(ifa->ifa_addr->sa_family) {
+ case AF_INET:
+ sin = (struct sockaddr_in *)ifa->ifa_broadaddr;
+ bcaddr = g_slist_append (bcaddr, sin);
+ i++;
+ break;
+ }
+ }
+ freeifaddrs(ifaddrs);
+}
+
+#else
+
+static void
+gdm_chooser_find_bcaddr (void)
+{
int i = 0, num;
int sock;
struct ifconf ifc;
@@ -747,6 +777,7 @@ gdm_chooser_find_bcaddr (void)
g_free (buf);
}
+#endif /*__OpenBSD__*/
/* Append multicast address into the list */
#ifdef ENABLE_IPV6