aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-10-01 20:27:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-01-24 19:13:45 -0500
commit6a88fbe7257282c19c777d5fe310166e5b3089e8 (patch)
tree77236e2c151a46e2caf83c707a116f25a2f5adb1
parentb1b0c245067268043e0e832432f3d537a5cae33b (diff)
ipconfig: use dev_set_mtu()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--net/ipv4/ipconfig.c17
1 files 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)
329 sin->sin_port = port; 329 sin->sin_port = port;
330} 330}
331 331
332static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
333{
334 int res;
335
336 mm_segment_t oldfs = get_fs();
337 set_fs(get_ds());
338 res = dev_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
339 set_fs(oldfs);
340 return res;
341}
342
343/* 332/*
344 * Set up interface addresses and routes. 333 * Set up interface addresses and routes.
345 */ 334 */
@@ -375,11 +364,11 @@ static int __init ic_setup_if(void)
375 * out, we'll try to muddle along. 364 * out, we'll try to muddle along.
376 */ 365 */
377 if (ic_dev_mtu != 0) { 366 if (ic_dev_mtu != 0) {
378 strcpy(ir.ifr_name, ic_dev->dev->name); 367 rtnl_lock();
379 ir.ifr_mtu = ic_dev_mtu; 368 if ((err = dev_set_mtu(ic_dev->dev, ic_dev_mtu)) < 0)
380 if ((err = ic_dev_ioctl(SIOCSIFMTU, &ir)) < 0)
381 pr_err("IP-Config: Unable to set interface mtu to %d (%d)\n", 369 pr_err("IP-Config: Unable to set interface mtu to %d (%d)\n",
382 ic_dev_mtu, err); 370 ic_dev_mtu, err);
371 rtnl_unlock();
383 } 372 }
384 return 0; 373 return 0;
385} 374}