static const in_addr_t HOST_BASE_ADDRESS = 0xc0a8ff00;
// Host order 255.255.255.252
static const in_addr_t HOST_NETMASK = 0xfffffffc;
-// Host order 0.0.0.2
-static const in_addr_t HOST_ROUTER = 0x00000002;
// Host order 0.0.0.1
-static const in_addr_t HOST_DHCP = 0x00000001;
+static const in_addr_t HOST_ROUTER = 0x00000001;
+// Host order 0.0.0.1
+static const in_addr_t HOST_DHCP = 0x00000002;
struct _MTetherDDevicePrivate {
gchar *interface;
if (index < 64) {
in_addr_t subnet = HOST_BASE_ADDRESS | (index << 2);
in_addr_t addr = subnet | HOST_ROUTER;
- in_addr_t start = subnet | HOST_DHCP;
+ in_addr_t end = subnet | HOST_DHCP;
self->priv->addr = htonl(addr);
self->priv->netmask = htonl(HOST_NETMASK);
- self->priv->dhcp_start = htonl(start);
- self->priv->dhcp_end = htonl(addr);
+ self->priv->dhcp_start = htonl(addr);
+ self->priv->dhcp_end = htonl(end);
} else {
g_log(MTETHERD_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Invalid subnet index: %u (0..%u expected)", index, MAX_DEVICES - 1);
}