From owner-svn-src-all@freebsd.org Sun Jan 8 21:53:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B89CA6078; Sun, 8 Jan 2017 21:53:42 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94DCB1684; Sun, 8 Jan 2017 21:53:42 +0000 (UTC) (envelope-from kczekirda@gmail.com) Received: by mail-yw0-x235.google.com with SMTP id v81so309934608ywb.2; Sun, 08 Jan 2017 13:53:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=45b2oIibiVWdoF//mxa7ib7C/d2fRyp6aKv8Kg6PY2Y=; b=tme82WyYRi6EDIr/kLbTaWQDbFHXivypEevg53iL6ATW2ttJjqExsPbMKHzDkOt8gi kO3Hh9AwO0hmS+jtCY0qUJGYlsnyhQSxxPJ6gwFycfu5/FnMrQwJ6BI7NKZ0a1sui3AB LKlrsJIjnLoFAerk/8HI/tDIS3X+KXjUNIXiRf+E2yRJzPhSC8taQOMePTAnA7yxMSlt iGiJtzCheH5NzXgvQTgf/o8g0U/tvhziH+N7kWZ+szplJTBWUk1znIeaV7kBJm7iQzD9 XlYDxpBAOOdOpCZqDd1rh0wZ1VTKErhziTUd/vQ28lBMMLHrIvk4z0XyTcncYdbbAuro lHRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=45b2oIibiVWdoF//mxa7ib7C/d2fRyp6aKv8Kg6PY2Y=; b=aV9cePwLlLY0AFiJye9Mi7rUoip3uec2DPMbyA7Wzet1zRxE2ZkeOTdUlhjpdbH7cg Xz4wHhwoGbOvt5hCPBxDernPdFyUbL2SdNyIV/le1v/fS23ZzzqmNwHzC6kQXK4s2+Vn iyH0DRQlJLImh6UsF+HcpMHk9CBZjZk7Vxjs/N6VJH9p8rs/qjLmZbLIQWiar8rKk2/E B3Jyq7cGKsBpX6U+n5VhWLdcrQBYSYY6LZO8KRtbDXPvwHqDJR71xGJw5np9vJ0RmCp3 XZj34zbTP8gMj6XVUdvIpPTw8Dy3cQ75dSJrXEBIAFX1QSJ85+tuJWs5FJUTOEAFllpG yc8w== X-Gm-Message-State: AIkVDXL6m8DP/kI68e+zWS+icMUPxpwX2yQIScx5ThISNM1DPwgicxioL5ae4aod4NF3G0psnXBeFK64YAFVtQ== X-Received: by 10.129.131.86 with SMTP id t83mr81516739ywf.142.1483912421551; Sun, 08 Jan 2017 13:53:41 -0800 (PST) MIME-Version: 1.0 Sender: kczekirda@gmail.com Received: by 10.37.199.199 with HTTP; Sun, 8 Jan 2017 13:53:11 -0800 (PST) In-Reply-To: <201701072342.v07NgHrk059834@repo.freebsd.org> References: <201701072342.v07NgHrk059834@repo.freebsd.org> From: Kamil Czekirda Date: Sun, 8 Jan 2017 22:53:11 +0100 X-Google-Sender-Auth: scUjmYaUOWHuj78ud-cpGTS2Gc4 Message-ID: Subject: Re: svn commit: r311659 - head/lib/libstand To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 21:53:42 -0000 Thanks. 2017-01-08 0:42 GMT+01:00 Baptiste Daroussin : > Author: bapt > Date: Sat Jan 7 23:42:17 2017 > New Revision: 311659 > URL: https://svnweb.freebsd.org/changeset/base/311659 > > Log: > remove network mask calculation for Classful network > > Nowadays it's not necessary to compute network mask from the IP address > and > compare to given by DHCP. > > Submitted by: kczekirda > Reviewed by: glebius, bapt > MFC after: 3 weeks > Sponsored by: Oktawave > Differential Revision: https://reviews.freebsd.org/D8740 > > Modified: > head/lib/libstand/bootp.c > > Modified: head/lib/libstand/bootp.c > ============================================================ > ================== > --- head/lib/libstand/bootp.c Sat Jan 7 22:55:23 2017 (r311658) > +++ head/lib/libstand/bootp.c Sat Jan 7 23:42:17 2017 (r311659) > @@ -62,8 +62,6 @@ __FBSDID("$FreeBSD$"); > > struct in_addr servip; > > -static n_long nmask, smask; > - > static time_t bot; > > static char vm_rfc1048[4] = VM_RFC1048; > @@ -223,30 +221,19 @@ bootp(sock, flag) > bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile)); > bootfile[sizeof(bootfile) - 1] = '\0'; > > - if (IN_CLASSA(ntohl(myip.s_addr))) > - nmask = htonl(IN_CLASSA_NET); > - else if (IN_CLASSB(ntohl(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) { > + if (!netmask) { > + if (IN_CLASSA(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSA_NET); > + else if (IN_CLASSB(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSB_NET); > + else > + netmask = htonl(IN_CLASSC_NET); > #ifdef BOOTP_DEBUG > if (debug) > - printf("subnet mask (%s) bad\n", intoa(smask)); > + printf("'native netmask' is %s\n", intoa(netmask)); > #endif > - smask = 0; > } > > - /* Get subnet (or natural net) mask */ > - netmask = nmask; > - if (smask) > - netmask = smask; > #ifdef BOOTP_DEBUG > if (debug) > printf("mask: %s\n", intoa(netmask)); > @@ -385,7 +372,7 @@ vend_rfc1048(cp, len) > break; > > if (tag == TAG_SUBNET_MASK) { > - bcopy(cp, &smask, sizeof(smask)); > + bcopy(cp, &netmask, sizeof(netmask)); > } > if (tag == TAG_GATEWAY) { > bcopy(cp, &gateip.s_addr, sizeof(gateip.s_addr)); > @@ -445,7 +432,7 @@ vend_cmu(cp) > vp = (struct cmu_vend *)cp; > > if (vp->v_smask.s_addr != 0) { > - smask = vp->v_smask.s_addr; > + netmask = vp->v_smask.s_addr; > } > if (vp->v_dgate.s_addr != 0) { > gateip = vp->v_dgate; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >