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
Kirill Smelkov
linux
Commits
ef0a5bdd
Commit
ef0a5bdd
authored
Sep 10, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
3f63a8d2
7ced8237
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
include/linux/rtnetlink.h
include/linux/rtnetlink.h
+0
-4
net/core/rtnetlink.c
net/core/rtnetlink.c
+17
-5
No files found.
include/linux/rtnetlink.h
View file @
ef0a5bdd
...
...
@@ -660,10 +660,6 @@ enum
#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
/* SUMMARY: maximal rtattr understood by kernel */
#define RTATTR_MAX RTA_MAX
/* RTnetlink multicast groups */
#define RTMGRP_LINK 1
...
...
net/core/rtnetlink.c
View file @
ef0a5bdd
...
...
@@ -401,6 +401,10 @@ static int rtnetlink_done(struct netlink_callback *cb)
return
0
;
}
/* Protected by RTNL sempahore. */
static
struct
rtattr
**
rta_buf
;
static
int
rtattr_max
;
/* Process one rtnetlink message. */
static
__inline__
int
...
...
@@ -408,8 +412,6 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
{
struct
rtnetlink_link
*
link
;
struct
rtnetlink_link
*
link_tab
;
struct
rtattr
*
rta
[
RTATTR_MAX
];
int
sz_idx
,
kind
;
int
min_len
;
int
family
;
...
...
@@ -476,7 +478,7 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
return
-
1
;
}
memset
(
&
rta
,
0
,
sizeof
(
rta
));
memset
(
rta_buf
,
0
,
(
rtattr_max
*
sizeof
(
struct
rtattr
*
)
));
min_len
=
rtm_min
[
sz_idx
];
if
(
nlh
->
nlmsg_len
<
min_len
)
...
...
@@ -491,7 +493,7 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
if
(
flavor
)
{
if
(
flavor
>
rta_max
[
sz_idx
])
goto
err_inval
;
rta
[
flavor
-
1
]
=
attr
;
rta
_buf
[
flavor
-
1
]
=
attr
;
}
attr
=
RTA_NEXT
(
attr
,
attrlen
);
}
...
...
@@ -501,7 +503,7 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
link
=
&
(
rtnetlink_links
[
PF_UNSPEC
][
type
]);
if
(
link
->
doit
==
NULL
)
goto
err_inval
;
err
=
link
->
doit
(
skb
,
nlh
,
(
void
*
)
&
rta
);
err
=
link
->
doit
(
skb
,
nlh
,
(
void
*
)
&
rta
_buf
[
0
]
);
*
errp
=
err
;
return
err
;
...
...
@@ -621,6 +623,16 @@ static struct notifier_block rtnetlink_dev_notifier = {
void
__init
rtnetlink_init
(
void
)
{
int
i
;
rtattr_max
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
rta_max
);
i
++
)
if
(
rta_max
[
i
]
>
rtattr_max
)
rtattr_max
=
rta_max
[
i
];
rta_buf
=
kmalloc
(
rtattr_max
*
sizeof
(
struct
rtattr
*
),
GFP_KERNEL
);
if
(
!
rta_buf
)
panic
(
"rtnetlink_init: cannot allocate rta_buf
\n
"
);
rtnl
=
netlink_kernel_create
(
NETLINK_ROUTE
,
rtnetlink_rcv
);
if
(
rtnl
==
NULL
)
panic
(
"rtnetlink_init: cannot initialize rtnetlink
\n
"
);
...
...
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