/*
- * Copyright (C) 2005-2013 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2014 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file udp_recv.c Paraslash's udp receiver */
+#include <netinet/in.h>
#include <regex.h>
#include <sys/socket.h>
#include <net/if.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <sys/un.h>
+#include <netdb.h>
#include "para.h"
#include "error.h"
static void udp_recv_pre_select(struct sched *s, struct task *t)
{
- struct receiver_node *rn = container_of(t, struct receiver_node, task);
+ struct receiver_node *rn = task_context(t);
if (generic_recv_pre_select(s, t) <= 0)
return;
}
if (memcmp(iov[0].iov_base, FEC_EOF_PACKET, iov[0].iov_len) != 0)
return 0;
- if (memcmp(iov[1].iov_base, FEC_EOF_PACKET + iov[0].iov_len,
+ if (memcmp(iov[1].iov_base, &FEC_EOF_PACKET[iov[0].iov_len],
FEC_EOF_PACKET_LEN - iov[0].iov_len) != 0)
return 0;
return -E_RECV_EOF;
static int udp_recv_post_select(__a_unused struct sched *s, struct task *t)
{
- struct receiver_node *rn = container_of(t, struct receiver_node, task);
+ struct receiver_node *rn = task_context(t);
struct btr_node *btrn = rn->btrn;
size_t num_bytes;
struct iovec iov[2];