diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-06-27 23:57:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-28 20:56:43 -0400 |
commit | 58050fce3530939372e6c2f4b4beb76fcb4caa65 (patch) | |
tree | ee2b85eda9973fed36102dad66f583e43a4a6cab /net/l2tp | |
parent | 9f10d3f6f966ef6f6a8d025a4b1d341923d04607 (diff) |
net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()
Using NLMSG_GOODSIZE results in multiple pages being used as
nlmsg_new() will automatically add the size of the netlink
header to the payload thus exceeding the page limit.
NLMSG_DEFAULT_SIZE takes this into account.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r-- | net/l2tp/l2tp_netlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index ddc553e76671..d71cd9229a47 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
@@ -72,7 +72,7 @@ static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info) | |||
72 | void *hdr; | 72 | void *hdr; |
73 | int ret = -ENOBUFS; | 73 | int ret = -ENOBUFS; |
74 | 74 | ||
75 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 75 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
76 | if (!msg) { | 76 | if (!msg) { |
77 | ret = -ENOMEM; | 77 | ret = -ENOMEM; |
78 | goto out; | 78 | goto out; |
@@ -353,7 +353,7 @@ static int l2tp_nl_cmd_tunnel_get(struct sk_buff *skb, struct genl_info *info) | |||
353 | goto out; | 353 | goto out; |
354 | } | 354 | } |
355 | 355 | ||
356 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 356 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
357 | if (!msg) { | 357 | if (!msg) { |
358 | ret = -ENOMEM; | 358 | ret = -ENOMEM; |
359 | goto out; | 359 | goto out; |
@@ -699,7 +699,7 @@ static int l2tp_nl_cmd_session_get(struct sk_buff *skb, struct genl_info *info) | |||
699 | goto out; | 699 | goto out; |
700 | } | 700 | } |
701 | 701 | ||
702 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 702 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
703 | if (!msg) { | 703 | if (!msg) { |
704 | ret = -ENOMEM; | 704 | ret = -ENOMEM; |
705 | goto out; | 705 | goto out; |