+ case C_FORWARD: // Forwarded control packet. pass off to processudp.
+ case C_FORWARD_DAE: // Forwarded DAE packet. pass off to processdae.
+ if (!config->cluster_iam_master)
+ {
+ LOG(0, 0, 0, "I'm not the master, but I got a C_FORWARD%s from %s?\n",
+ type == C_FORWARD_DAE ? "_DAE" : "", fmtaddr(addr, 0));
+
+ return -1;
+ }
+ else
+ {
+ struct sockaddr_in a;
+ uint16_t indexudp;
+ a.sin_addr.s_addr = more;
+
+ a.sin_port = (*(int *) p) & 0xFFFF;
+ indexudp = ((*(int *) p) >> 16) & 0xFFFF;
+ s -= sizeof(int);
+ p += sizeof(int);
+
+ LOG(4, 0, 0, "Got a forwarded %spacket... (%s:%d)\n",
+ type == C_FORWARD_DAE ? "DAE " : "", fmtaddr(more, 0), a.sin_port);
+
+ STAT(recv_forward);
+ if (type == C_FORWARD_DAE)
+ {
+ struct in_addr local;
+ local.s_addr = config->bind_address ? config->bind_address : my_address;
+ processdae(p, s, &a, sizeof(a), &local);
+ }
+ else
+ processudp(p, s, &a, indexudp);