aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/udp.h1
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv6/udp.c7
3 files changed, 9 insertions, 2 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index b30a71a51839..74c10ec5e74f 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -181,6 +181,7 @@ extern int udp_get_port(struct sock *sk, unsigned short snum,
181extern void udp_err(struct sk_buff *, u32); 181extern void udp_err(struct sk_buff *, u32);
182extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 182extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk);
184extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
185extern int udp_rcv(struct sk_buff *skb); 186extern int udp_rcv(struct sk_buff *skb);
186extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 959502afd8d9..6b270e53c207 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -800,7 +800,7 @@ send:
800/* 800/*
801 * Push out all pending data as one UDP datagram. Socket is locked. 801 * Push out all pending data as one UDP datagram. Socket is locked.
802 */ 802 */
803static int udp_push_pending_frames(struct sock *sk) 803int udp_push_pending_frames(struct sock *sk)
804{ 804{
805 struct udp_sock *up = udp_sk(sk); 805 struct udp_sock *up = udp_sk(sk);
806 struct inet_sock *inet = inet_sk(sk); 806 struct inet_sock *inet = inet_sk(sk);
@@ -819,6 +819,7 @@ out:
819 up->pending = 0; 819 up->pending = 0;
820 return err; 820 return err;
821} 821}
822EXPORT_SYMBOL(udp_push_pending_frames);
822 823
823int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 824int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
824 size_t len) 825 size_t len)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f77e34c5a0e2..b6f31437a1f8 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -959,11 +959,16 @@ static int udp_v6_push_pending_frames(struct sock *sk)
959 struct udphdr *uh; 959 struct udphdr *uh;
960 struct udp_sock *up = udp_sk(sk); 960 struct udp_sock *up = udp_sk(sk);
961 struct inet_sock *inet = inet_sk(sk); 961 struct inet_sock *inet = inet_sk(sk);
962 struct flowi6 *fl6 = &inet->cork.fl.u.ip6; 962 struct flowi6 *fl6;
963 int err = 0; 963 int err = 0;
964 int is_udplite = IS_UDPLITE(sk); 964 int is_udplite = IS_UDPLITE(sk);
965 __wsum csum = 0; 965 __wsum csum = 0;
966 966
967 if (up->pending == AF_INET)
968 return udp_push_pending_frames(sk);
969
970 fl6 = &inet->cork.fl.u.ip6;
971
967 /* Grab the skbuff where UDP header space exists. */ 972 /* Grab the skbuff where UDP header space exists. */
968 if ((skb = skb_peek(&sk->sk_write_queue)) == NULL) 973 if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
969 goto out; 974 goto out;