aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c47c989cb1fb..bda08a09357d 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -222,7 +222,7 @@ fail:
222 return error; 222 return error;
223} 223}
224 224
225static int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2) 225int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
226{ 226{
227 struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2); 227 struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
228 228
@@ -596,6 +596,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
596 return -EOPNOTSUPP; 596 return -EOPNOTSUPP;
597 597
598 ipc.opt = NULL; 598 ipc.opt = NULL;
599 ipc.shtx.flags = 0;
599 600
600 if (up->pending) { 601 if (up->pending) {
601 /* 602 /*
@@ -643,6 +644,9 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
643 ipc.addr = inet->saddr; 644 ipc.addr = inet->saddr;
644 645
645 ipc.oif = sk->sk_bound_dev_if; 646 ipc.oif = sk->sk_bound_dev_if;
647 err = sock_tx_timestamp(msg, sk, &ipc.shtx);
648 if (err)
649 return err;
646 if (msg->msg_controllen) { 650 if (msg->msg_controllen) {
647 err = ip_cmsg_send(sock_net(sk), msg, &ipc); 651 err = ip_cmsg_send(sock_net(sk), msg, &ipc);
648 if (err) 652 if (err)
@@ -1180,7 +1184,7 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
1180 sk = sknext; 1184 sk = sknext;
1181 } while (sknext); 1185 } while (sknext);
1182 } else 1186 } else
1183 kfree_skb(skb); 1187 consume_skb(skb);
1184 spin_unlock(&hslot->lock); 1188 spin_unlock(&hslot->lock);
1185 return 0; 1189 return 0;
1186} 1190}
@@ -1614,7 +1618,8 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
1614 } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family)); 1618 } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family));
1615 1619
1616 if (!sk) { 1620 if (!sk) {
1617 spin_unlock_bh(&state->udp_table->hash[state->bucket].lock); 1621 if (state->bucket < UDP_HTABLE_SIZE)
1622 spin_unlock_bh(&state->udp_table->hash[state->bucket].lock);
1618 return udp_get_first(seq, state->bucket + 1); 1623 return udp_get_first(seq, state->bucket + 1);
1619 } 1624 }
1620 return sk; 1625 return sk;
@@ -1632,6 +1637,9 @@ static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos)
1632 1637
1633static void *udp_seq_start(struct seq_file *seq, loff_t *pos) 1638static void *udp_seq_start(struct seq_file *seq, loff_t *pos)
1634{ 1639{
1640 struct udp_iter_state *state = seq->private;
1641 state->bucket = UDP_HTABLE_SIZE;
1642
1635 return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; 1643 return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
1636} 1644}
1637 1645
@@ -1815,6 +1823,7 @@ EXPORT_SYMBOL(udp_lib_getsockopt);
1815EXPORT_SYMBOL(udp_lib_setsockopt); 1823EXPORT_SYMBOL(udp_lib_setsockopt);
1816EXPORT_SYMBOL(udp_poll); 1824EXPORT_SYMBOL(udp_poll);
1817EXPORT_SYMBOL(udp_lib_get_port); 1825EXPORT_SYMBOL(udp_lib_get_port);
1826EXPORT_SYMBOL(ipv4_rcv_saddr_equal);
1818 1827
1819#ifdef CONFIG_PROC_FS 1828#ifdef CONFIG_PROC_FS
1820EXPORT_SYMBOL(udp_proc_register); 1829EXPORT_SYMBOL(udp_proc_register);