Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b73fdeae
Commit
b73fdeae
authored
Aug 15, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Network device renaming sysfs fix.
parent
6d62388c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
net/core/dev.c
net/core/dev.c
+10
-6
No files found.
net/core/dev.c
View file @
b73fdeae
...
...
@@ -2343,14 +2343,18 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd)
case
SIOCSIFNAME
:
if
(
dev
->
flags
&
IFF_UP
)
return
-
EBUSY
;
ifr
->
ifr_newname
[
IFNAMSIZ
-
1
]
=
'\0'
;
if
(
__dev_get_by_name
(
ifr
->
ifr_newname
))
return
-
EEXIST
;
memcpy
(
dev
->
name
,
ifr
->
ifr_newname
,
IFNAMSIZ
);
dev
->
name
[
IFNAMSIZ
-
1
]
=
0
;
strlcpy
(
dev
->
class_dev
.
class_id
,
dev
->
name
,
BUS_ID_SIZE
);
notifier_call_chain
(
&
netdev_chain
,
NETDEV_CHANGENAME
,
dev
);
return
0
;
err
=
class_device_rename
(
&
dev
->
class_dev
,
ifr
->
ifr_newname
);
if
(
!
err
)
{
strlcpy
(
dev
->
name
,
ifr
->
ifr_newname
,
IFNAMSIZ
);
notifier_call_chain
(
&
netdev_chain
,
NETDEV_CHANGENAME
,
dev
);
}
return
err
;
/*
* Unknown or private ioctl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment