aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/eth_media.c13
-rw-r--r--net/tipc/net.c1
2 files changed, 4 insertions, 10 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 673fdf0b3222..6e988ba485fd 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -101,15 +101,12 @@ static int send_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr,
101 * Accept only packets explicitly sent to this node, or broadcast packets; 101 * Accept only packets explicitly sent to this node, or broadcast packets;
102 * ignores packets sent using Ethernet multicast, and traffic sent to other 102 * ignores packets sent using Ethernet multicast, and traffic sent to other
103 * nodes (which can happen if interface is running in promiscuous mode). 103 * nodes (which can happen if interface is running in promiscuous mode).
104 * Routine truncates any Ethernet padding/CRC appended to the message,
105 * and ensures message size matches actual length
106 */ 104 */
107 105
108static int recv_msg(struct sk_buff *buf, struct net_device *dev, 106static int recv_msg(struct sk_buff *buf, struct net_device *dev,
109 struct packet_type *pt, struct net_device *orig_dev) 107 struct packet_type *pt, struct net_device *orig_dev)
110{ 108{
111 struct eth_bearer *eb_ptr = (struct eth_bearer *)pt->af_packet_priv; 109 struct eth_bearer *eb_ptr = (struct eth_bearer *)pt->af_packet_priv;
112 u32 size;
113 110
114 if (!net_eq(dev_net(dev), &init_net)) { 111 if (!net_eq(dev_net(dev), &init_net)) {
115 kfree_skb(buf); 112 kfree_skb(buf);
@@ -118,13 +115,9 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
118 115
119 if (likely(eb_ptr->bearer)) { 116 if (likely(eb_ptr->bearer)) {
120 if (likely(buf->pkt_type <= PACKET_BROADCAST)) { 117 if (likely(buf->pkt_type <= PACKET_BROADCAST)) {
121 size = msg_size((struct tipc_msg *)buf->data); 118 buf->next = NULL;
122 skb_trim(buf, size); 119 tipc_recv_msg(buf, eb_ptr->bearer);
123 if (likely(buf->len == size)) { 120 return 0;
124 buf->next = NULL;
125 tipc_recv_msg(buf, eb_ptr->bearer);
126 return 0;
127 }
128 } 121 }
129 } 122 }
130 kfree_skb(buf); 123 kfree_skb(buf);
diff --git a/net/tipc/net.c b/net/tipc/net.c
index f61b7694138b..7e05af47a196 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -248,6 +248,7 @@ void tipc_net_route_msg(struct sk_buff *buf)
248 248
249 /* Handle message for another node */ 249 /* Handle message for another node */
250 msg_dbg(msg, "NET>SEND>: "); 250 msg_dbg(msg, "NET>SEND>: ");
251 skb_trim(buf, msg_size(msg));
251 tipc_link_send(buf, dnode, msg_link_selector(msg)); 252 tipc_link_send(buf, dnode, msg_link_selector(msg));
252} 253}
253 254