summaryrefslogtreecommitdiff
path: root/net/gnome-netstatus/patches
diff options
context:
space:
mode:
authorahoka <ahoka@pkgsrc.org>2008-08-04 14:54:27 +0000
committerahoka <ahoka@pkgsrc.org>2008-08-04 14:54:27 +0000
commit758b5ba50bb759ac662f94c0b2399532bfa4187b (patch)
tree7d8908890c2f0a07ba2eb78e93cb3daadcd3a871 /net/gnome-netstatus/patches
parent4971200302963886d390613e09ef21a8b876705a (diff)
downloadpkgsrc-758b5ba50bb759ac662f94c0b2399532bfa4187b.tar.gz
Fix interface listing on NetBSD and FreeBSD.
Patch submitted by Roy Marples. For more information about the problem see: http://bugzilla.gnome.org/show_bug.cgi?id=453070
Diffstat (limited to 'net/gnome-netstatus/patches')
-rw-r--r--net/gnome-netstatus/patches/patch-aa31
1 files changed, 31 insertions, 0 deletions
diff --git a/net/gnome-netstatus/patches/patch-aa b/net/gnome-netstatus/patches/patch-aa
new file mode 100644
index 00000000000..2de79413ca3
--- /dev/null
+++ b/net/gnome-netstatus/patches/patch-aa
@@ -0,0 +1,31 @@
+$NetBSD $
+
+--- src/netstatus-iface.c.orig 2007-02-13 10:39:19.000000000 +0100
++++ src/netstatus-iface.c
+@@ -1121,12 +1121,6 @@ netstatus_iface_get_device_details (Nets
+ return TRUE;
+ }
+
+-#if !defined(HAVE_SOCKADDR_SA_LEN)
+-#define NETSTATUS_SA_LEN(saddr) (sizeof (struct sockaddr))
+-#else
+-#define NETSTATUS_SA_LEN(saddr) (MAX ((saddr)->sa_len, sizeof (struct sockaddr)))
+-#endif /* HAVE_SOCKADDR_SA_LEN */
+-
+ /* Taken From R. Stevens Unix Network Programming Vol. 1.
+ *
+ * SIOCGIFCONF does not return an error on all systems if
+@@ -1220,7 +1214,12 @@ netstatus_list_interface_names (GError *
+ struct ifreq *if_req = (struct ifreq *) p;
+ gboolean loopback = FALSE;
+
+- p += sizeof (if_req->ifr_name) + NETSTATUS_SA_LEN (&if_req->ifr_addr);
++#ifdef HAVE_SOCKADDR_SA_LEN
++ if (if_req->ifr_addr.sa_len > sizeof(if_req->ifr_ifru))
++ p += offsetof(struct ifreq, ifr_ifru) + if_req->ifr_addr.sa_len;
++ else
++#endif /* HAVE_SOCKADDR_SA_LEN */
++ p += sizeof (*if_req);
+
+ if (ioctl (fd, SIOCGIFFLAGS, if_req) < 0)
+ {