aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-12-15 13:34:52 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2022-12-15 13:34:52 +0100
commit6c2ddf808ed70bf515daf4d073411d86ec043550 (patch)
treef732c157b3e2b0f37d6460acabf41f14d17fd4d5 /networking
parent242d0562307549af61b234bff545ca13474a2603 (diff)
downloadbusybox-w32-6c2ddf808ed70bf515daf4d073411d86ec043550.tar.gz
busybox-w32-6c2ddf808ed70bf515daf4d073411d86ec043550.tar.bz2
busybox-w32-6c2ddf808ed70bf515daf4d073411d86ec043550.zip
udhcp: add a few comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/d6_packet.c10
-rw-r--r--networking/udhcp/packet.c1
2 files changed, 11 insertions, 0 deletions
diff --git a/networking/udhcp/d6_packet.c b/networking/udhcp/d6_packet.c
index aab1a9182..142de9b43 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(
80 dest_sll.sll_halen = 6; 80 dest_sll.sll_halen = 6;
81 memcpy(dest_sll.sll_addr, dest_arp, 6); 81 memcpy(dest_sll.sll_addr, dest_arp, 6);
82 82
83//TODO: is bind() necessary? we sendto() to this destination, should work anyway
83 if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) { 84 if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) {
84 msg = "bind(%s)"; 85 msg = "bind(%s)";
85 goto ret_close; 86 goto ret_close;
86 } 87 }
87 88
88 packet.ip6.ip6_vfc = (6 << 4); /* 4 bits version, top 4 bits of tclass */ 89 packet.ip6.ip6_vfc = (6 << 4); /* 4 bits version, top 4 bits of tclass */
90// In case we have no IPv6 on our interface at all, we can try
91// to fill "all hosts" mcast address as source:
92// /* FF02::1 is Link-local "All_Nodes" address */
93// packet.ip6.ip6_dst.s6_addr[0] = 0xff;
94// packet.ip6.ip6_dst.s6_addr[1] = 0x02;
95// packet.ip6.ip6_dst.s6_addr[15] = 0x01;
96// Maybe some servers will be able to respond to us this way?
97// Users report that leaving ::0 address there makes servers try to reply to ::0,
98// which doesn't work.
89 if (src_ipv6) 99 if (src_ipv6)
90 packet.ip6.ip6_src = *src_ipv6; /* struct copy */ 100 packet.ip6.ip6_src = *src_ipv6; /* struct copy */
91 packet.ip6.ip6_dst = *dst_ipv6; /* struct copy */ 101 packet.ip6.ip6_dst = *dst_ipv6; /* struct copy */
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 78f580ce9..529978189 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,
133 dest_sll.sll_halen = 6; 133 dest_sll.sll_halen = 6;
134 memcpy(dest_sll.sll_addr, dest_arp, 6); 134 memcpy(dest_sll.sll_addr, dest_arp, 6);
135 135
136//TODO: is bind() necessary? we sendto() to this destination, should work anyway
136 if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) { 137 if (bind(fd, (struct sockaddr *)&dest_sll, sizeof(dest_sll)) < 0) {
137 msg = "bind(%s)"; 138 msg = "bind(%s)";
138 goto ret_close; 139 goto ret_close;