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
0dbf2dbb
Commit
0dbf2dbb
authored
Sep 01, 2004
by
Eric Lemoine
Committed by
David S. Miller
Sep 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Allow get/set of dev->weight via netlink.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
f6b652d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
include/linux/rtnetlink.h
include/linux/rtnetlink.h
+2
-0
net/core/rtnetlink.c
net/core/rtnetlink.c
+12
-0
No files found.
include/linux/rtnetlink.h
View file @
0dbf2dbb
...
@@ -565,6 +565,8 @@ enum
...
@@ -565,6 +565,8 @@ enum
#define IFLA_TXQLEN IFLA_TXQLEN
#define IFLA_TXQLEN IFLA_TXQLEN
IFLA_MAP
,
IFLA_MAP
,
#define IFLA_MAP IFLA_MAP
#define IFLA_MAP IFLA_MAP
IFLA_WEIGHT
,
#define IFLA_WEIGHT IFLA_WEIGHT
__IFLA_MAX
__IFLA_MAX
};
};
...
...
net/core/rtnetlink.c
View file @
0dbf2dbb
...
@@ -176,6 +176,11 @@ static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
...
@@ -176,6 +176,11 @@ static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
RTA_PUT
(
skb
,
IFLA_TXQLEN
,
sizeof
(
txqlen
),
&
txqlen
);
RTA_PUT
(
skb
,
IFLA_TXQLEN
,
sizeof
(
txqlen
),
&
txqlen
);
}
}
if
(
1
)
{
u32
weight
=
dev
->
weight
;
RTA_PUT
(
skb
,
IFLA_WEIGHT
,
sizeof
(
weight
),
&
weight
);
}
if
(
1
)
{
if
(
1
)
{
struct
ifmap
map
=
{
struct
ifmap
map
=
{
.
mem_start
=
dev
->
mem_start
,
.
mem_start
=
dev
->
mem_start
,
...
@@ -333,6 +338,13 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
...
@@ -333,6 +338,13 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
dev
->
tx_queue_len
=
*
((
u32
*
)
RTA_DATA
(
ida
[
IFLA_TXQLEN
-
1
]));
dev
->
tx_queue_len
=
*
((
u32
*
)
RTA_DATA
(
ida
[
IFLA_TXQLEN
-
1
]));
}
}
if
(
ida
[
IFLA_WEIGHT
-
1
])
{
if
(
ida
[
IFLA_WEIGHT
-
1
]
->
rta_len
!=
RTA_LENGTH
(
sizeof
(
u32
)))
goto
out
;
dev
->
weight
=
*
((
u32
*
)
RTA_DATA
(
ida
[
IFLA_WEIGHT
-
1
]));
}
err
=
0
;
err
=
0
;
out:
out:
...
...
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