Received: by 10.223.148.5 with SMTP id 5csp7956836wrq; Thu, 18 Jan 2018 11:42:42 -0800 (PST) X-Google-Smtp-Source: ACJfBovo0Y2ZQoU1bkUfjG6faLDvpgqJAUaD7nXIwGpSggtvadWzzM9fB7/xPKbv0ZyGSWOKDQ9F X-Received: by 2002:a17:902:7c96:: with SMTP id y22-v6mr303545pll.89.1516304562816; Thu, 18 Jan 2018 11:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516304562; cv=none; d=google.com; s=arc-20160816; b=PmvWTjder84XMtdfFUvc9p9pHGxy7wt55x+5OjGSpcrNVKCK46FN6FRiS55re0m79p VeZGKXpz0da8LD4WlXku3wAgD4M7XFdhGze4/OaXgMKhL4q8Pmk/47ZwOFylZJT2BiKE O8RxJF6cW+ycKNJF1py2+Tc21L2tncfSXQg5qA0brkQi+br1Gy2FpTkZGmmNl0aSJszp xv6z86Cw1q7csNtG5LiG+LNkKD1VTKy0vbctGlQCumdHvEw4MI7vG8B2blKRp0R5COPu Iwo0Zapfar2IQ+VZB3kWmyOPK/id7OfnREZYwd+o6lcze5LM6gsGprBf6Pska9ExHzlc 7XRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=+5IgTjHGzPTit53+QOduby3HlkhGNOQyX1AxpBUml6k=; b=KLO4sTCN2eQc4enKMiO+Dwn70Tb3VBkkKdhItwLYcGpmQK+hSx4CEaPxgfQKyr/lF6 i+JsADc8M8Rm+RUKr7mqTfc9Xqi+zFg/X1N1qoKa7rZiH2UEw3LnBpLIrhTntOgtTeJu Aj62QIKlHA5RnIbENho1L2mc2n8eoXRgTMRzelAJRnteNe5xi5ZcnBjHy11pFoEgdQqY +uRn1wOf3curSdg8ru7VJvCl3tHXs5C4AhA0+XdbCZcNFayXDlia5cX63R8TGAt+YMvm 93oB02QKOfjbaAlzAtsXvbcSYIC9/oThCAuA6hR4to0WCiF3qw2S3ZZg7NIWiw+6zxxa 5Bfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si6486732pgq.785.2018.01.18.11.42.20; Thu, 18 Jan 2018 11:42:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755956AbeARTk4 (ORCPT + 99 others); Thu, 18 Jan 2018 14:40:56 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:55634 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755634AbeARTiX (ORCPT ); Thu, 18 Jan 2018 14:38:23 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1ecG0u-0005ER-0T; Thu, 18 Jan 2018 19:38:16 +0000 From: Al Viro To: netdev@vger.kernel.org Cc: "David S. Miller" , Linus Torvalds , linux-kernel@vger.kernel.org, Christoph Hellwig , Al Viro Subject: [PATCH 08/10] ipconfig: use dev_set_mtu() Date: Thu, 18 Jan 2018 19:37:53 +0000 Message-Id: <20180118193755.19997-8-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180118193755.19997-1-viro@ZenIV.linux.org.uk> References: <20180118193156.GC13338@ZenIV.linux.org.uk> <20180118193755.19997-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Signed-off-by: Al Viro --- net/ipv4/ipconfig.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 5f396afaa08d..f75802ad960f 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -329,17 +329,6 @@ set_sockaddr(struct sockaddr_in *sin, __be32 addr, __be16 port) sin->sin_port = port; } -static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg) -{ - int res; - - mm_segment_t oldfs = get_fs(); - set_fs(get_ds()); - res = dev_ioctl(&init_net, cmd, (struct ifreq __user *) arg); - set_fs(oldfs); - return res; -} - /* * Set up interface addresses and routes. */ @@ -375,11 +364,11 @@ static int __init ic_setup_if(void) * out, we'll try to muddle along. */ if (ic_dev_mtu != 0) { - strcpy(ir.ifr_name, ic_dev->dev->name); - ir.ifr_mtu = ic_dev_mtu; - if ((err = ic_dev_ioctl(SIOCSIFMTU, &ir)) < 0) + rtnl_lock(); + if ((err = dev_set_mtu(ic_dev->dev, ic_dev_mtu)) < 0) pr_err("IP-Config: Unable to set interface mtu to %d (%d)\n", ic_dev_mtu, err); + rtnl_unlock(); } return 0; } -- 2.11.0