}
addrs = afs_osi_Alloc(srvAddrCount * sizeof(*addrs));
+ osi_Assert(addrs != NULL);
j = 0;
for (i = 0; i < NSERVERS; i++) {
for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) {
}
addrs = afs_osi_Alloc(srvAddrCount * sizeof(*addrs));
+ osi_Assert(addrs != NULL);
j = 0;
for (i = 0; i < NSERVERS; i++) {
for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) {
ReleaseReadLock(&afs_xsrvAddr);
ReleaseReadLock(&afs_xserver);
- conns = (struct afs_conn **)afs_osi_Alloc(j * sizeof(struct afs_conn *));
- rxconns = (struct rx_connection **)afs_osi_Alloc(j * sizeof(struct rx_connection *));
- conntimer = (afs_int32 *)afs_osi_Alloc(j * sizeof (afs_int32));
- deltas = (afs_int32 *)afs_osi_Alloc(j * sizeof (afs_int32));
- results = (afs_int32 *)afs_osi_Alloc(j * sizeof (afs_int32));
-
- caps = (Capabilities *)afs_osi_Alloc(j * sizeof (Capabilities));
+ conns = afs_osi_Alloc(j * sizeof(struct afs_conn *));
+ osi_Assert(conns != NULL);
+ rxconns = afs_osi_Alloc(j * sizeof(struct rx_connection *));
+ osi_Assert(rxconns != NULL);
+ conntimer = afs_osi_Alloc(j * sizeof (afs_int32));
+ osi_Assert(conntimer != NULL);
+ deltas = afs_osi_Alloc(j * sizeof (afs_int32));
+ osi_Assert(deltas != NULL);
+ results = afs_osi_Alloc(j * sizeof (afs_int32));
+ osi_Assert(results != NULL);
+
+ caps = afs_osi_Alloc(j * sizeof (Capabilities));
+ osi_Assert(caps != NULL);
memset(caps, 0, j * sizeof(Capabilities));
for (i = 0; i < j; i++) {
return;
}
#else /* AFS_USERSPACE_IP_ADDR */
-#if (! defined(AFS_SUN5_ENV)) && !defined(AFS_DARWIN_ENV) && defined(USEIFADDR)
+#if (! defined(AFS_SUN5_ENV)) && (! defined(AFS_DARWIN_ENV)) && (! defined(AFS_OBSD47_ENV)) && defined(USEIFADDR)
void
afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa)
{
#endif /* IFF_POINTTOPOINT */
}
#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) */
-#if defined(AFS_DARWIN_ENV) && defined(USEIFADDR)
+#if (defined(AFS_DARWIN_ENV) || defined(AFS_OBSD47_ENV)) && defined(USEIFADDR)
#ifndef afs_min
#define afs_min(A,B) ((A)<(B)) ? (A) : (B)
#endif
if (rx_ifaddr_address_family(ifa) != AF_INET)
return;
t = rx_ifaddr_address(ifa, &sout, sizeof(sout));
- if (t == 0) {
+ if (t != 0) {
sin = (struct sockaddr_in *)&sout;
myAddr = ntohl(sin->sin_addr.s_addr); /* one of my IP addr in host order */
} else {
}
serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */
t = rx_ifaddr_netmask(ifa, &sout, sizeof(sout));
- if (t == 0) {
+ if (t != 0) {
sin = (struct sockaddr_in *)&sout;
subnetmask = ntohl(sin->sin_addr.s_addr); /* subnet mask in host order */
} else {
subnetmask = 0;
}
t = rx_ifaddr_dstaddress(ifa, &sout, sizeof(sout));
- if (t == 0) {
+ if (t != 0) {
sin = (struct sockaddr_in *)&sout;
- myDstaddr = sin->sin_addr.s_addr;
+ myDstaddr = ntohl(sin->sin_addr.s_addr);
} else {
myDstaddr = 0;
}
if (oldts) {
newts = oldts;
} else {
- newts = (struct server *)afs_osi_Alloc(sizeof(struct server));
+ newts = afs_osi_Alloc(sizeof(struct server));
if (!newts)
panic("malloc of server struct");
afs_totalServers++;
if (oldsa) {
newsa = oldsa;
} else {
- newsa = (struct srvAddr *)afs_osi_Alloc(sizeof(struct srvAddr));
+ newsa = afs_osi_Alloc(sizeof(struct srvAddr));
if (!newsa)
panic("malloc of srvAddr struct");
afs_totalSrvAddrs++;
/* Have a srvAddr struct. Now get a server struct (if not already) */
if (!orphts) {
- orphts =
- (struct server *)afs_osi_Alloc(sizeof(struct server));
+ orphts = afs_osi_Alloc(sizeof(struct server));
if (!orphts)
panic("malloc of lo server struct");
memset(orphts, 0, sizeof(struct server));