router hostname is assigned ip of guest network

Discussion in 'Tomato Firmware' started by hasIPv6, May 10, 2013.

  1. hasIPv6

    hasIPv6 Networkin' Nut Member

    I'm currently using Shibby 108 on a Netgear 3500Lv2

    Recently I noticed that the routers hostname specified on page basic-ident.asp is no longer given the gateway ip of my internal subnet but now is assigned the gateway ip of my guest network.

    After digging in the sources I realized that the routers hostname is actually assigned the ip of the bridge with the highest index value. E.g. if you only use br0 the hostname is associated with the gateway address of br0. If you have several bridges defined, say br0, br1, br2 the hostname is linked to the gateway adddress of br2. Weird idea!

    To fix this I added line 'router_ip = ...' to file services.c

            snprintf(buf, sizeof(buf), "%s/hosts", dmhosts);
            router_ip = nvram_safe_get("lan_ipaddr");
            if ((hf = fopen(buf, "w")) != NULL) {
                    if (((nv = nvram_get("wan_hostname")) != NULL) && (*nv))
                            fprintf(hf, "%s %s\n", router_ip, nv);
    I'd be happy if this small code change could be integrated in future releases.
    darkknight93 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice