Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Next Server IP data in case of JSON format #41

Open
vitalii-kondratiuk opened this issue Sep 25, 2024 · 1 comment
Open

Incorrect Next Server IP data in case of JSON format #41

vitalii-kondratiuk opened this issue Sep 25, 2024 · 1 comment

Comments

@vitalii-kondratiuk
Copy link

vitalii-kondratiuk commented Sep 25, 2024

The Next Server IP address in OFFER & ACK is displayed correctly only for the basic output format, in the case of using -j json option it refers to incorrect data.


Basic output mode, CORRECT:
image
JSON output mode, INCORRECT:
image

Here is the tcpdump capture:
image

@vitalii-kondratiuk
Copy link
Author

vitalii-kondratiuk commented Sep 25, 2024

The possible solution in DHCP_MSGOFFER

			fprintf(stdout, "{\"msg\":\"DHCP offer details\","
				"\"result\":\"info\","
				"\"result-type\":\"offer\","
				"\"result-ip\":\"%s\",",
				get_ip_str(dhcph_g->dhcp_yip));
			fprintf(stdout, "\"result-next-srv\":\"%s\"",
				get_ip_str(dhcph_g->dhcp_sip));

For the DHCP_MSGACK

                        fprintf(stdout, "{\"msg\":\"DHCP ack details\","
				                "\"result\":\"info\","
				                "\"result-type\":\"offer\","
				                "\"result-ip\":\"%s\",",
				                get_ip_str(dhcph_g->dhcp_yip));
			            fprintf(stdout, "\"result-next-srv\":\"%s\"",
				                get_ip_str(dhcph_g->dhcp_sip));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant