+ uint8_t *p = data - (3 * sizeof(uint32_t));
+ uint8_t *psave = p;
+
+ if (!config->cluster_master_address) // No election has been held yet. Just skip it.
+ return -1;
+
+ LOG(4, 0, 0, "Forwarding packet from %s to master (size %d)\n", fmtaddr(addr, 0), size);
+
+ STAT(c_forwarded);
+ add_type(&p, C_FORWARD, addr, (uint8_t *) &port, sizeof(port)); // ick. should be uint16_t
+
+ return peer_send_data(config->cluster_master_address, psave, size + (3 * sizeof(uint32_t)));
+}
+
+// Forward PPPOE packet to the master.
+//(note: THIS ROUTINE WRITES TO pack[-4]).
+int master_forward_pppoe_packet(uint8_t *data, int size, uint8_t codepad)
+{
+ uint8_t *p = data - (2 * sizeof(uint32_t));
+ uint8_t *psave = p;
+
+ if (!config->cluster_master_address) // No election has been held yet. Just skip it.
+ return -1;
+
+ LOG(4, 0, 0, "Forward PPPOE packet to master, code %s (size %d)\n", get_string_codepad(codepad), size);
+
+ STAT(c_forwarded);
+ add_type(&p, C_PPPOE_FORWARD, codepad, NULL, 0);
+
+ return peer_send_data(config->cluster_master_address, psave, size + (2 * sizeof(uint32_t)));