aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-11-19 14:30:40 -0500
committerDavid S. Miller <davem@davemloft.net>2015-11-20 14:06:09 -0500
commitc7cad0d6f70cd4ce8644ffe528a4df1cdc2e77f5 (patch)
tree7a9152f5bfc20252055295f49230c7e774c1dfc5 /net/tipc
parent12ded5cae60f62eddaed7cc8f38f7a830571fc3d (diff)
tipc: move linearization of buffers to generic code
In commit 5cbb28a4bf65c7e4 ("tipc: linearize arriving NAME_DISTR and LINK_PROTO buffers") we added linearization of NAME_DISTRIBUTOR, LINK_PROTOCOL/RESET and LINK_PROTOCOL/ACTIVATE to the function tipc_udp_recv(). The location of the change was selected in order to make the commit easily appliable to 'net' and 'stable'. We now move this linearization to where it should be done, in the functions tipc_named_rcv() and tipc_link_proto_rcv() respectively. Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c2
-rw-r--r--net/tipc/name_distr.c1
-rw-r--r--net/tipc/udp_media.c5
3 files changed, 3 insertions, 5 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 9efbdbde2b08..fa452fb5f34e 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1260,6 +1260,8 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
1260 /* fall thru' */ 1260 /* fall thru' */
1261 1261
1262 case ACTIVATE_MSG: 1262 case ACTIVATE_MSG:
1263 skb_linearize(skb);
1264 hdr = buf_msg(skb);
1263 1265
1264 /* Complete own link name with peer's interface name */ 1266 /* Complete own link name with peer's interface name */
1265 if_name = strrchr(l->name, ':') + 1; 1267 if_name = strrchr(l->name, ':') + 1;
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index c07612bab95c..f51c8bdbea1c 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -397,6 +397,7 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *inputq)
397 397
398 spin_lock_bh(&tn->nametbl_lock); 398 spin_lock_bh(&tn->nametbl_lock);
399 for (skb = skb_dequeue(inputq); skb; skb = skb_dequeue(inputq)) { 399 for (skb = skb_dequeue(inputq); skb; skb = skb_dequeue(inputq)) {
400 skb_linearize(skb);
400 msg = buf_msg(skb); 401 msg = buf_msg(skb);
401 mtype = msg_type(msg); 402 mtype = msg_type(msg);
402 item = (struct distr_item *)msg_data(msg); 403 item = (struct distr_item *)msg_data(msg);
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index ad2719ad4c1b..816914ef228d 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -48,7 +48,6 @@
48#include <linux/tipc_netlink.h> 48#include <linux/tipc_netlink.h>
49#include "core.h" 49#include "core.h"
50#include "bearer.h" 50#include "bearer.h"
51#include "msg.h"
52 51
53/* IANA assigned UDP port */ 52/* IANA assigned UDP port */
54#define UDP_PORT_DEFAULT 6118 53#define UDP_PORT_DEFAULT 6118
@@ -221,10 +220,6 @@ static int tipc_udp_recv(struct sock *sk, struct sk_buff *skb)
221{ 220{
222 struct udp_bearer *ub; 221 struct udp_bearer *ub;
223 struct tipc_bearer *b; 222 struct tipc_bearer *b;
224 int usr = msg_user(buf_msg(skb));
225
226 if ((usr == LINK_PROTOCOL) || (usr == NAME_DISTRIBUTOR))
227 skb_linearize(skb);
228 223
229 ub = rcu_dereference_sk_user_data(sk); 224 ub = rcu_dereference_sk_user_data(sk);
230 if (!ub) { 225 if (!ub) {