dhcrelay doesn't set remote_port with `-p` option
name: dhcrelay doesn't set remote_port with `-p` option
about:
Describe the bug
Run a dhclient, dhcrelay, and dhcpd server using non standard ports. dhcrelay doesn't set the port on replies to the client.
To Reproduce
Make sure target2->target1 is on a different subnet from target3->target1 so it doesn't get the reply from target3:
- Target1, running
dhcrelay -d -p 60 172.16.129.103
- Target2, running
dhclient vmx1 -d -p 61
- Target3, running
dhcpd -d -p 60 vmx0
Expected behavior dhcrelay relays the reply to dhclient on port 61, but the port on the outgoing BOOTREPLY is 0.
Environment:
Additional Information suggested diff
if (!local_port) {
...
} else {
remote_port = htons(ntohs(local_port) + 1);
}