"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/option.c" between
dnsmasq-2.82.tar.xz and dnsmasq-2.83.tar.xz

About: Dnsmasq is a lightweight caching DNS forwarder and DHCP server.

option.c  (dnsmasq-2.82.tar.xz):option.c  (dnsmasq-2.83.tar.xz)
skipping to change at line 170 skipping to change at line 170
#define LOPT_RAPID_COMMIT 351 #define LOPT_RAPID_COMMIT 351
#define LOPT_DUMPFILE 352 #define LOPT_DUMPFILE 352
#define LOPT_DUMPMASK 353 #define LOPT_DUMPMASK 353
#define LOPT_UBUS 354 #define LOPT_UBUS 354
#define LOPT_NAME_MATCH 355 #define LOPT_NAME_MATCH 355
#define LOPT_CAA 356 #define LOPT_CAA 356
#define LOPT_SHARED_NET 357 #define LOPT_SHARED_NET 357
#define LOPT_IGNORE_CLID 358 #define LOPT_IGNORE_CLID 358
#define LOPT_SINGLE_PORT 359 #define LOPT_SINGLE_PORT 359
#define LOPT_SCRIPT_TIME 360 #define LOPT_SCRIPT_TIME 360
#define LOPT_PXE_VENDOR 361
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
static const struct option opts[] = static const struct option opts[] =
#else #else
static const struct myoption opts[] = static const struct myoption opts[] =
#endif #endif
{ {
{ "version", 0, 0, 'v' }, { "version", 0, 0, 'v' },
{ "no-hosts", 0, 0, 'h' }, { "no-hosts", 0, 0, 'h' },
{ "no-poll", 0, 0, 'n' }, { "no-poll", 0, 0, 'n' },
skipping to change at line 273 skipping to change at line 274
{ "naptr-record", 1, 0, LOPT_NAPTR }, { "naptr-record", 1, 0, LOPT_NAPTR },
{ "bridge-interface", 1, 0 , LOPT_BRIDGE }, { "bridge-interface", 1, 0 , LOPT_BRIDGE },
{ "shared-network", 1, 0, LOPT_SHARED_NET }, { "shared-network", 1, 0, LOPT_SHARED_NET },
{ "dhcp-option-force", 1, 0, LOPT_FORCE }, { "dhcp-option-force", 1, 0, LOPT_FORCE },
{ "tftp-no-blocksize", 0, 0, LOPT_NOBLOCK }, { "tftp-no-blocksize", 0, 0, LOPT_NOBLOCK },
{ "log-dhcp", 0, 0, LOPT_LOG_OPTS }, { "log-dhcp", 0, 0, LOPT_LOG_OPTS },
{ "log-async", 2, 0, LOPT_MAX_LOGS }, { "log-async", 2, 0, LOPT_MAX_LOGS },
{ "dhcp-circuitid", 1, 0, LOPT_CIRCUIT }, { "dhcp-circuitid", 1, 0, LOPT_CIRCUIT },
{ "dhcp-remoteid", 1, 0, LOPT_REMOTE }, { "dhcp-remoteid", 1, 0, LOPT_REMOTE },
{ "dhcp-subscrid", 1, 0, LOPT_SUBSCR }, { "dhcp-subscrid", 1, 0, LOPT_SUBSCR },
{ "dhcp-pxe-vendor", 1, 0, LOPT_PXE_VENDOR },
{ "interface-name", 1, 0, LOPT_INTNAME }, { "interface-name", 1, 0, LOPT_INTNAME },
{ "dhcp-hostsfile", 1, 0, LOPT_DHCP_HOST }, { "dhcp-hostsfile", 1, 0, LOPT_DHCP_HOST },
{ "dhcp-optsfile", 1, 0, LOPT_DHCP_OPTS }, { "dhcp-optsfile", 1, 0, LOPT_DHCP_OPTS },
{ "dhcp-hostsdir", 1, 0, LOPT_DHCP_INOTIFY }, { "dhcp-hostsdir", 1, 0, LOPT_DHCP_INOTIFY },
{ "dhcp-optsdir", 1, 0, LOPT_DHOPT_INOTIFY }, { "dhcp-optsdir", 1, 0, LOPT_DHOPT_INOTIFY },
{ "dhcp-no-override", 0, 0, LOPT_OVERRIDE }, { "dhcp-no-override", 0, 0, LOPT_OVERRIDE },
{ "tftp-port-range", 1, 0, LOPT_TFTPPORTS }, { "tftp-port-range", 1, 0, LOPT_TFTPPORTS },
{ "stop-dns-rebind", 0, 0, LOPT_REBIND }, { "stop-dns-rebind", 0, 0, LOPT_REBIND },
{ "rebind-domain-ok", 1, 0, LOPT_NO_REBIND }, { "rebind-domain-ok", 1, 0, LOPT_NO_REBIND },
{ "all-servers", 0, 0, LOPT_NOLAST }, { "all-servers", 0, 0, LOPT_NOLAST },
skipping to change at line 385 skipping to change at line 387
{ LOPT_TAG_IF, ARG_DUP, "tag-expression", gettext_noop("Evaluate conditional t ag expression."), NULL }, { LOPT_TAG_IF, ARG_DUP, "tag-expression", gettext_noop("Evaluate conditional t ag expression."), NULL },
{ 'h', OPT_NO_HOSTS, NULL, gettext_noop("Do NOT load %s file."), HOSTSFILE }, { 'h', OPT_NO_HOSTS, NULL, gettext_noop("Do NOT load %s file."), HOSTSFILE },
{ 'H', ARG_DUP, "<path>", gettext_noop("Specify a hosts file to be read in add ition to %s."), HOSTSFILE }, { 'H', ARG_DUP, "<path>", gettext_noop("Specify a hosts file to be read in add ition to %s."), HOSTSFILE },
{ LOPT_HOST_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read hosts files from a directory."), NULL }, { LOPT_HOST_INOTIFY, ARG_DUP, "<path>", gettext_noop("Read hosts files from a directory."), NULL },
{ 'i', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) to listen on ."), NULL }, { 'i', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) to listen on ."), NULL },
{ 'I', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) NOT to liste n on.") , NULL }, { 'I', ARG_DUP, "<interface>", gettext_noop("Specify interface(s) NOT to liste n on.") , NULL },
{ 'j', ARG_DUP, "set:<tag>,<class>", gettext_noop("Map DHCP user class to tag. "), NULL }, { 'j', ARG_DUP, "set:<tag>,<class>", gettext_noop("Map DHCP user class to tag. "), NULL },
{ LOPT_CIRCUIT, ARG_DUP, "set:<tag>,<circuit>", gettext_noop("Map RFC3046 circ uit-id to tag."), NULL }, { LOPT_CIRCUIT, ARG_DUP, "set:<tag>,<circuit>", gettext_noop("Map RFC3046 circ uit-id to tag."), NULL },
{ LOPT_REMOTE, ARG_DUP, "set:<tag>,<remote>", gettext_noop("Map RFC3046 remote -id to tag."), NULL }, { LOPT_REMOTE, ARG_DUP, "set:<tag>,<remote>", gettext_noop("Map RFC3046 remote -id to tag."), NULL },
{ LOPT_SUBSCR, ARG_DUP, "set:<tag>,<remote>", gettext_noop("Map RFC3993 subscr iber-id to tag."), NULL }, { LOPT_SUBSCR, ARG_DUP, "set:<tag>,<remote>", gettext_noop("Map RFC3993 subscr iber-id to tag."), NULL },
{ LOPT_PXE_VENDOR, ARG_DUP, "<vendor>[,...]", gettext_noop("Specify vendor cla ss to match for PXE requests."), NULL },
{ 'J', ARG_DUP, "tag:<tag>...", gettext_noop("Don't do DHCP for hosts with tag set."), NULL }, { 'J', ARG_DUP, "tag:<tag>...", gettext_noop("Don't do DHCP for hosts with tag set."), NULL },
{ LOPT_BROADCAST, ARG_DUP, "[=tag:<tag>...]", gettext_noop("Force broadcast re plies for hosts with tag set."), NULL }, { LOPT_BROADCAST, ARG_DUP, "[=tag:<tag>...]", gettext_noop("Force broadcast re plies for hosts with tag set."), NULL },
{ 'k', OPT_NO_FORK, NULL, gettext_noop("Do NOT fork into the background, do NO T run in debug mode."), NULL }, { 'k', OPT_NO_FORK, NULL, gettext_noop("Do NOT fork into the background, do NO T run in debug mode."), NULL },
{ 'K', OPT_AUTHORITATIVE, NULL, gettext_noop("Assume we are the only DHCP serv er on the local network."), NULL }, { 'K', OPT_AUTHORITATIVE, NULL, gettext_noop("Assume we are the only DHCP serv er on the local network."), NULL },
{ 'l', ARG_ONE, "<path>", gettext_noop("Specify where to store DHCP leases (de faults to %s)."), LEASEFILE }, { 'l', ARG_ONE, "<path>", gettext_noop("Specify where to store DHCP leases (de faults to %s)."), LEASEFILE },
{ 'L', OPT_LOCALMX, NULL, gettext_noop("Return MX records for local hosts."), NULL }, { 'L', OPT_LOCALMX, NULL, gettext_noop("Return MX records for local hosts."), NULL },
{ 'm', ARG_DUP, "<host_name>,<target>,<pref>", gettext_noop("Specify an MX rec ord."), NULL }, { 'm', ARG_DUP, "<host_name>,<target>,<pref>", gettext_noop("Specify an MX rec ord."), NULL },
{ 'M', ARG_DUP, "<bootp opts>", gettext_noop("Specify BOOTP options to DHCP se rver."), NULL }, { 'M', ARG_DUP, "<bootp opts>", gettext_noop("Specify BOOTP options to DHCP se rver."), NULL },
{ 'n', OPT_NO_POLL, NULL, gettext_noop("Do NOT poll %s file, reload only on SI GHUP."), RESOLVFILE }, { 'n', OPT_NO_POLL, NULL, gettext_noop("Do NOT poll %s file, reload only on SI GHUP."), RESOLVFILE },
{ 'N', OPT_NO_NEG, NULL, gettext_noop("Do NOT cache failed search results."), NULL }, { 'N', OPT_NO_NEG, NULL, gettext_noop("Do NOT cache failed search results."), NULL },
skipping to change at line 3670 skipping to change at line 3673
ret_err(gen_err); ret_err(gen_err);
} }
else else
{ {
comma = split(arg); comma = split(arg);
unhide_metas(arg); unhide_metas(arg);
new->len = strlen(arg) + 1; new->len = strlen(arg) + 1;
new->val = opt_malloc(new->len); new->val = opt_malloc(new->len);
memcpy(new->val + 1, arg, new->len - 1); memcpy(new->val + 1, arg, new->len - 1);
new->u.vendor_class = (unsigned char *)"PXEClient"; new->u.vendor_class = NULL;
new->flags = DHOPT_VENDOR; new->flags = DHOPT_VENDOR | DHOPT_VENDOR_PXE;
if (comma && atoi_check(comma, &timeout)) if (comma && atoi_check(comma, &timeout))
*(new->val) = timeout; *(new->val) = timeout;
else else
*(new->val) = 255; *(new->val) = 255;
new->next = daemon->dhcp_opts; new->next = daemon->dhcp_opts;
daemon->dhcp_opts = new; daemon->dhcp_opts = new;
daemon->enable_pxe = 1; daemon->enable_pxe = 1;
} }
skipping to change at line 3933 skipping to change at line 3936
case LOPT_PROXY: /* --dhcp-proxy */ case LOPT_PROXY: /* --dhcp-proxy */
daemon->override = 1; daemon->override = 1;
while (arg) { while (arg) {
struct addr_list *new = opt_malloc(sizeof(struct addr_list)); struct addr_list *new = opt_malloc(sizeof(struct addr_list));
comma = split(arg); comma = split(arg);
if (!(inet_pton(AF_INET, arg, &new->addr) > 0)) if (!(inet_pton(AF_INET, arg, &new->addr) > 0))
ret_err_free(_("bad dhcp-proxy address"), new); ret_err_free(_("bad dhcp-proxy address"), new);
new->next = daemon->override_relays; new->next = daemon->override_relays;
daemon->override_relays = new; daemon->override_relays = new;
arg = comma; arg = comma;
}
break;
case LOPT_PXE_VENDOR: /* --dhcp-pxe-vendor */
{
while (arg) {
struct dhcp_pxe_vendor *new = opt_malloc(sizeof(struct dhcp_pxe_vendor)
);
comma = split(arg);
new->data = opt_string_alloc(arg);
new->next = daemon->dhcp_pxe_vendors;
daemon->dhcp_pxe_vendors = new;
arg = comma;
}
} }
break; break;
case LOPT_RELAY: /* --dhcp-relay */ case LOPT_RELAY: /* --dhcp-relay */
{ {
struct dhcp_relay *new = opt_malloc(sizeof(struct dhcp_relay)); struct dhcp_relay *new = opt_malloc(sizeof(struct dhcp_relay));
comma = split(arg); comma = split(arg);
new->interface = opt_string_alloc(split(comma)); new->interface = opt_string_alloc(split(comma));
new->iface_index = 0; new->iface_index = 0;
if (inet_pton(AF_INET, arg, &new->local) && inet_pton(AF_INET, comma, &ne w->server)) if (inet_pton(AF_INET, arg, &new->local) && inet_pton(AF_INET, comma, &ne w->server))
skipping to change at line 5208 skipping to change at line 5224
} }
/* create default, if not specified */ /* create default, if not specified */
if (daemon->authserver && !daemon->hostmaster) if (daemon->authserver && !daemon->hostmaster)
{ {
strcpy(buff, "hostmaster."); strcpy(buff, "hostmaster.");
strcat(buff, daemon->authserver); strcat(buff, daemon->authserver);
daemon->hostmaster = opt_string_alloc(buff); daemon->hostmaster = opt_string_alloc(buff);
} }
if (!daemon->dhcp_pxe_vendors)
{
daemon->dhcp_pxe_vendors = opt_malloc(sizeof(struct dhcp_pxe_vendor));
daemon->dhcp_pxe_vendors->data = opt_string_alloc(DHCP_PXE_DEF_VENDOR);
daemon->dhcp_pxe_vendors->next = NULL;
}
/* only one of these need be specified: the other defaults to the host-name */ /* only one of these need be specified: the other defaults to the host-name */
if (option_bool(OPT_LOCALMX) || daemon->mxnames || daemon->mxtarget) if (option_bool(OPT_LOCALMX) || daemon->mxnames || daemon->mxtarget)
{ {
struct mx_srv_record *mx; struct mx_srv_record *mx;
if (gethostname(buff, MAXDNAME) == -1) if (gethostname(buff, MAXDNAME) == -1)
die(_("cannot get host-name: %s"), NULL, EC_MISC); die(_("cannot get host-name: %s"), NULL, EC_MISC);
for (mx = daemon->mxnames; mx; mx = mx->next) for (mx = daemon->mxnames; mx; mx = mx->next)
if (!mx->issrv && hostname_isequal(mx->name, buff)) if (!mx->issrv && hostname_isequal(mx->name, buff))
 End of changes. 6 change blocks. 
2 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)