diff options
author | Denys Vlasenko | 2022-12-15 13:34:52 +0100 |
---|---|---|
committer | Denys Vlasenko | 2022-12-15 13:34:52 +0100 |
commit | 6c2ddf808ed70bf515daf4d073411d86ec043550 (patch) | |
tree | f732c157b3e2b0f37d6460acabf41f14d17fd4d5 /networking/udhcp | |
parent | 242d0562307549af61b234bff545ca13474a2603 (diff) | |
download | busybox-6c2ddf808ed70bf515daf4d073411d86ec043550.zip busybox-6c2ddf808ed70bf515daf4d073411d86ec043550.tar.gz |
udhcp: add a few comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/d6_packet.c | 10 | ||||
-rw-r--r-- | networking/udhcp/packet.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/networking/udhcp/d6_packet.c b/networking/udhcp/d6_packet.c index aab1a91..142de9b 100644 --- a/networking/udhcp/d6_packet.c +++ b/networking/udhcp/d6_packet.c @@ -80,12 +80,22 @@ int FAST_FUNC d6_send_raw_packet_from_client_data_ifindex( dest_sll.sll_halen = 6; memcpy(dest_sll.sll_addr, dest_arp, 6); +//TODO: is bind() necessary? we sendto() to this destination, should work anyway if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) { msg = "bind(%s)"; goto ret_close; } packet.ip6.ip6_vfc = (6 << 4); /* 4 bits version, top 4 bits of tclass */ +// In case we have no IPv6 on our interface at all, we can try +// to fill "all hosts" mcast address as source: +// /* FF02::1 is Link-local "All_Nodes" address */ +// packet.ip6.ip6_dst.s6_addr[0] = 0xff; +// packet.ip6.ip6_dst.s6_addr[1] = 0x02; +// packet.ip6.ip6_dst.s6_addr[15] = 0x01; +// Maybe some servers will be able to respond to us this way? +// Users report that leaving ::0 address there makes servers try to reply to ::0, +// which doesn't work. if (src_ipv6) packet.ip6.ip6_src = *src_ipv6; /* struct copy */ packet.ip6.ip6_dst = *dst_ipv6; /* struct copy */ diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index 78f580c..5299781 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c @@ -133,6 +133,7 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, dest_sll.sll_halen = 6; memcpy(dest_sll.sll_addr, dest_arp, 6); +//TODO: is bind() necessary? we sendto() to this destination, should work anyway if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) { msg = "bind(%s)"; goto ret_close; |