#include "vserver.h"
#include "planetlab.h"
+#ifndef VC_NXC_RAW_SOCKET
+# define VC_NXC_RAW_SOCKET 0x00000200ull
+#endif
+#ifndef VC_NXC_RAW_SEND
+# define VC_NXC_RAW_SEND 0x00000400ull
+#endif
+#ifndef VC_NXF_LBACK_ALLOW
+# define VC_NXF_LBACK_ALLOW 0x00000400ull
+#endif
+
static int
create_context(xid_t ctx, uint64_t bcaps)
{
- struct vc_ctx_caps vc_caps;
+ struct vc_ctx_caps vc_caps;
struct vc_net_flags vc_nf;
+ struct vc_net_caps vc_ncaps;
/* Create network context */
if (vc_net_create(ctx) == VC_NOCTX) {
}
/* Make the network context persistent */
- vc_nf.mask = vc_nf.flagword = VC_NXF_PERSISTENT;
+ vc_nf.mask = vc_nf.flagword = VC_NXF_PERSISTENT | VC_NXF_LBACK_ALLOW;
if (vc_set_nflags(ctx, &vc_nf))
return -1;
+ /* Give it raw sockets capabilities */
+ vc_ncaps.ncaps = vc_ncaps.cmask = VC_NXC_RAW_ICMP | VC_NXC_RAW_SOCKET;
+ if (vc_set_ncaps(ctx, &vc_ncaps))
+ return -1;
+
tag:
/* Create tag context */
if (vc_tag_create(ctx) == VC_NOCTX)