diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 006e2ccd6cc2..66341a3c8d36 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -822,6 +822,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
822 | 822 | ||
823 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; | 823 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; |
824 | 824 | ||
825 | fl4 = &inet->cork.fl.u.ip4; | ||
825 | if (up->pending) { | 826 | if (up->pending) { |
826 | /* | 827 | /* |
827 | * There are pending frames. | 828 | * There are pending frames. |
@@ -920,7 +921,6 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
920 | if (connected) | 921 | if (connected) |
921 | rt = (struct rtable *)sk_dst_check(sk, 0); | 922 | rt = (struct rtable *)sk_dst_check(sk, 0); |
922 | 923 | ||
923 | fl4 = &inet->cork.fl.u.ip4; | ||
924 | if (rt == NULL) { | 924 | if (rt == NULL) { |
925 | struct net *net = sock_net(sk); | 925 | struct net *net = sock_net(sk); |
926 | 926 | ||
@@ -989,9 +989,9 @@ back_from_confirm: | |||
989 | 989 | ||
990 | do_append_data: | 990 | do_append_data: |
991 | up->len += ulen; | 991 | up->len += ulen; |
992 | err = ip_append_data(sk, getfrag, msg->msg_iov, ulen, | 992 | err = ip_append_data(sk, fl4, getfrag, msg->msg_iov, ulen, |
993 | sizeof(struct udphdr), &ipc, &rt, | 993 | sizeof(struct udphdr), &ipc, &rt, |
994 | corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags); | 994 | corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags); |
995 | if (err) | 995 | if (err) |
996 | udp_flush_pending_frames(sk); | 996 | udp_flush_pending_frames(sk); |
997 | else if (!corkreq) | 997 | else if (!corkreq) |
@@ -1031,6 +1031,7 @@ EXPORT_SYMBOL(udp_sendmsg); | |||
1031 | int udp_sendpage(struct sock *sk, struct page *page, int offset, | 1031 | int udp_sendpage(struct sock *sk, struct page *page, int offset, |
1032 | size_t size, int flags) | 1032 | size_t size, int flags) |
1033 | { | 1033 | { |
1034 | struct inet_sock *inet = inet_sk(sk); | ||
1034 | struct udp_sock *up = udp_sk(sk); | 1035 | struct udp_sock *up = udp_sk(sk); |
1035 | int ret; | 1036 | int ret; |
1036 | 1037 | ||
@@ -1055,7 +1056,8 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
1055 | return -EINVAL; | 1056 | return -EINVAL; |
1056 | } | 1057 | } |
1057 | 1058 | ||
1058 | ret = ip_append_page(sk, page, offset, size, flags); | 1059 | ret = ip_append_page(sk, &inet->cork.fl.u.ip4, |
1060 | page, offset, size, flags); | ||
1059 | if (ret == -EOPNOTSUPP) { | 1061 | if (ret == -EOPNOTSUPP) { |
1060 | release_sock(sk); | 1062 | release_sock(sk); |
1061 | return sock_no_sendpage(sk->sk_socket, page, offset, | 1063 | return sock_no_sendpage(sk->sk_socket, page, offset, |