diff options
author | Alexander Nedotsukov <bland@FreeBSD.org> | 2003-11-14 14:35:23 +0000 |
---|---|---|
committer | Alexander Nedotsukov <bland@FreeBSD.org> | 2003-11-14 14:35:23 +0000 |
commit | bb594a14566e7e1fadbb34ea3a08a066224e6914 (patch) | |
tree | abe486daf5f5b8e5f406a771a813d8cf92bc261f | |
parent | Previous commit was: (diff) |
Fix assignment to .if_flags filed of netload structure. It supposed to be
bit flag set. And GLIBTOP_IF_FLAGS_xx are defined as bit offsets
not bitmasks as it was assumed before.
-rw-r--r-- | devel/libgtop2/Makefile | 2 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-sysdeps_freebsd_netload.c | 66 |
2 files changed, 60 insertions, 8 deletions
diff --git a/devel/libgtop2/Makefile b/devel/libgtop2/Makefile index 36570e2a4358..d57ab0eaa131 100644 --- a/devel/libgtop2/Makefile +++ b/devel/libgtop2/Makefile @@ -7,7 +7,7 @@ PORTNAME= libgtop2 PORTVERSION= 2.0.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME:S/2$//}/2.0 diff --git a/devel/libgtop2/files/patch-sysdeps_freebsd_netload.c b/devel/libgtop2/files/patch-sysdeps_freebsd_netload.c index 1f013d220014..0e72ddb7853c 100644 --- a/devel/libgtop2/files/patch-sysdeps_freebsd_netload.c +++ b/devel/libgtop2/files/patch-sysdeps_freebsd_netload.c @@ -1,5 +1,5 @@ ---- sysdeps/freebsd/netload.c.orig Sun Jan 12 21:40:04 2003 -+++ sysdeps/freebsd/netload.c Sat Feb 8 23:52:49 2003 +--- sysdeps/freebsd/netload.c.orig Mon Oct 20 01:55:32 2003 ++++ sysdeps/freebsd/netload.c Fri Nov 14 23:09:15 2003 @@ -83,6 +83,7 @@ u_long ifnetaddr, ifnetfound, ifaddraddr; struct sockaddr *sa; @@ -8,7 +8,7 @@ union { struct ifaddr ifa; -@@ -109,7 +109,7 @@ +@@ -109,10 +110,13 @@ sizeof (ifnet)) != sizeof (ifnet)) glibtop_error_io_r (server, "kvm_read (ifnetaddr)"); @@ -17,13 +17,65 @@ if (kvm_read (server->machine.kd, (u_long) ifnet.if_name, tname, 16) != 16) glibtop_error_io_r (server, "kvm_read (if_name)"); -@@ -113,6 +114,9 @@ - if (kvm_read (server->machine.kd, (u_long) ifnet.if_name, - tname, 16) != 16) - glibtop_error_io_r (server, "kvm_read (if_name)"); + snprintf(temp, (15 - strlen(tname)), "%d", ifnet.if_unit); + strcat(tname, temp); + tname [15] = 0; #else strncpy (tname, ifnet.if_xname, 16); tname [15] = 0; +@@ -140,39 +144,39 @@ + sin = (struct sockaddr_in *)sa; + + if (ifnet.if_flags & IFF_UP) +- buf->if_flags |= GLIBTOP_IF_FLAGS_UP; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); + if (ifnet.if_flags & IFF_BROADCAST) +- buf->if_flags |= GLIBTOP_IF_FLAGS_BROADCAST; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); + if (ifnet.if_flags & IFF_DEBUG) +- buf->if_flags |= GLIBTOP_IF_FLAGS_DEBUG; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); + if (ifnet.if_flags & IFF_LOOPBACK) +- buf->if_flags |= GLIBTOP_IF_FLAGS_LOOPBACK; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); + if (ifnet.if_flags & IFF_POINTOPOINT) +- buf->if_flags |= GLIBTOP_IF_FLAGS_POINTOPOINT; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); + if (ifnet.if_flags & IFF_RUNNING) +- buf->if_flags |= GLIBTOP_IF_FLAGS_RUNNING; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); + if (ifnet.if_flags & IFF_NOARP) +- buf->if_flags |= GLIBTOP_IF_FLAGS_NOARP; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); + if (ifnet.if_flags & IFF_PROMISC) +- buf->if_flags |= GLIBTOP_IF_FLAGS_PROMISC; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); + if (ifnet.if_flags & IFF_ALLMULTI) +- buf->if_flags |= GLIBTOP_IF_FLAGS_ALLMULTI; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); + if (ifnet.if_flags & IFF_OACTIVE) +- buf->if_flags |= GLIBTOP_IF_FLAGS_OACTIVE; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_OACTIVE); + if (ifnet.if_flags & IFF_SIMPLEX) +- buf->if_flags |= GLIBTOP_IF_FLAGS_SIMPLEX; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_SIMPLEX); + if (ifnet.if_flags & IFF_LINK0) +- buf->if_flags |= GLIBTOP_IF_FLAGS_LINK0; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK0); + if (ifnet.if_flags & IFF_LINK1) +- buf->if_flags |= GLIBTOP_IF_FLAGS_LINK1; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK1); + if (ifnet.if_flags & IFF_LINK2) +- buf->if_flags |= GLIBTOP_IF_FLAGS_LINK2; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LINK2); + #ifdef __FreeBSD__ + if (ifnet.if_flags & IFF_ALTPHYS) +- buf->if_flags |= GLIBTOP_IF_FLAGS_ALTPHYS; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALTPHYS); + #endif + if (ifnet.if_flags & IFF_MULTICAST) +- buf->if_flags |= GLIBTOP_IF_FLAGS_MULTICAST; ++ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); + + #if !defined(__bsdi__) + /* Commenting out to "fix" #13345. */ |