diff options
| author | Willem de Bruijn <willemb@google.com> | 2018-04-26 13:42:15 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-04-26 15:06:46 -0400 |
| commit | 1cd7884dfd78df6284d27b008823b0b4a808f196 (patch) | |
| tree | b48749c800e0e4ead8e70fd87dfe8008f7113ccf /net/ipv4/ip_output.c | |
| parent | a9537c937c1790b62de5e2789e67c0bf439b11ea (diff) | |
udp: expose inet cork to udp
UDP segmentation offload needs access to inet_cork in the udp layer.
Pass the struct to ip(6)_make_skb instead of allocating it on the
stack in that function itself.
This patch is a noop otherwise.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
| -rw-r--r-- | net/ipv4/ip_output.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 83c73bab2c3d..2883ff1e909c 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -1470,9 +1470,8 @@ struct sk_buff *ip_make_skb(struct sock *sk, | |||
| 1470 | int len, int odd, struct sk_buff *skb), | 1470 | int len, int odd, struct sk_buff *skb), |
| 1471 | void *from, int length, int transhdrlen, | 1471 | void *from, int length, int transhdrlen, |
| 1472 | struct ipcm_cookie *ipc, struct rtable **rtp, | 1472 | struct ipcm_cookie *ipc, struct rtable **rtp, |
| 1473 | unsigned int flags) | 1473 | struct inet_cork *cork, unsigned int flags) |
| 1474 | { | 1474 | { |
| 1475 | struct inet_cork cork; | ||
| 1476 | struct sk_buff_head queue; | 1475 | struct sk_buff_head queue; |
| 1477 | int err; | 1476 | int err; |
| 1478 | 1477 | ||
| @@ -1481,22 +1480,22 @@ struct sk_buff *ip_make_skb(struct sock *sk, | |||
| 1481 | 1480 | ||
| 1482 | __skb_queue_head_init(&queue); | 1481 | __skb_queue_head_init(&queue); |
| 1483 | 1482 | ||
| 1484 | cork.flags = 0; | 1483 | cork->flags = 0; |
| 1485 | cork.addr = 0; | 1484 | cork->addr = 0; |
| 1486 | cork.opt = NULL; | 1485 | cork->opt = NULL; |
| 1487 | err = ip_setup_cork(sk, &cork, ipc, rtp); | 1486 | err = ip_setup_cork(sk, cork, ipc, rtp); |
| 1488 | if (err) | 1487 | if (err) |
| 1489 | return ERR_PTR(err); | 1488 | return ERR_PTR(err); |
| 1490 | 1489 | ||
| 1491 | err = __ip_append_data(sk, fl4, &queue, &cork, | 1490 | err = __ip_append_data(sk, fl4, &queue, cork, |
| 1492 | ¤t->task_frag, getfrag, | 1491 | ¤t->task_frag, getfrag, |
| 1493 | from, length, transhdrlen, flags); | 1492 | from, length, transhdrlen, flags); |
| 1494 | if (err) { | 1493 | if (err) { |
| 1495 | __ip_flush_pending_frames(sk, &queue, &cork); | 1494 | __ip_flush_pending_frames(sk, &queue, cork); |
| 1496 | return ERR_PTR(err); | 1495 | return ERR_PTR(err); |
| 1497 | } | 1496 | } |
| 1498 | 1497 | ||
| 1499 | return __ip_make_skb(sk, fl4, &queue, &cork); | 1498 | return __ip_make_skb(sk, fl4, &queue, cork); |
| 1500 | } | 1499 | } |
| 1501 | 1500 | ||
| 1502 | /* | 1501 | /* |
