diff -NurpP --minimal linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/device_cmd.h linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/device_cmd.h --- linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/device_cmd.h 2006-12-08 01:24:53 +0100 +++ linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/device_cmd.h 2006-12-08 02:07:23 +0100 @@ -10,7 +10,6 @@ struct vcmd_set_mapping_v0 { const char __user *device; const char __user *target; uint32_t flags; - uint32_t mask; }; diff -NurpP --minimal linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/network.h linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/network.h --- linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/network.h 2006-12-06 10:36:44 +0100 +++ linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/network.h 2006-12-08 04:06:26 +0100 @@ -28,13 +28,18 @@ /* address types */ -#define NXA_TYPE_IPV4 1 -#define NXA_TYPE_IPV6 2 +#define NXA_TYPE_IPV4 0x0001 +#define NXA_TYPE_IPV6 0x0002 -#define NXA_MOD_BCAST (1<<8) +#define NXA_MOD_BCAST 0x0100 +#define NXA_MOD_LBACK 0x0200 #define NXA_TYPE_ANY ((uint16_t)-1) +#define NXA_TYPE_ADDR 0x0003 +#define NXA_TYPE_MASK 0x0013 +#define NXA_TYPE_RANGE 0x0023 + #ifdef __KERNEL__ @@ -55,14 +60,14 @@ struct nx_info { uint64_t nx_ncaps; /* network capabilities */ int nbipv4; - __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */ + __be32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */ /* The first one is used to connect */ /* and for bind any service */ /* The other must be used explicity */ - __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */ + __be32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */ /* Used to select the proper source */ /* address for sockets */ - __u32 v4_bcast; /* Broadcast address to receive UDP */ + __be32 v4_bcast; /* Broadcast address to receive UDP */ char nx_name[65]; /* network context name */ }; diff -NurpP --minimal linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/network_cmd.h linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/network_cmd.h --- linux-2.6.19-vs2.1.x-t7.2/include/linux/vserver/network_cmd.h 2006-12-08 02:04:31 +0100 +++ linux-2.6.19-vs2.1.x-t7.3/include/linux/vserver/network_cmd.h 2006-12-08 04:02:32 +0100 @@ -23,6 +23,9 @@ extern int vc_nx_info(struct nx_info *, #endif /* __KERNEL__ */ +#include +#include + #define VCMD_net_create_v0 VC_CMD(VNET, 1, 0) #define VCMD_net_create VC_CMD(VNET, 1, 1) @@ -38,8 +41,8 @@ struct vcmd_net_create { struct vcmd_net_addr_v0 { uint16_t type; uint16_t count; - uint32_t ip[4]; - uint32_t mask[4]; + struct in_addr ip[4]; + struct in_addr mask[4]; /* more to come */ }; @@ -50,8 +53,9 @@ struct vcmd_match_ipv4_v0 { uint16_t type; uint16_t flags; uint32_t parent; - uint32_t ip; - uint32_t mask; + struct in_addr ip; + struct in_addr ip2; + struct in_addr mask; }; #define VCMD_add_match_ipv6 VC_CMD(NETALT, 6, 0) @@ -62,8 +66,9 @@ struct vcmd_match_ipv6_v0 { uint16_t flags; uint32_t parent; uint32_t prefix; - uint32_t ip[4]; - uint32_t mask[4]; + struct in6_addr ip; + struct in6_addr ip2; + struct in6_addr mask; }; diff -NurpP --minimal linux-2.6.19-vs2.1.x-t7.2/kernel/vserver/network.c linux-2.6.19-vs2.1.x-t7.3/kernel/vserver/network.c --- linux-2.6.19-vs2.1.x-t7.2/kernel/vserver/network.c 2006-12-06 20:16:00 +0100 +++ linux-2.6.19-vs2.1.x-t7.3/kernel/vserver/network.c 2006-12-08 02:53:43 +0100 @@ -659,8 +659,8 @@ int vc_net_add(struct nx_info *nxi, void index = 0; while ((index < vc_data.count) && ((pos = nxi->nbipv4) < NB_IPV4ROOT)) { - nxi->ipv4[pos] = vc_data.ip[index]; - nxi->mask[pos] = vc_data.mask[index]; + nxi->ipv4[pos] = vc_data.ip[index].s_addr; + nxi->mask[pos] = vc_data.mask[index].s_addr; index++; nxi->nbipv4++; } @@ -668,7 +668,7 @@ int vc_net_add(struct nx_info *nxi, void break; case NXA_TYPE_IPV4|NXA_MOD_BCAST: - nxi->v4_bcast = vc_data.ip[0]; + nxi->v4_bcast = vc_data.ip[0].s_addr; ret = 1; break;