aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/udp_media.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index c170d3138953..6e648d90297a 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -52,6 +52,8 @@
52/* IANA assigned UDP port */ 52/* IANA assigned UDP port */
53#define UDP_PORT_DEFAULT 6118 53#define UDP_PORT_DEFAULT 6118
54 54
55#define UDP_MIN_HEADROOM 28
56
55static const struct nla_policy tipc_nl_udp_policy[TIPC_NLA_UDP_MAX + 1] = { 57static const struct nla_policy tipc_nl_udp_policy[TIPC_NLA_UDP_MAX + 1] = {
56 [TIPC_NLA_UDP_UNSPEC] = {.type = NLA_UNSPEC}, 58 [TIPC_NLA_UDP_UNSPEC] = {.type = NLA_UNSPEC},
57 [TIPC_NLA_UDP_LOCAL] = {.type = NLA_BINARY, 59 [TIPC_NLA_UDP_LOCAL] = {.type = NLA_BINARY,
@@ -156,6 +158,9 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
156 struct sk_buff *clone; 158 struct sk_buff *clone;
157 struct rtable *rt; 159 struct rtable *rt;
158 160
161 if (skb_headroom(skb) < UDP_MIN_HEADROOM)
162 pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
163
159 clone = skb_clone(skb, GFP_ATOMIC); 164 clone = skb_clone(skb, GFP_ATOMIC);
160 skb_set_inner_protocol(clone, htons(ETH_P_TIPC)); 165 skb_set_inner_protocol(clone, htons(ETH_P_TIPC));
161 ub = rcu_dereference_rtnl(b->media_ptr); 166 ub = rcu_dereference_rtnl(b->media_ptr);