Skip to content

Commit

Permalink
Start dnsmasq process for non-Android platforms
Browse files Browse the repository at this point in the history
In some targets, dnsmasq start failed due to default port already in use
by systemd-resolved. Fix this by starting dnsmaq on a different port and
also remove the absolute path of the executable.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
  • Loading branch information
Shivani Baranwal authored and Jouni Malinen committed Dec 17, 2024
1 parent 343f9e0 commit a8ba832
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,16 @@ void start_dhcp(struct sigma_dut *dut, const char *group_ifname, int go)
snprintf(buf, sizeof(buf), "ifconfig %s %s", group_ifname,
GO_IP_ADDR);
run_system(dut, buf);
#ifdef ANDROID
snprintf(buf, sizeof(buf),
"/system/bin/dnsmasq -x /data/dnsmasq.pid --no-resolv --no-poll --dhcp-range=%s,%s,1h",
START_IP_RANGE, END_IP_RANGE);
#else /* ANDROID */
run_system(dut, "killall dnsmasq");
snprintf(buf, sizeof(buf),
"dnsmasq --no-resolv --no-poll --port=5353 --dhcp-range=%s,%s,1h",
START_IP_RANGE, END_IP_RANGE);
#endif /* ANDROID */
} else {
#ifdef ANDROID
if (access("/system/bin/dhcpcd", F_OK) != -1) {
Expand Down

0 comments on commit a8ba832

Please sign in to comment.