mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-31 13:10:35 +00:00
Add the ability to specify destination port in DHCP-relay mode.
This change also removes a previous bug where --dhcp-alternate-port would affect the port used to relay _to_ as well as the port being listened on. The new feature allows configuration to provide bug-for-bug compatibility, if required. Thanks to Damian Kaczkowski for the feature suggestion.
This commit is contained in:
7 files changed
+36
-7
No files matched your search
@@ -4333,6 +4333,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
||||
{
|
||||
if (inet_pton(AF_INET, arg, &new->local))
|
||||
{
|
||||
char *hash = split_chr(two, '#');
|
||||
|
||||
if (!hash || !atoi_check16(hash, &new->port))
|
||||
new->port = DHCP_SERVER_PORT;
|
||||
|
||||
if (!inet_pton(AF_INET, two, &new->server))
|
||||
{
|
||||
new->server.addr4.s_addr = 0;
|
||||
@@ -4351,6 +4356,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
|
||||
#ifdef HAVE_DHCP6
|
||||
else if (inet_pton(AF_INET6, arg, &new->local))
|
||||
{
|
||||
char *hash = split_chr(two, '#');
|
||||
|
||||
if (!hash || !atoi_check16(hash, &new->port))
|
||||
new->port = DHCPV6_SERVER_PORT;
|
||||
|
||||
if (!inet_pton(AF_INET6, two, &new->server))
|
||||
{
|
||||
inet_pton(AF_INET6, ALL_SERVERS, &new->server.addr6);
|
||||
|
||||
Reference in new issue
Block a user