Browse Source

[dhcpv6] Do not set sin6_scope_id on the unspecified client socket address

Setting sin6_scope_id to a non-zero value will cause the check against
the "empty socket address" in udp_demux() to fail, and incoming DHCPv6
responses on interfaces other than net0 will be rejected with a
spurious "No UDP connection listening on port 546" error.

The transmitting network device is specified via the destination
address, not the source address.  Fix by simply not setting
sin6_scope_id on the client socket address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Tested-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
6206f8f0f9
1 changed files with 0 additions and 1 deletions
  1. 0
    1
      src/net/udp/dhcpv6.c

+ 0
- 1
src/net/udp/dhcpv6.c View File

924
 	/* Construct client and server addresses */
924
 	/* Construct client and server addresses */
925
 	memset ( &addresses, 0, sizeof ( addresses ) );
925
 	memset ( &addresses, 0, sizeof ( addresses ) );
926
 	addresses.client.sin6.sin6_family = AF_INET6;
926
 	addresses.client.sin6.sin6_family = AF_INET6;
927
-	addresses.client.sin6.sin6_scope_id = netdev->index;
928
 	addresses.client.sin6.sin6_port = htons ( DHCPV6_CLIENT_PORT );
927
 	addresses.client.sin6.sin6_port = htons ( DHCPV6_CLIENT_PORT );
929
 	addresses.server.sin6.sin6_family = AF_INET6;
928
 	addresses.server.sin6.sin6_family = AF_INET6;
930
 	ipv6_all_dhcp_relay_and_servers ( &addresses.server.sin6.sin6_addr );
929
 	ipv6_all_dhcp_relay_and_servers ( &addresses.server.sin6.sin6_addr );

Loading…
Cancel
Save