diff --git a/include/net/udp.h b/include/net/udp.h index f98abd2ce709bd..702bea0bac2140 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -134,6 +134,7 @@ extern void udp_err(struct sk_buff *, u32); extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len); +extern int udp_push_pending_frames(struct sock *sk); extern void udp_flush_pending_frames(struct sock *sk); extern int udp_rcv(struct sk_buff *skb); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index dba3c01b9227c9..0b2e07fbcaaafe 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -513,7 +513,7 @@ static void udp4_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb, /* * Push out all pending data as one UDP datagram. Socket is locked. */ -static int udp_push_pending_frames(struct sock *sk) +int udp_push_pending_frames(struct sock *sk) { struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); @@ -575,6 +575,7 @@ static int udp_push_pending_frames(struct sock *sk) up->pending = 0; return err; } +EXPORT_SYMBOL(udp_push_pending_frames); int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 3a9185909a463a..d0367eb45ae32f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -687,11 +687,16 @@ static int udp_v6_push_pending_frames(struct sock *sk) struct udphdr *uh; struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); - struct flowi *fl = &inet->cork.fl; + struct flowi *fl; int err = 0; int is_udplite = IS_UDPLITE(sk); __wsum csum = 0; + if (up->pending == AF_INET) + return udp_push_pending_frames(sk); + + fl = &inet->cork.fl; + /* Grab the skbuff where UDP header space exists. */ if ((skb = skb_peek(&sk->sk_write_queue)) == NULL) goto out;