char afs_rootVolumeName[64] = "";
struct afs_icl_set *afs_iclSetp = (struct afs_icl_set *)0;
struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0;
+afs_uint32 rx_bindhost;
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
kmutex_t afs_global_lock;
/* start RX */
rx_extraPackets = AFS_NRXPACKETS; /* smaller # of packets */
- code = rx_Init(htons(7001));
+ code = rx_InitHost(rx_bindhost, htons(7001));
if (code) {
- printf("AFS: RX failed to initialize.\n");
+ printf("AFS: RX failed to initialize %d).\n", code);
return code;
}
rx_SetRxDeadTime(afs_rx_deadtime);
#ifdef SYS_SETPRIORITY_EXPORTED
int (*sys_setpriority) (int, int, int) = sys_call_table[__NR_setpriority];
#endif
- daemonize(); /* doesn't do much, since we were forked from keventd, but
+#if defined(AFS_LINUX26_ENV)
+ daemonize("afsd");
+#else
+ daemonize();
+#endif
+ /* doesn't do much, since we were forked from keventd, but
* does call mm_release, which wakes up our parent (since it
* used CLONE_VFORK) */
+#if !defined(AFS_LINUX26_ENV)
reparent_to_init();
+#endif
afs_osi_MaskSignals();
switch (parm) {
case AFSOP_START_RXCALLBACK:
complete_and_exit(0, 0);
break;
default:
- printf("Unknown op %d in StartDaemon()\n");
+ printf("Unknown op %d in StartDaemon()\n", parm);
break;
}
return 0;
{
int code;
DECLARE_COMPLETION(c);
+#if defined(AFS_LINUX26_ENV)
+ struct work_struct tq;
+#else
struct tq_struct tq;
+#endif
struct afsd_thread_info info;
if (parm == AFSOP_START_RXCALLBACK) {
if (afs_CB_Running)
} /* other functions don't need setup in the parent */
info.complete = &c;
info.parm = parm;
+#if defined(AFS_LINUX26_ENV)
+ INIT_WORK(&tq, afsd_launcher, &info);
+ schedule_work(&tq);
+#else
tq.sync = 0;
INIT_LIST_HEAD(&tq.list);
tq.routine = afsd_launcher;
tq.data = &info;
schedule_task(&tq);
+#endif
AFS_GUNLOCK();
/* we need to wait cause we passed stack pointers around.... */
wait_for_completion(&c);
cacheNumEntries : 1));
} else if (parm == AFSOP_ADVISEADDR) {
/* pass in the host address to the rx package */
+ int rxbind = 0;
afs_int32 count = parm2;
afs_int32 *buffer =
afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
afs_int32 *mtubuffer =
afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
int i;
- int code;
+
+ /* Bind, but only if there's only one address configured */
+ if ( count & 0x80000000) {
+ count &= ~0x80000000;
+ if (count == 1)
+ rxbind=1;
+ }
if (count > AFS_MAX_INTERFACE_ADDR) {
code = ENOMEM;
}
afs_uuid_create(&afs_cb_interface.uuid);
rxi_setaddr(buffer[0]);
+ if (rxbind)
+ rx_bindhost = buffer[0];
+ else
+ rx_bindhost = htonl(INADDR_ANY);
+
afs_osi_Free(buffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
afs_osi_Free(maskbuffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
afs_osi_Free(mtubuffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
#endif /* AFS_SGI53_ENV */
else if (parm == AFSOP_SHUTDOWN) {
afs_cold_shutdown = 0;
- if (parm == 1)
+ if (parm2 == 1)
afs_cold_shutdown = 1;
#ifndef AFS_DARWIN_ENV
if (afs_globalVFS != 0) {