From: Jim Rees Date: Wed, 16 Oct 2002 18:48:47 +0000 (+0000) Subject: openbsd-20021016 X-Git-Tag: openafs-devel-1_3_50~559 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b68affbc6cfa906dd931be04d814c284b5110319;p=packages%2Fo%2Fopenafs.git openbsd-20021016 Fix includes for mbuf.h, if.h auth/cellconfig.p.h: Use (void *) for 2d arg to afsconf_ClientAuth(), since we have no def for struct rx_securityClass at this point ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== More OpenBSD merge prototypes cleanup --- diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index 39a1309e1..9ed277015 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -105,7 +105,7 @@ static int afs_InitSetup(int preallocs) int code; if (afs_InitSetup_done) - return; + return EAGAIN; #ifndef AFS_NOSTATS /* @@ -303,6 +303,7 @@ void afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, /* leaving as is, probably will barf if we add prototypes here since it's likely being called with partial list */ +int afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) long parm, parm2, parm3, parm4, parm5, parm6; { @@ -499,7 +500,7 @@ long parm, parm2, parm3, parm4, parm5, parm6; } else if (parm == AFSOP_ADDCELL2) { struct afsop_cell tcell; char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0; - char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0; + char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ); int cflags = parm4; /* wait for basic init */ @@ -724,11 +725,6 @@ long parm, parm2, parm3, parm4, parm5, parm6; #endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */ #endif /* AFS_SGI53_ENV */ else if (parm == AFSOP_SHUTDOWN) { -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - extern struct mount *afs_globalVFS; -#else /* AFS_OSF_ENV */ - extern struct vfs *afs_globalVFS; -#endif afs_cold_shutdown = 0; if (parm == 1) afs_cold_shutdown = 1; if (afs_globalVFS != 0) { @@ -1188,6 +1184,7 @@ Afs_syscall () long parm6; } *uap = (struct a *)u.u_ap; #else /* UKERNEL */ +int #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) afs_syscall () #else @@ -1376,7 +1373,7 @@ Afs_syscall () code = EINVAL; #endif } -out: + #ifdef AFS_LINUX20_ENV code = -code; unlock_kernel(); @@ -1571,7 +1568,6 @@ extern struct afs_icl_set *afs_icl_FindSet(); static int Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) { - register int i; afs_int32 *lp, elts, flags; register afs_int32 code; struct afs_icl_log *logp; @@ -1795,14 +1791,14 @@ afs_lock_t afs_icl_lock; int afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID, afs_int32 lAndT, long p1, long p2, long p3, long p4) { - register struct afs_icl_log *logp; afs_int32 mask; register int i; register afs_int32 tmask; int ix; /* If things aren't init'ed yet (or the set is inactive), don't panic */ - if (!ICL_SETACTIVE(setp)) return; + if (!ICL_SETACTIVE(setp)) + return 0; AFS_ASSERT_GLOCK(); mask = lAndT>>24 & 0xff; /* mask of which logs to log to */ @@ -1819,6 +1815,7 @@ int afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID, } } ReleaseReadLock(&setp->lock); + return 0; } /* Next 4 routines should be implemented via var-args or something. @@ -1857,7 +1854,7 @@ struct afs_icl_log *afs_icl_allLogs = 0; * * Log must be write-locked. */ -static afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace) +static void afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace) { register unsigned int tsize; @@ -1877,7 +1874,7 @@ static afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace * log must be write-locked. */ #define ICL_CHARSPERLONG 4 -static afs_int32 afs_icl_AppendString(struct afs_icl_log *logp, char *astr) +static void afs_icl_AppendString(struct afs_icl_log *logp, char *astr) { char *op; /* ptr to char to write */ int tc; @@ -1954,7 +1951,7 @@ int afs_icl_UseAddr(int type) * pretty soon, anyway. The log must be unlocked. */ -int afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, +void afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, afs_int32 types, long p1, long p2, long p3, long p4) { int rsize; /* record size in longs */ @@ -2268,7 +2265,6 @@ int afs_icl_CopyOut(register struct afs_icl_log *logp, afs_int32 *bufferp, { afs_int32 nwords; /* number of words to copy out */ afs_uint32 startCookie; /* first cookie to use */ - register afs_int32 i; afs_int32 outWords; /* words we've copied out */ afs_int32 inWords; /* max words to copy out */ afs_int32 code; /* return code */ @@ -2821,7 +2817,6 @@ int afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp) { register int i; int code = -1; - struct afs_icl_log *logp; ObtainWriteLock(&setp->lock,207); for(i = 0; i < ICL_LOGSPERSET; i++) { diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 57c9dfd2b..1f02f95be 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -89,7 +89,7 @@ extern int afs_icl_Event1(register struct afs_icl_set *setp, afs_int32 eventID, afs_int32 lAndT, long p1); extern int afs_icl_Event0(register struct afs_icl_set *setp, afs_int32 eventID, afs_int32 lAndT); -extern int afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, +extern void afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, afs_int32 types, long p1, long p2, long p3, long p4); extern int afs_CheckInit(void); @@ -309,6 +309,8 @@ extern int afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 afs_int32 aflags, afs_int32 ninodes, afs_int32 nusers); extern void afs_ComputeCacheParms(void); extern int afs_InitCacheInfo(register char *afile); +extern int afs_InitVolumeInfo(char *afile); +extern int afs_InitCellInfo(char *afile); extern int afs_ResourceInit(int preallocs); extern void shutdown_cache(void); extern void shutdown_vnodeops(void); diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 41a9b0398..b865e05c4 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -42,7 +42,10 @@ #include #include #include +#ifndef MLEN #include +#include +#endif #include #include #include diff --git a/src/auth/authcon.c b/src/auth/authcon.c index f532e450a..f4af7c22d 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -132,10 +132,10 @@ rxkad_level enclevel; { } /* build a fake ticket for 'afs' using keys from adir, returning an - * appropriate security class and index + * appropriate security class and index. + * astr is really a struct rx_securityClass. */ -afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, - struct rx_securityClass **astr, afs_int32 *aindex) +afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, void *astr, afs_int32 *aindex) { afs_int32 rc; diff --git a/src/auth/cellconfig.p.h b/src/auth/cellconfig.p.h index 329316282..fa3e450e9 100644 --- a/src/auth/cellconfig.p.h +++ b/src/auth/cellconfig.p.h @@ -122,8 +122,7 @@ extern int afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno, extern int afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno); -extern afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, - struct rx_securityClass **astr, afs_int32 *aindex); +extern afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, void *astr, afs_int32 *aindex); diff --git a/src/auth/ktc.c b/src/auth/ktc.c index ef3d3a7d3..52fe63e17 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -129,7 +129,8 @@ static struct flock fileUlock = { F_UNLCK, 0, 0, 0, 0 }; */ int afs_tf_init(), afs_tf_get_pname(), afs_tf_get_pinst(), afs_tf_get_cred(); int afs_tf_save_cred(), afs_tf_close(), afs_tf_create(); -int afs_tf_dest_tkt(), ktc_LocalCell(); +int afs_tf_dest_tkt(); +static void ktc_LocalCell(); char *ktc_tkt_string(); #endif /* AFS_KERBEROS_ENV */ @@ -1615,7 +1616,7 @@ ktc_newpag() * BLETCH! We have to invoke the entire afsconf package just to * find out what the local cell is. */ -static ktc_LocalCell() +static void ktc_LocalCell() { int code; struct afsconf_dir *conf; diff --git a/src/libafs/MakefileProto.OBSD.in b/src/libafs/MakefileProto.OBSD.in index 9edb2fc05..886ffac26 100644 --- a/src/libafs/MakefileProto.OBSD.in +++ b/src/libafs/MakefileProto.OBSD.in @@ -1,18 +1,32 @@ #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */ # +# OpenBSD version by Jim Rees + srcdir=@srcdir@ include @TOP_OBJDIR@/src/config/Makefile.config +# System specific build commands and flags +KSRC = /usr/src/sys +KDEFS=-Wall -nostdinc -I/usr/include \ + -DLKM -DDIAGNOSTIC -DFIFO -DNFSCLIENT -DMFS -DFFS -D_KERNEL -DI386_CPU -DI486_CPU -DI586_CPU \ + -I${KSRC}/sys +DBUG = -O2 +DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT +OPTF= ${OPT} +OPTF2= ${OPT2} +CFLAGS= ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} + +# Name of directory to hold object files and libraries. +KOBJ = COMMON + # OS specific object files: AFS_OS_OBJS = \ osi_groups.o \ osi_file.o \ - osi_inode.o \ osi_misc.o \ osi_sleep.o \ osi_vm.o \ - osi_vnodeops.o \ - osi_module.o + osi_vnodeops.o AFS_OS_NFSOBJS = \ osi_vfsops_nfs.o @@ -20,43 +34,38 @@ AFS_OS_NFSOBJS = \ AFS_OS_NONFSOBJS = \ osi_vfsops.o - -# System specific build commands and flags -KDEFS=-Wall -nostdinc -I/usr/include \ - -DLKM -DDIAGNOSTIC -DFIFO -DNFSCLIENT -DMFS -DFFS -D_KERNEL -DI386_CPU -DI486_CPU -DI586_CPU \ - -I/usr/src/sys/sys -I../afs -DBUG = -O2 -DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT -OPTF=${OPT} -OPTF2=${OPT2} -CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} - - -# Name of directory to hold object files and libraries. -KOBJ = COMMON - # This tells Makefile.common to use its single directory build target. COMPDIRS = single_compdir INSTDIRS = single_instdir DESTDIRS = single_destdir +TOP_SRCDIR = ../.. + include Makefile.common +COMMON_INCLUDE = \ + -I.. \ + -I../nfs \ + -I${TOP_SRCDIR} \ + -I${TOP_SRCDIR}/afs \ + -I${TOP_SRCDIR}/afs/${MKAFS_OSTYPE} \ + -I${TOP_SRCDIR}/config \ + -I${TOP_SRCDIR}/rx \ + -I${TOP_SRCDIR}/rx/${MKAFS_OSTYPE} \ + -I${TOP_SRCDIR}/rxkad \ + -I${TOP_SRCDIR}/domestic \ + -I${TOP_SRCDIR}/util \ + -I${TOP_SRCDIR}/../include \ + -I${TOP_SRCDIR}/../include/afs + setup: -mkdir $(KOBJ) - -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config + -$(RM) -f $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config ln -fs ../Makefile $(KOBJ)/Makefile ln -fs ../Makefile.common $(KOBJ)/Makefile.common ln -fs ../config $(KOBJ)/config - -$(RM) -f h net netinet rpc ufs nfs machine sys - -ln -fs /usr/src/sys/net net - -ln -fs /usr/src/sys/arch/i386/include machine - -ln -fs /usr/src/sys/netinet netinet - -ln -fs /usr/src/sys/nfs nfs - -ln -fs /usr/include/rpc rpc - -ln -fs /usr/src/sys/sys sys - -ln -fs /usr/src/sys/ufs/ufs ufs - -ln -fs /usr/src/sys/sys h + -$(RM) -f h + -ln -fs ${KSRC}/sys h -touch $(KOBJ)/sec_net.h @@ -71,12 +80,12 @@ DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS} DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS} -libafs: $(LIBAFS) $(LIBAFSNONFS) -# libafs: $(LIBAFSNONFS) -install_libafs: $(INST_LIBAFS) $(INST_LIBAFSNONFS) -# install_libafs: $(INST_LIBAFSNONFS) -dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS) -# dest_libafs: $(DEST_LIBAFSNONFS) +# libafs: $(LIBAFS) $(LIBAFSNONFS) +libafs: $(LIBAFSNONFS) +# install_libafs: $(INST_LIBAFS) $(INST_LIBAFSNONFS) +install_libafs: $(INST_LIBAFSNONFS) +# dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS) +dest_libafs: $(DEST_LIBAFSNONFS) $(INST_LIBAFS): $(LIBAFS) $(INSTALL) -f $? $@ diff --git a/src/rx/rx.c b/src/rx/rx.c index 7e85cbed8..46512154c 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -635,7 +635,7 @@ void rxi_StartServerProcs(int nExistingProcs) void rx_StartServer(int donateMe) { register struct rx_service *service; - register int i, nProcs=0; + register int i; SPLVAR; clock_NewTime(); @@ -772,8 +772,6 @@ int rxi_lowConnRefCount = 0; */ void rxi_CleanupConnection(struct rx_connection *conn) { - int i; - /* Notify the service exporter, if requested, that this connection * is being destroyed */ if (conn->type == RX_SERVER_CONNECTION && conn->service->destroyConnProc) @@ -807,6 +805,7 @@ void rxi_CleanupConnection(struct rx_connection *conn) #ifndef KERNEL if (conn->specific) { + int i; for (i = 0 ; i < conn->nSpecific ; i++) { if (conn->specific[i] && rxi_keyCreate_destructor[i]) (*rxi_keyCreate_destructor[i])(conn->specific[i]); diff --git a/src/rx/rx.h b/src/rx/rx.h index 4e0f1b5ba..cc27a46cd 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -38,6 +38,9 @@ #include "rx_packet.h" #include "rx_misc.h" #include "rx_multi.h" +#if defined (AFS_OBSD_ENV) && !defined (MLEN) +#include "sys/mbuf.h" +#endif #include "netinet/in.h" #include "sys/socket.h" #else /* KERNEL */ diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 640fcc07a..ad00f7cb6 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -601,39 +601,40 @@ int rxi_GetIFInfo(void) #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) TAILQ_FOREACH(ifn, &ifnet, if_link) { - if (i >= ADDRSPERSITE) break; -#else -#if defined(AFS_OBSD_ENV) + if (i >= ADDRSPERSITE) break; +#elif defined(AFS_OBSD_ENV) for (ifn = ifnet.tqh_first; i < ADDRSPERSITE && ifn != NULL; ifn = ifn->if_list.tqe_next) { #else for (ifn = ifnet; ifn != NULL && i < ADDRSPERSITE; ifn = ifn->if_next) { #endif -#endif - rxmtu = (ifn->if_mtu - RX_IPUDP_SIZE); -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - TAILQ_FOREACH(ifad, &ifn->if_addrhead, ifa_link) { - if (i >= ADDRSPERSITE) break; + rxmtu = (ifn->if_mtu - RX_IPUDP_SIZE); +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + TAILQ_FOREACH(ifad, &ifn->if_addrhead, ifa_link) { + if (i >= ADDRSPERSITE) break; +#elif defined(AFS_OBSD_ENV) + for (ifad = ifn->if_addrlist.tqh_first; ifad != NULL && i < ADDRSPERSITE; + ifad = ifad->ifa_list.tqe_next) { #else - for (ifad = ifn->if_addrlist; ifad != NULL && i < ADDRSPERSITE; - ifad = ifad->ifa_next){ + for (ifad = ifn->if_addrlist; ifad != NULL && i < ADDRSPERSITE; + ifad = ifad->ifa_next) { #endif - if (IFADDR2SA(ifad)->sa_family == AF_INET) { - ifinaddr = ntohl(((struct sockaddr_in *) IFADDR2SA(ifad))->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 (IFADDR2SA(ifad)->sa_family == AF_INET) { + ifinaddr = ntohl(((struct sockaddr_in *) IFADDR2SA(ifad))->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); + } + } } - } } rx_maxJumboRecvSize = RX_HEADER_SIZE @@ -642,13 +643,13 @@ int 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 j; + for (j=0; j< i; j++) { + myNetMTUs[j] = mtus[j]; + myNetAddrs[j] = addrs[j]; + } } - return different; + return different; } #ifdef AFS_DARWIN60_ENV /* Returns ifnet which best matches address */ @@ -672,63 +673,75 @@ rxi_FindIfnet(addr, pifad) /* Returns ifnet which best matches address */ struct ifnet *rxi_FindIfnet(afs_uint32 addr, struct in_ifaddr **pifad) { - afs_uint32 ppaddr; - int match_value = 0; - extern struct in_ifaddr *in_ifaddr; - struct in_ifaddr *ifa; - struct sockaddr_in *sin; + afs_uint32 ppaddr; + int match_value = 0; +#ifndef AFS_OBSD_ENV + extern struct in_ifaddr *in_ifaddr; +#endif + struct in_ifaddr *ifa; + struct sockaddr_in *sin; - if (numMyNetAddrs == 0) - (void) rxi_GetIFInfo(); + if (numMyNetAddrs == 0) + (void) rxi_GetIFInfo(); - ppaddr = ntohl(addr); +#ifdef AFS_OBSD_ENV + ppaddr = addr; +#else + ppaddr = ntohl(addr); +#endif - /* if we're given an address, skip everything until we find it */ - if (!*pifad) -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - *pifad = TAILQ_FIRST(&in_ifaddrhead); -#else - *pifad = in_ifaddr; + /* if we're given an address, skip everything until we find it */ + if (!*pifad) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + *pifad = TAILQ_FIRST(&in_ifaddrhead); +#elif defined(AFS_OBSD_ENV) + *pifad = in_ifaddr.tqh_first; +#else + *pifad = in_ifaddr; #endif - else { - if (((ppaddr & (*pifad)->ia_subnetmask) == (*pifad)->ia_subnet)) - match_value = 2; /* don't find matching nets, just subnets */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - *pifad = TAILQ_NEXT(*pifad, ia_link); + else { + if (((ppaddr & (*pifad)->ia_subnetmask) == (*pifad)->ia_subnet)) + match_value = 2; /* don't find matching nets, just subnets */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + *pifad = TAILQ_NEXT(*pifad, ia_link); +#elif defined(AFS_OBSD_ENV) + *pifad = (*pifad)->ia_list.tqe_next; #else - *pifad = (*pifad)->ia_next; + *pifad = (*pifad)->ia_next; #endif - } + } -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) - for (ifa = *pifad; ifa; ifa = TAILQ_NEXT(ifa, ia_link) ) { -#else - for (ifa = *pifad; ifa; ifa = ifa->ia_next ) { +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + for (ifa = *pifad; ifa; ifa = TAILQ_NEXT(ifa, ia_link) ) { +#elif defined(AFS_OBSD_ENV) + for (ifa = *pifad; ifa; ifa = ifa->ia_list.tqe_next) { +#else + for (ifa = *pifad; ifa; ifa = ifa->ia_next ) { #endif - if ((ppaddr & ifa->ia_netmask) == ifa->ia_net) { - if ((ppaddr & ifa->ia_subnetmask) == ifa->ia_subnet) { - sin=IA_SIN(ifa); - if ( sin->sin_addr.s_addr == ppaddr) { /* ie, ME!!! */ - match_value = 4; - *pifad = ifa; - goto done; - } - if (match_value < 3) { - *pifad = ifa; - match_value = 3; - } - } - else { - if (match_value < 2) { - *pifad = ifa; - match_value = 2; - } - } - } /* if net matches */ - } /* for all in_ifaddrs */ + if ((ppaddr & ifa->ia_netmask) == ifa->ia_net) { + if ((ppaddr & ifa->ia_subnetmask) == ifa->ia_subnet) { + sin=IA_SIN(ifa); + if ( sin->sin_addr.s_addr == ppaddr) { /* ie, ME!!! */ + match_value = 4; + *pifad = ifa; + goto done; + } + if (match_value < 3) { + *pifad = ifa; + match_value = 3; + } + } + else { + if (match_value < 2) { + *pifad = ifa; + match_value = 2; + } + } + } /* if net matches */ + } /* for all in_ifaddrs */ done: - return (*pifad ? (*pifad)->ia_ifp : NULL ); + return (*pifad ? (*pifad)->ia_ifp : NULL ); } #endif #endif /* else AFS_USERSPACE_IP_ADDR */ @@ -749,9 +762,8 @@ struct osi_socket *rxk_NewSocket(short aport) { register afs_int32 code; struct socket *newSocket; - register struct mbuf *nam; + struct mbuf *nam; struct sockaddr_in myaddr; - int wow; #ifdef AFS_HPUX110_ENV /* prototype copied from kernel source file streams/str_proto.h */ extern MBLKP allocb_wait(int, int); @@ -773,14 +785,12 @@ struct osi_socket *rxk_NewSocket(short aport) #else /* AFS_HPUX110_ENV */ code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0, SS_NOWAIT); #endif /* else AFS_HPUX110_ENV */ -#else -#ifdef AFS_SGI65_ENV - code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP); -#elif defined(AFS_XBSD_ENV) - code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP, curproc); +#elif defined(AFS_SGI65_ENV) || defined(AFS_OBSD_ENV) + code = socreate(AF_INET, &newSocket, SOCK_DGRAM, IPPROTO_UDP); +#elif defined(AFS_FBSD_ENV) + code = socreate(AF_INET, &newSocket, SOCK_DGRAM, IPPROTO_UDP, curproc); #else code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0); -#endif /* AFS_SGI65_ENV */ #endif /* AFS_HPUX102_ENV */ if (code) goto bad; @@ -816,10 +826,16 @@ struct osi_socket *rxk_NewSocket(short aport) osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n"); } #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) -#if defined(AFS_XBSD_ENV) - code = sobind(newSocket, (struct sockaddr *)&myaddr, curproc); +#if defined(AFS_FBSD_ENV) + code = sobind(newSocket, (struct sockaddr *) &myaddr, curproc); +#elif defined(AFS_OBSD_ENV) + code = sockargs(&nam, (caddr_t) &myaddr, sizeof(myaddr), MT_SONAME); + if (code == 0) { + code = sobind(newSocket, nam); + m_freem(nam); + } #else - code = sobind(newSocket, (struct sockaddr *)&myaddr); + code = sobind(newSocket, (struct sockaddr *) &myaddr); #endif if (code) { printf("sobind fails\n"); diff --git a/src/rx/rx_kernel.h b/src/rx/rx_kernel.h index 5b0050464..51243d3da 100644 --- a/src/rx/rx_kernel.h +++ b/src/rx/rx_kernel.h @@ -25,8 +25,8 @@ typedef struct socket *osi_socket; #define OSI_NULLSOCKET ((osi_socket) 0) #if (!defined(AFS_GLOBAL_SUNLOCK) && !defined(RX_ENABLE_LOCKS)) -#include "../afs/icl.h" -#include "../afs/afs_trace.h" +#include "afs/icl.h" +#include "afs/afs_trace.h" #endif #define osi_rxSleep(a) afs_Trace2(afs_iclSetp, CM_TRACE_RXSLEEP, \ ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, __LINE__); afs_osi_Sleep(a) @@ -36,8 +36,6 @@ typedef struct socket *osi_socket; extern int osi_utoa(char *buf, size_t len, unsigned long val); #define osi_Assert(e) (void)((e) || (osi_AssertFailK(#e, __FILE__, __LINE__), 0)) -#define osi_Msg printf)( - #define osi_YieldIfPossible() #define osi_WakeupAndYieldIfPossible(x) rx_Wakeup(x) diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index f072ef288..0ae2d5627 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -296,6 +296,9 @@ extern int osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec, int nvecs, int *lengthp); extern void osi_StopListener(void); extern int rxi_FindIfMTU(afs_uint32 addr); +#ifndef RXK_LISTENER_ENV +extern void rxk_init(); +#endif /* UKERNEL/rx_knet.c */ #ifdef UKERNEL diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index 2490fbd6f..6340e48ad 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -479,6 +479,9 @@ static void h_output(char *infile, char *define, int extend, f_print(fout, "#ifndef S_IFMT /* XXXXX */\n"); f_print(fout, "#include \"h/stat.h\"\n"); f_print(fout, "#endif\n"); + f_print(fout, "#if defined (AFS_OBSD_ENV) && !defined (MLEN)\n"); + f_print(fout, "#include \"sys/mbuf.h\"\n"); + f_print(fout, "#endif\n"); f_print(fout, "#ifndef IPPROTO_UDP /* XXXXX */\n"); f_print(fout, "#include \"netinet/in.h\"\n"); f_print(fout, "#endif\n"); diff --git a/src/rxkad/domestic/fcrypt.c b/src/rxkad/domestic/fcrypt.c index 8054a48b6..bd0fe36a8 100644 --- a/src/rxkad/domestic/fcrypt.c +++ b/src/rxkad/domestic/fcrypt.c @@ -26,7 +26,7 @@ RCSID("$Header$"); #ifndef UKERNEL #include "afs/stds.h" #include "h/types.h" -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_OBSD_ENV) #include "netinet/in.h" #endif #else /* UKERNEL */