[INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.

The port offset calculations depend on the protocol family, but, as
Adrian noticed, I broke this logic with the commit

5ee31fc1ecdcbc234c8c56dcacef87c8e09909d8
[INET]: Consolidate inet(6)_hash_connect.

Return this logic back, by passing the port offset directly into the
consolidated function.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Noticed-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Pavel Emelyanov and committed by David S. Miller 5d8c0aa9 2bfc79de

+5 -5
+1 -1
include/net/inet_hashtables.h
··· 389 389 } 390 390 391 391 extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, 392 - struct sock *sk, 392 + struct sock *sk, u32 port_offset, 393 393 int (*check_established)(struct inet_timewait_death_row *, 394 394 struct sock *, __u16, struct inet_timewait_sock **), 395 395 void (*hash)(struct sock *sk));
+3 -3
net/ipv4/inet_hashtables.c
··· 398 398 EXPORT_SYMBOL_GPL(inet_unhash); 399 399 400 400 int __inet_hash_connect(struct inet_timewait_death_row *death_row, 401 - struct sock *sk, 401 + struct sock *sk, u32 port_offset, 402 402 int (*check_established)(struct inet_timewait_death_row *, 403 403 struct sock *, __u16, struct inet_timewait_sock **), 404 404 void (*hash)(struct sock *sk)) ··· 413 413 if (!snum) { 414 414 int i, remaining, low, high, port; 415 415 static u32 hint; 416 - u32 offset = hint + inet_sk_port_offset(sk); 416 + u32 offset = hint + port_offset; 417 417 struct hlist_node *node; 418 418 struct inet_timewait_sock *tw = NULL; 419 419 ··· 502 502 int inet_hash_connect(struct inet_timewait_death_row *death_row, 503 503 struct sock *sk) 504 504 { 505 - return __inet_hash_connect(death_row, sk, 505 + return __inet_hash_connect(death_row, sk, inet_sk_port_offset(sk), 506 506 __inet_check_established, __inet_hash_nolisten); 507 507 } 508 508
+1 -1
net/ipv6/inet6_hashtables.c
··· 236 236 int inet6_hash_connect(struct inet_timewait_death_row *death_row, 237 237 struct sock *sk) 238 238 { 239 - return __inet_hash_connect(death_row, sk, 239 + return __inet_hash_connect(death_row, sk, inet6_sk_port_offset(sk), 240 240 __inet6_check_established, __inet6_hash); 241 241 } 242 242