Changeset 31703


Ignore:
Timestamp:
Mar 19, 2017, 11:11:28 AM (10 days ago)
Author:
brainslayer
Message:

latest dnsmasq

Location:
src/router/dnsmasq
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/router/dnsmasq/bld/get-version

    r26809 r31703  
    1212# first. This favours, eg v2.63 over 2.63rc6.
    1313
     14# Change directory to the toplevel source directory.
     15if test -z "$1" || ! test -d "$1" || ! cd "$1"; then
     16    echo "$0: First argument $1 must be toplevel dir." >&2
     17    exit 1
     18fi
     19
    1420if which git >/dev/null 2>&1 && \
    15     ([ -d $1/.git ] || grep '^gitdir:' $1/.git >/dev/null 2>&1); then
    16     cd $1; git describe | sed 's/^v//'
     21    ([ -d .git ] || grep '^gitdir:' .git >/dev/null 2>&1) && \
     22    git describe >/dev/null 2>&1; then
     23    git describe | sed 's/^v//'
    1724elif grep '\$Format:%d\$' $1/VERSION >/dev/null 2>&1; then
    18 # unsubstituted VERSION, but no git available.
     25    # unsubstituted VERSION, but no git available.
    1926    echo UNKNOWN
    2027else
  • src/router/dnsmasq/man/dnsmasq.8

    r31543 r31703  
    204204given in
    205205.B \--except-interface
    206 options. IP alias interfaces (eg "eth1:0") cannot be used with
    207 .B --interface
     206options. On Linux, when
     207.B \--bind-interfaces
    208208or
    209 .B --except-interface
    210 options, use --listen-address instead. A simple wildcard, consisting
    211 of a trailing '*', can be used in
     209.B \--bind-dynamic
     210are in effect, IP alias interface labels (eg "eth1:0") are checked, rather than
     211interface names. In the degenerate case when an interface has one address, this amounts to the same thing but when an interface has multiple addresses it
     212allows control over which of those addresses are accepted.
     213The same effect is achievable in default mode by using
     214.B \--listen-address.
     215A simple wildcard, consisting of a trailing '*',
     216can be used in
    212217.B \--interface
    213218and
     
    223228options does not matter and that
    224229.B --except-interface
    225 options always override the others.
     230options always override the others. The comments about interface labels for
     231.B --listen-address
     232apply here.
    226233.TP
    227234.B --auth-server=<domain>,<interface>|<ip-address>
     
    962969
    963970It is allowed to use client identifiers (called client
    964 DUID in IPv6-land rather than
     971DUID in IPv6-land) rather than
    965972hardware addresses to identify hosts by prefixing with 'id:'. Thus:
    966973.B --dhcp-host=id:01:02:03:04,.....
  • src/router/dnsmasq/src/dbus.c

    r29632 r31703  
    550550                                         "Invalid IP address '%s'", ipaddr);
    551551   
    552   hw_len = parse_hex((char*)hwaddr, dhcp_chaddr, DHCP_CHADDR_MAX, NULL,
    553                      &hw_type);
     552  hw_len = parse_hex((char*)hwaddr, dhcp_chaddr, DHCP_CHADDR_MAX, NULL, &hw_type);
    554553  if (hw_type == 0 && hw_len != 0)
    555554    hw_type = ARPHRD_ETHER;
    556 
    557     lease_set_hwaddr(lease, dhcp_chaddr, clid, hw_len, hw_type,
     555 
     556  lease_set_hwaddr(lease, dhcp_chaddr, clid, hw_len, hw_type,
    558557                   clid_len, now, 0);
    559558  lease_set_expires(lease, expires, now);
    560559  if (hostname_len != 0)
    561560    lease_set_hostname(lease, hostname, 0, get_domain(lease->addr), NULL);
    562    
     561 
    563562  lease_update_file(now);
    564563  lease_update_dns(0);
  • src/router/dnsmasq/src/dnsmasq.c

    r31441 r31703  
    772772  if (option_bool(OPT_NOWILD))
    773773    warn_bound_listeners();
     774  else if (!option_bool(OPT_CLEVERBIND))
     775    warn_wild_labels();
    774776
    775777  warn_int_names();
  • src/router/dnsmasq/src/dnsmasq.h

    r31544 r31703  
    523523  union mysockaddr addr;
    524524  struct in_addr netmask; /* only valid for IPv4 */
    525   int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found;
     525  int tftp_ok, dhcp_ok, mtu, done, warned, dad, dns_auth, index, multicast_done, found, label;
    526526  char *name;
    527527  struct irec *next;
     
    12641264void create_bound_listeners(int die);
    12651265void warn_bound_listeners(void);
     1266void warn_wild_labels(void);
    12661267void warn_int_names(void);
    12671268int is_dad_listeners(void);
  • src/router/dnsmasq/src/forward.c

    r31543 r31703  
    898898                  else
    899899                    status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class,
    900                                                    option_bool(OPT_DNSSEC_NO_SIGN), NULL, NULL);
     900                                                   option_bool(OPT_DNSSEC_NO_SIGN) && (server->flags && SERV_DO_DNSSEC), NULL, NULL);
    901901                }
    902902             
     
    14771477        new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
    14781478      else
    1479         new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, option_bool(OPT_DNSSEC_NO_SIGN), NULL, NULL);
     1479        new_status = dnssec_validate_reply(now, header, n, name, keyname, &class,
     1480                                           option_bool(OPT_DNSSEC_NO_SIGN) && (server->flags && SERV_DO_DNSSEC), NULL, NULL);
    14801481     
    14811482      if (new_status != STAT_NEED_DS && new_status != STAT_NEED_KEY)
  • src/router/dnsmasq/src/network.c

    r31441 r31703  
    245245  int dhcp_ok = 1;
    246246  int auth_dns = 0;
     247  int is_label = 0;
    247248#if defined(HAVE_DHCP) || defined(HAVE_TFTP)
    248249  struct iname *tmp;
     
    265266  if (!label)
    266267    label = ifr.ifr_name;
     268  else
     269    is_label = strcmp(label, ifr.ifr_name);
    267270 
    268271  /* maintain a list of all addresses on all interfaces for --local-service option */
     
    483486      iface->done = iface->multicast_done = iface->warned = 0;
    484487      iface->index = if_index;
     488      iface->label = is_label;
    485489      if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
    486490        {
     
    10331037  if (advice)
    10341038    my_syslog(LOG_WARNING, _("LOUD WARNING: use --bind-dynamic rather than --bind-interfaces to avoid DNS amplification attacks via these interface(s)"));
     1039}
     1040
     1041void warn_wild_labels(void)
     1042{
     1043  struct irec *iface;
     1044
     1045  for (iface = daemon->interfaces; iface; iface = iface->next)
     1046    if (iface->found && iface->name && iface->label)
     1047      my_syslog(LOG_WARNING, _("warning: using interface %s instead"), iface->name);
    10351048}
    10361049
  • src/router/dnsmasq/src/option.c

    r31441 r31703  
    851851{
    852852  struct server *serv = opt_malloc(sizeof(struct server));
    853   in_addr_t  a = ntohl(addr.s_addr) >> 8;
     853  in_addr_t  a = ntohl(addr.s_addr);
    854854  char *p;
    855855
    856856  memset(serv, 0, sizeof(struct server));
    857   p = serv->domain = opt_malloc(25); /* strlen("xxx.yyy.zzz.in-addr.arpa")+1 */
    858  
    859   if (msize == 24)
    860     p += sprintf(p, "%d.", a & 0xff);
    861   a = a >> 8;
    862   if (msize != 8)
    863     p += sprintf(p, "%d.", a & 0xff);
    864   a = a >> 8;
    865   p += sprintf(p, "%d.in-addr.arpa", a & 0xff);
     857  p = serv->domain = opt_malloc(29); /* strlen("xxx.yyy.zzz.ttt.in-addr.arpa")+1 */
     858
     859  switch (msize)
     860    {
     861    case 32:
     862      p += sprintf(p, "%d.", a & 0xff);
     863      /* fall through */
     864    case 24:
     865      p += sprintf(p, "%d.", (a >> 8) & 0xff);
     866      /* fall through */
     867    case 16:
     868      p += sprintf(p, "%d.", (a >> 16) & 0xff);
     869      /* fall through */
     870    case 8:
     871      p += sprintf(p, "%d.", (a >> 24) & 0xff);
     872      break;
     873    default:
     874      return NULL;
     875    }
     876
     877  p += sprintf(p, "in-addr.arpa");
    866878 
    867879  serv->flags = SERV_HAS_DOMAIN;
     
    20682080                                      local=/xxx.yyy.zzz.in-addr.arpa/ */
    20692081                                  struct server *serv = add_rev4(new->start, msize);
     2082                                  if (!serv)
     2083                                    ret_err(_("bad prefix"));
     2084
    20702085                                  serv->flags |= SERV_NO_ADDR;
    20712086
     
    24392454
    24402455        if (inet_pton(AF_INET, arg, &addr4))
    2441           serv = add_rev4(addr4, size);
     2456          {
     2457            serv = add_rev4(addr4, size);
     2458            if (!serv)
     2459              ret_err(_("bad prefix"));
     2460          }
    24422461#ifdef HAVE_IPV6
    24432462        else if (inet_pton(AF_INET6, arg, &addr6))
     
    40904109      int white, i;
    40914110      volatile int option = (hard_opt == LOPT_REV_SERV) ? 0 : hard_opt;
    4092       char *errmess, *p, *arg = NULL, *start;
     4111      char *errmess, *p, *arg, *start;
    40934112      size_t len;
    40944113
     
    41014120        }
    41024121     
     4122      arg = NULL;
    41034123      lineno++;
    41044124      errmess = NULL;
Note: See TracChangeset for help on using the changeset viewer.