Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47679
b: refs/heads/master
c: 95f30b3
h: refs/heads/master
i:
  47677: cbe1e39
  47675: fd60c15
  47671: b84dc17
  47663: 130fefa
  47647: 6eed036
  47615: a8b5a4b
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 11, 2007
1 parent 51242b3 commit 40b45eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4768fbcbcfbbcacb785ae08eef33767a0b4fdcdd
refs/heads/master: 95f30b336b944e3e418f825044b4793d9e9aac09
9 changes: 5 additions & 4 deletions trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static inline int __udp_lib_lport_inuse(__u16 num, struct hlist_head udptable[])
struct hlist_node *node;

sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)])
if (inet_sk(sk)->num == num)
if (sk->sk_hash == num)
return 1;
return 0;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum,
head = &udptable[snum & (UDP_HTABLE_SIZE - 1)];

sk_for_each(sk2, node, head)
if (inet_sk(sk2)->num == snum &&
if (sk2->sk_hash == snum &&
sk2 != sk &&
(!sk2->sk_reuse || !sk->sk_reuse) &&
(!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if
Expand All @@ -200,6 +200,7 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum,
goto fail;
}
inet_sk(sk)->num = snum;
sk->sk_hash = snum;
if (sk_unhashed(sk)) {
head = &udptable[snum & (UDP_HTABLE_SIZE - 1)];
sk_add_node(sk, head);
Expand Down Expand Up @@ -247,7 +248,7 @@ static struct sock *__udp4_lib_lookup(__be32 saddr, __be16 sport,
sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) {
struct inet_sock *inet = inet_sk(sk);

if (inet->num == hnum && !ipv6_only_sock(sk)) {
if (sk->sk_hash == hnum && !ipv6_only_sock(sk)) {
int score = (sk->sk_family == PF_INET ? 1 : 0);
if (inet->rcv_saddr) {
if (inet->rcv_saddr != daddr)
Expand Down Expand Up @@ -296,7 +297,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
sk_for_each_from(s, node) {
struct inet_sock *inet = inet_sk(s);

if (inet->num != hnum ||
if (s->sk_hash != hnum ||
(inet->daddr && inet->daddr != rmt_addr) ||
(inet->dport != rmt_port && inet->dport) ||
(inet->rcv_saddr && inet->rcv_saddr != loc_addr) ||
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static struct sock *__udp6_lib_lookup(struct in6_addr *saddr, __be16 sport,
sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) {
struct inet_sock *inet = inet_sk(sk);

if (inet->num == hnum && sk->sk_family == PF_INET6) {
if (sk->sk_hash == hnum && sk->sk_family == PF_INET6) {
struct ipv6_pinfo *np = inet6_sk(sk);
int score = 0;
if (inet->dport) {
Expand Down Expand Up @@ -309,7 +309,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
sk_for_each_from(s, node) {
struct inet_sock *inet = inet_sk(s);

if (inet->num == num && s->sk_family == PF_INET6) {
if (s->sk_hash == num && s->sk_family == PF_INET6) {
struct ipv6_pinfo *np = inet6_sk(s);
if (inet->dport) {
if (inet->dport != rmt_port)
Expand Down

0 comments on commit 40b45eb

Please sign in to comment.