From owner-svn-src-head@freebsd.org Tue Apr 11 16:51:36 2017 Return-Path: Delivered-To: svn-src-head@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 ECC7BD3A5C2; Tue, 11 Apr 2017 16:51:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5085AA0; Tue, 11 Apr 2017 16:51:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3BGpZJ9075425; Tue, 11 Apr 2017 09:51:35 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3BGpZi9075424; Tue, 11 Apr 2017 09:51:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704111651.v3BGpZi9075424@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316699 - head/sys/net In-Reply-To: <201704110856.v3B8uJq5039806@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Tue, 11 Apr 2017 09:51:35 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 16:51:37 -0000 > Author: ae > Date: Tue Apr 11 08:56:18 2017 > New Revision: 316699 > URL: https://svnweb.freebsd.org/changeset/base/316699 > > Log: > Do not adjust interface MTU automatically. Leave this task to the system > administrator. > > This restores the behavior that was prior to r274246. > > No objection from: #network > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D10215 > > Modified: > head/sys/net/if_gre.c > head/sys/net/if_gre.h > head/sys/net/if_me.c > > Modified: head/sys/net/if_gre.c > ============================================================================== > --- head/sys/net/if_gre.c Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_gre.c Tue Apr 11 08:56:18 2017 (r316699) > @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#define GREMTU 1500 > +#define GREMTU 1476 I would of thought that this was #define GREMTU ETHERMTU and now should probably be: #define GREMTU ETHERMTU - gre_hlen; Or what ever the approprite sizeof(foo) is; Isn't this arguably wrong in the face of JumboFrames? > static const char grename[] = "gre"; > static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); > static VNET_DEFINE(struct mtx, gre_mtx); > @@ -173,7 +173,7 @@ gre_clone_create(struct if_clone *ifc, i > GRE2IFP(sc)->if_softc = sc; > if_initname(GRE2IFP(sc), grename, unit); > > - GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU; > + GRE2IFP(sc)->if_mtu = GREMTU; > GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; > GRE2IFP(sc)->if_output = gre_output; > GRE2IFP(sc)->if_ioctl = gre_ioctl; > @@ -231,7 +231,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > /* XXX: */ > if (ifr->ifr_mtu < 576) This is another magic constant that should be in a #define. > return (EINVAL); > - break; > + ifp->if_mtu = ifr->ifr_mtu; > + return (0); > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > case SIOCSIFFLAGS: > @@ -255,12 +256,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, > } > error = 0; > switch (cmd) { > - case SIOCSIFMTU: > - GRE_WLOCK(sc); > - sc->gre_mtu = ifr->ifr_mtu; > - gre_updatehdr(sc); > - GRE_WUNLOCK(sc); > - goto end; > case SIOCSIFPHYADDR: > #ifdef INET6 > case SIOCSIFPHYADDR_IN6: > @@ -549,7 +544,6 @@ gre_updatehdr(struct gre_softc *sc) > } else > sc->gre_oseq = 0; > gh->gre_flags = htons(flags); > - GRE2IFP(sc)->if_mtu = sc->gre_mtu - sc->gre_hlen; > } > > static void > > Modified: head/sys/net/if_gre.h > ============================================================================== > --- head/sys/net/if_gre.h Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_gre.h Tue Apr 11 08:56:18 2017 (r316699) > @@ -69,7 +69,6 @@ struct gre_softc { > uint32_t gre_oseq; > uint32_t gre_key; > uint32_t gre_options; > - uint32_t gre_mtu; > u_int gre_fibnum; > u_int gre_hlen; /* header size */ > union { > > Modified: head/sys/net/if_me.c > ============================================================================== > --- head/sys/net/if_me.c Tue Apr 11 08:29:12 2017 (r316698) > +++ head/sys/net/if_me.c Tue Apr 11 08:56:18 2017 (r316699) > @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#define MEMTU 1500 > +#define MEMTU (1500 - sizeof(struct mobhdr)) 1500 -> ETHERMTU? > static const char mename[] = "me"; > static MALLOC_DEFINE(M_IFME, mename, "Minimal Encapsulation for IP"); > static VNET_DEFINE(struct mtx, me_mtx); > @@ -186,7 +186,7 @@ me_clone_create(struct if_clone *ifc, in > ME2IFP(sc)->if_softc = sc; > if_initname(ME2IFP(sc), mename, unit); > > - ME2IFP(sc)->if_mtu = MEMTU - sizeof(struct mobhdr); > + ME2IFP(sc)->if_mtu = MEMTU;; > ME2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; > ME2IFP(sc)->if_output = me_output; > ME2IFP(sc)->if_ioctl = me_ioctl; > @@ -236,7 +236,7 @@ me_ioctl(struct ifnet *ifp, u_long cmd, > case SIOCSIFMTU: > if (ifr->ifr_mtu < 576) > return (EINVAL); > - ifp->if_mtu = ifr->ifr_mtu - sizeof(struct mobhdr); > + ifp->if_mtu = ifr->ifr_mtu; > return (0); > case SIOCSIFADDR: > ifp->if_flags |= IFF_UP; > > -- Rod Grimes rgrimes@freebsd.org