Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Nov 7, 2024

Allow user to specify a network interface in the DNS server list. User can append "%" and network interface name to the DNS server to use this. If the network interface is mentioned in the server list, then the DNS queries are sent via this network interface.
For example setting the interfaces like this:

192.0.2.2%eth1
[2001:db8::2]:5353%ppp0

would cause the DNS queries to sent to 192.0.2.1 via eth1 in the first example, and to 2001:db8::2 via ppp0 in the second example.

If trying to parse a string like 192.0.2.2:80/foobar and
setting the length to 12 which means to parse the IP address
and port, the parsing failed because it used one extra character
from the string. This issue was not present if the input string
was terminated after the port number.

Add a test case to catch this problem.

Signed-off-by: Jukka Rissanen <[email protected]>
Allow user to specify a network interface in the DNS server
list. User can append "%" and network interface name to the
DNS server to use this. If the network interface is mentioned
in the server list, then the DNS queries are sent via this network
interface.
For example setting the interfaces like this:
   192.0.2.2%eth1
   [2001:db8::2]:5353%ppp0

would cause the DNS queries to sent to 192.0.2.1 via eth1 in the first
example, and to 2001:db8::2 via ppp0 in the second example.

Signed-off-by: Jukka Rissanen <[email protected]>
If network interface is specified in the DNS server, then send
the queries to the server via the network interface. Print this
information in the server list.

Signed-off-by: Jukka Rissanen <[email protected]>
In this sample, VLAN has longer interface name so increase it to max.

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar jukkar force-pushed the devel/dns-server-via-iface branch from 0c77d50 to 1de55ee Compare November 8, 2024 08:27
@zephyrbot zephyrbot added the area: Samples Samples label Nov 8, 2024
@zephyrbot zephyrbot requested review from kartben and nashif November 8, 2024 08:28
@nashif nashif merged commit 2188387 into zephyrproject-rtos:main Nov 16, 2024
26 checks passed
@jukkar jukkar deleted the devel/dns-server-via-iface branch November 17, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants