diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2003-06-29 08:45:34 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2003-06-29 08:45:34 +0800 |
commit | 558493b6ebc21869dc6cf04b4ae06bfef00a5e23 (patch) | |
tree | 094a4dedb7acdd93ba69de3e45140c62276e3d88 | |
parent | 2b99784ea5d1e69d48b4f8a128c5e316642e00be (diff) | |
download | marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar.gz marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar.bz2 marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar.lz marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar.xz marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.tar.zst marcuscom-ports-558493b6ebc21869dc6cf04b4ae06bfef00a5e23.zip |
Fix gnome-netinfo so it actually works a little bit. There is still much
more work to do on this port.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@932 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | net/gnomenetwork/Makefile | 2 | ||||
-rw-r--r-- | net/gnomenetwork/files/patch-gnome-netinfo::info.c | 77 |
2 files changed, 76 insertions, 3 deletions
diff --git a/net/gnomenetwork/Makefile b/net/gnomenetwork/Makefile index 40a628e1d..b13072960 100644 --- a/net/gnomenetwork/Makefile +++ b/net/gnomenetwork/Makefile @@ -7,7 +7,7 @@ PORTNAME= gnomenetwork PORTVERSION= 1.99.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-network/1.99 diff --git a/net/gnomenetwork/files/patch-gnome-netinfo::info.c b/net/gnomenetwork/files/patch-gnome-netinfo::info.c index d5db83941..10087a01b 100644 --- a/net/gnomenetwork/files/patch-gnome-netinfo::info.c +++ b/net/gnomenetwork/files/patch-gnome-netinfo::info.c @@ -1,5 +1,5 @@ ---- gnome-netinfo/info.c.orig Tue Jun 3 04:51:08 2003 -+++ gnome-netinfo/info.c Tue Jun 3 04:52:27 2003 +--- info.c.orig Thu Mar 20 15:04:48 2003 ++++ info.c Sat Jun 28 20:45:20 2003 @@ -26,6 +26,10 @@ #endif @@ -11,3 +11,76 @@ #include <sys/socket.h> /* basic socket definitions */ #include <arpa/inet.h> /* inet(3) functions */ #include <sys/un.h> /* for Unix domain sockets */ +@@ -124,7 +128,7 @@ + gint flags; + gboolean loopback; + +- sockfd = socket (AF_INET, SOCK_DGRAM, 0); ++ sockfd = socket (AF_INET, SOCK_STREAM, 0); + + ifc.ifc_len = sizeof (buf); + ifc.ifc_req = (struct ifreq *) buf; +@@ -133,13 +137,13 @@ + for (ptr = buf; ptr < buf + ifc.ifc_len;) { + ifr = (struct ifreq *) ptr; + len = sizeof (struct sockaddr); +-#ifdef HAVE_SOCKADDR_SA_LEN ++#if defined(HAVE_SOCKADDR_SA_LEN) || defined(__FreeBSD__) + if (ifr->ifr_addr.sa_len > len) + len = ifr->ifr_addr.sa_len; /* length > 16 */ + #endif + ptr += sizeof (ifr->ifr_name) + len; /* for next one in buffer */ + +- if (strcmp (ifr->ifr_name, nic) != 0) { ++ if (strcmp (ifr->ifr_name, nic) != 0 || ifr->ifr_addr.sa_family != AF_INET) { + continue; + } + +@@ -149,10 +153,10 @@ + /* Get the IPv4 address */ + sinptr = (struct sockaddr_in *) &ifr->ifr_addr; + inet_ntop (AF_INET, &sinptr->sin_addr, dst, INFO_ADDRSTRLEN); +- ++ + gtk_label_set_text (GTK_LABEL (info->ip_address), dst); + bzero (dst, INFO_ADDRSTRLEN); +- ++ + ifrcopy = *ifr; + flags = ifrcopy.ifr_flags; + +@@ -255,7 +259,7 @@ + break; + } + } +- g_free (ifr); ++/* g_free (ifr);*/ + } + + GList * +@@ -269,8 +273,10 @@ + struct ifreq *ifr; + int sockfd, len; + +- sockfd = socket (AF_INET, SOCK_DGRAM, 0); ++ sockfd = socket (AF_INET, SOCK_STREAM, 0); + ++ bzero (&ifc, sizeof (struct ifconf)); ++ bzero (&buf, sizeof (buf)); + ifc.ifc_len = sizeof (buf); + ifc.ifc_req = (struct ifreq *) buf; + +@@ -281,9 +287,11 @@ + len = sizeof (struct sockaddr); + + iface = g_strdup (ifr->ifr_name); +- items = g_list_append (items, iface); ++ if (g_list_find_custom (items, iface, (GCompareFunc) g_ascii_strcasecmp) == NULL) { ++ items = g_list_append (items, iface); ++ } + +-#ifdef HAVE_SOCKADDR_SA_LEN ++#if defined(HAVE_SOCKADDR_SA_LEN) || defined(__FreeBSD__) + if (ifr->ifr_addr.sa_len > len) + len = ifr->ifr_addr.sa_len; /* length > 16 */ + #endif |