Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2000 23:59:25 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Paul Saab <paul@mu.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: diskless workstation 
Message-ID:  <200009210659.XAA02428@mass.osd.bsdi.com>
In-Reply-To: Your message of "Wed, 20 Sep 2000 23:48:19 PDT." <20000920234819.A68513@elvis.mu.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Mike Smith (msmith@freebsd.org) wrote:
> > 
> > I think this is correct, actually. Danny, can you confirm that you're 
> > using one of the class A address spaces (eg. 10.*.*.*?)
> > 
> > Actually, IMO the code around this is entirely wrong; we should always 
> > respect the mask supplied by the server, and only use the canonical mask 
> > if we don't get one at all.
> 
> It does.. look futher down in the code.

No, if the supplied mask is wider than the canonical mask (as in eg. 
Danny's case), the supplied mask is discarded.  See the "toss if bogus" 
test:

        if (IN_CLASSA(myip.s_addr))
                nmask = htonl(IN_CLASSA_NET);
        else if (IN_CLASSB(myip.s_addr))
                nmask = htonl(IN_CLASSB_NET);
        else
                nmask = htonl(IN_CLASSC_NET);
#ifdef BOOTP_DEBUG
        if (debug)
                printf("'native netmask' is %s\n", intoa(nmask));
#endif

        /* Check subnet mask against net mask; toss if bogus */
        if ((nmask & smask) != nmask) {
#ifdef BOOTP_DEBUG
                if (debug)
                        printf("subnet mask (%s) bad\n", intoa(smask));
#endif
                smask = 0;
        }

        /* Get subnet (or natural net) mask */
        netmask = nmask;
        if (smask)
                netmask = smask;

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009210659.XAA02428>