diff options
| author | David S. Miller <davem@davemloft.net> | 2023-09-13 07:18:05 +0100 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2023-09-13 07:18:05 +0100 |
| commit | ab6c4ec8742a653b1ba06215d9bccb31c4d87d0f (patch) | |
| tree | 5451d725ed8ae06ca21ae072650a90f29cd503b6 /include | |
| parent | 8cdd9f1aaedf823006449faa4e540026c692ac43 (diff) | |
| parent | 8637d8e8b653f4c8b6fd277b434b118f844d1d77 (diff) | |
Merge branch 'tcp-bind-fixes'
Kuniyuki Iwashima says:
====================
tcp: Fix bind() regression for v4-mapped-v6 address
Since bhash2 was introduced, bind() is broken in two cases related
to v4-mapped-v6 address.
This series fixes the regression and adds test to cover the cases.
Changes:
v2:
* Added patch 1 to factorise duplicated comparison (Eric Dumazet)
v1: https://lore.kernel.org/netdev/20230911165106.39384-1-kuniyu@amazon.com/
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/ipv6.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index fe274c122a56..c6932d1a3fa8 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -784,6 +784,11 @@ static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) cpu_to_be32(0x0000ffff))) == 0UL; } +static inline bool ipv6_addr_v4mapped_any(const struct in6_addr *a) +{ + return ipv6_addr_v4mapped(a) && ipv4_is_zeronet(a->s6_addr32[3]); +} + static inline bool ipv6_addr_v4mapped_loopback(const struct in6_addr *a) { return ipv6_addr_v4mapped(a) && ipv4_is_loopback(a->s6_addr32[3]); |
