Changed IP address order (N900 comes last now)
[mtetherd] / net.c
diff --git a/net.c b/net.c
index a727605..230b082 100644 (file)
--- a/net.c
+++ b/net.c
@@ -32,10 +32,10 @@ static const guint MAX_DEVICES = 64;
 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;
@@ -122,11 +122,11 @@ void mtetherd_device_set_index(MTetherDDevice *self, guint index) {
                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);
                }