leopard-updates-20061109
authorDerrick Brashear <shadow@dementia.org>
Fri, 10 Nov 2006 00:14:16 +0000 (00:14 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 10 Nov 2006 00:14:16 +0000 (00:14 +0000)
make things work with current seeds

src/afs/afs_dcache.c
src/afs/afs_server.c
src/packaging/MacOS/InstallationCheck.8 [moved from src/packaging/MacOS/InstallationCheck with 100% similarity]
src/packaging/MacOS/InstallationCheck.9 [new file with mode: 0644]
src/packaging/MacOS/buildpkg.sh
src/rx/rx_kcommon.c

index f091d96..477ce65 100644 (file)
@@ -2821,7 +2821,7 @@ afs_MemGetDSlot(register afs_int32 aslot, register struct dcache *tmpdc)
     if (CheckLock(&afs_xdcache) != -1)
        osi_Panic("getdslot nolock");
     if (aslot < 0 || aslot >= afs_cacheFiles)
-       osi_Panic("getdslot slot");
+       osi_Panic("getdslot slot %d (of %d)", aslot, afs_cacheFiles);
     tdc = afs_indexTable[aslot];
     if (tdc) {
        QRemove(&tdc->lruq);    /* move to queue head */
@@ -2913,7 +2913,7 @@ afs_UFSGetDSlot(register afs_int32 aslot, register struct dcache *tmpdc)
     if (CheckLock(&afs_xdcache) != -1)
        osi_Panic("getdslot nolock");
     if (aslot < 0 || aslot >= afs_cacheFiles)
-       osi_Panic("getdslot slot");
+       osi_Panic("getdslot slot %d (of %d)", aslot, afs_cacheFiles);
     tdc = afs_indexTable[aslot];
     if (tdc) {
        QRemove(&tdc->lruq);    /* move to queue head */
index de863b4..edd6b27 100644 (file)
@@ -1383,15 +1383,22 @@ static int afs_SetServerPrefs(struct srvAddr *sa) {
 #elif defined(AFS_DARWIN80_ENV)
     {
        errno_t t;
-       int cnt=0;
-       ifaddr_t *addresses, address;
-       t = ifnet_get_address_list_family(NULL, &addresses, AF_INET);
-       if (t == 0) {
-           while(addresses[cnt] != NULL) {
-               afsi_SetServerIPRank(sa, address);
-               cnt++;
+       unsigned int count;
+       int cnt=0, m, j;
+       ifaddr_t *ifads;
+       ifnet_t *ifn;
+
+       if (!ifnet_list_get(AF_INET, &ifn, &count)) {
+           for (m = 0; m < count; m++) {
+               if (!ifnet_get_address_list(ifn[m], &ifads)) {
+                   for (j = 0; ifads[j] != NULL && cnt < ADDRSPERSITE; j++) {
+                       afsi_SetServerIPRank(sa, ifads[j]);
+                       cnt++;
+                   }
+                   ifnet_free_address_list(ifads);
+               }
            }
-           ifnet_free_address_list(addresses);
+           ifnet_list_free(ifn);
        }
     }
 #elif defined(AFS_DARWIN60_ENV)
diff --git a/src/packaging/MacOS/InstallationCheck.9 b/src/packaging/MacOS/InstallationCheck.9
new file mode 100644 (file)
index 0000000..9061222
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+majorvers=`uname -r | sed 's/\..*//'`
+echo "InstallationCheck: os release is $majorvers"
+if [ $majorvers -ne 9 ]; then
+echo "InstallationCheck: not ok"
+       exit 112
+fi
+
+echo "InstallationCheck: ok"
+exit 0
index c05dfb9..749b8e1 100644 (file)
@@ -114,7 +114,7 @@ if [ $firstpass = yes ]; then
     mkdir -p $PKGROOT/private/var/db/openafs/cache
     mkdir -p $PKGROOT/private/var/db/openafs/etc/config
     cp $CURDIR/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
-    echo openafs.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
+    echo grand.central.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
     if [ $majorvers -ge 7 ]; then
        echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
         cp -RP $PKGROOT/Library/OpenAFS/Tools/etc/afssettings $PKGROOT/private/var/db/openafs/etc/config
@@ -122,7 +122,7 @@ if [ $firstpass = yes ]; then
     else
        echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
     fi
-    echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
+    echo '-memcache -afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
 
     strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
 
@@ -171,7 +171,7 @@ if [ $secondpass = yes ]; then
        cp OpenAFS.post_install $PKGRES/postupgrade
        cp background.jpg $PKGRES/background.jpg
        if [ $majorvers -ge 8 ]; then
-           cp InstallationCheck $PKGRES
+           cp InstallationCheck.$majorvers $PKGRES/InstallationCheck
            mkdir -p $PKGRES/English.lproj
            cp InstallationCheck $PKGRES/English.lproj
            chmod a+x $PKGRES/InstallationCheck
index 8a3da04..37997db 100644 (file)
@@ -643,11 +643,13 @@ rxi_GetIFInfo(void)
     afs_uint32 ifinaddr;
 #if defined(AFS_DARWIN80_ENV)
     errno_t t;
-    int cnt=0;
-    ifaddr_t *ifads, ifad;
-    register ifnet_t ifn;
+    unsigned int count;
+    int cnt=0, m, j;
+    ifaddr_t *ifads;
+    ifnet_t *ifn;
     struct sockaddr sout;
     struct sockaddr_in *sin;
+    struct in_addr pin;
 #else
     struct ifaddr *ifad;       /* ifnet points to a if_addrlist of ifaddrs */
     register struct ifnet *ifn;
@@ -657,31 +659,38 @@ rxi_GetIFInfo(void)
     memset(mtus, 0, sizeof(mtus));
 
 #if defined(AFS_DARWIN80_ENV)
-    t = ifnet_get_address_list_family(NULL, &ifads, AF_INET);
-    if (t == 0) {
-       rxmtu = ifnet_mtu(ifn) - RX_IPUDP_SIZE;
-       while((ifads[cnt] != NULL) && cnt < ADDRSPERSITE) {
-           t = ifaddr_address(ifads[cnt], &sout, sizeof(sout));
-           sin = (struct sockaddr_in *)&sout;
-           ifinaddr = ntohl(sin->sin_addr.s_addr);
-           if (myNetAddrs[i] != ifinaddr) {
-               different++;
-           }
-           mtus[i] = rxmtu;
-           rxmtu = rxi_AdjustIfMTU(rxmtu);
-           maxmtu =
-               rxmtu * rxi_nRecvFrags +
-               ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE);
-           maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);
-           addrs[i++] = ifinaddr;
-           if ((ifinaddr != 0x7f000001) && (maxmtu > rx_maxReceiveSize)) {
-               rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu);
-               rx_maxReceiveSize =
-                   MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser);
+    if (!ifnet_list_get(AF_INET, &ifn, &count)) {
+       for (m = 0; m < count; m++) {
+           if (!ifnet_get_address_list(ifn[m], &ifads)) {
+               for (j = 0; ifads[j] != NULL && cnt < ADDRSPERSITE; j++) {
+                   if ((t = ifaddr_address(ifads[j], &sout, sizeof(struct sockaddr))) == 0) {
+                       sin = (struct sockaddr_in *)&sout;
+                       rxmtu = ifnet_mtu(ifaddr_ifnet(ifads[j])) - RX_IPUDP_SIZE;
+                       ifinaddr = ntohl(sin->sin_addr.s_addr);
+                       if (myNetAddrs[i] != ifinaddr) {
+                           different++;
+                       }
+                       mtus[i] = rxmtu;
+                       rxmtu = rxi_AdjustIfMTU(rxmtu);
+                       maxmtu =
+                           rxmtu * rxi_nRecvFrags +
+                           ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE);
+                       maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);
+                       addrs[i++] = ifinaddr;
+                       if ((ifinaddr != 0x7f000001) && 
+                           (maxmtu > rx_maxReceiveSize)) {
+                           rx_maxReceiveSize = 
+                               MIN(RX_MAX_PACKET_SIZE, maxmtu);
+                           rx_maxReceiveSize =
+                               MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser);
+                       }
+                       cnt++;
+                   }
+               }
+               ifnet_free_address_list(ifads);
            }
-           cnt++;
        }
-       ifnet_free_address_list(ifads);
+       ifnet_list_free(ifn);
     }
 #else
 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
@@ -737,10 +746,10 @@ rxi_GetIFInfo(void)
     rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize);
 
     if (different) {
-       int j;
-       for (j = 0; j < i; j++) {
-           myNetMTUs[j] = mtus[j];
-           myNetAddrs[j] = addrs[j];
+       int l;
+       for (l = 0; l < i; l++) {
+           myNetMTUs[l] = mtus[l];
+           myNetAddrs[l] = addrs[l];
        }
     }
     return different;