Compare commits

...
11 Commits
Author SHA1 Message Date
Simon Kelley 9de1aa9b7f Fix parsing of IAID>MAXINT in leases file.
Thanks to Christof Meerwald for the bug report.
2013-04-10 11:17:12 +01:00
Simon Kelley 6f9aaa93e9 ->hwaddr_len must be zero always in DHCPv6 leases. 2013-04-10 10:25:26 +01:00
Simon Kelley 7e5664bdbc Fix trivial access of un-initialised memory.
Thanks to sven falpin for finding this.
2013-04-09 22:28:04 +01:00
Simon Kelley 83f28bef6c Manpage typos. 2013-04-03 14:46:46 +01:00
Simon Kelley 96c727fda6 Cope with duplicate dhcp-options with tags (last one wins). 2013-04-02 21:35:41 +01:00
Simon Kelley 49dc570a72 Manpage typo. 2013-04-02 20:27:07 +01:00
Simon Kelley cd1e04a234 Polish translation. 2013-04-02 20:11:48 +01:00
Simon Kelley 27cb314e54 Fix endless loop when dhcp-range goes away. 2013-04-02 20:06:39 +01:00
Simon Kelley 56a1142f03 SO_REUSEPORT may be defined, but not supported. 2013-04-02 17:02:58 +01:00
Simon Kelley 5b37aa8c19 Trivial change: 0->NULL for pointer constant. 2013-04-02 16:32:25 +01:00
Simon Kelley 8ac9787350 Fix lease time calculation when using DHCPv6 relay. 2013-03-30 21:34:19 +00:00
11 changed files with 132 additions and 106 deletions

No files matched your search

+7
View File
@@ -52,6 +52,13 @@ version 2.66
Allow a trailing '*' wildcard in all interface-name
configurations. Thanks to Christian Parpart for the patch.
Handle the situation where libc headers define
SO_REUSEPORT, but the kernel in use doesn't, to cope with
the introduction of this option to Linux. Thanks to Rich
Felker for the bug report.
Update Polish translation. Thanks to Jan Psota.
version 2.65
Fix regression which broke forwarding of queries sent via
+3 -3
View File
@@ -587,9 +587,9 @@ compiled in and the kernel must have conntrack support
included and configured. This option cannot be combined with
--query-port.
.TP
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-addr>[,<end-addr>][,<mode>][,<netmask>[,<broadcast>]][,<lease time>]
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>][,<mode>][,<netmask>[,<broadcast>]][,<lease time>]
.TP
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-IPv6addr>[,<end-IPv6addr>|constuctor:<interface>][,<mode>][,<prefix-len>][,<lease time>]
.B \-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-IPv6addr>[,<end-IPv6addr>|constructor:<interface>][,<mode>][,<prefix-len>][,<lease time>]
Enable the DHCP server. Addresses will be given out from the range
<start-addr> to <end-addr> and from statically defined addresses given
@@ -625,7 +625,7 @@ IPv6 (only) supports another type of range. In this, the start address and optio
.B constructor:<interface>.
This forms a template which describes how to create ranges, based on the addresses assigned to the interface. For instance
.B --dhcp-range=::1,::4,constructor:eth0
.B --dhcp-range=::1,::400,constructor:eth0
will look for addreses of the form <network>::1 on eth0 and then create a range from <network>::1 to <network>::400. If the interface is assigned more than one network, then the corresponding ranges will be automatically created, and then deprecated and finally removed again as the address is deprecated and then deleted. The interface name may have a final "*" wildcard.
+70 -84
View File
@@ -3,14 +3,14 @@
# This file is put in the public domain.
#
# Tomasz Sochański <nerdhero@gmail.com>, 2005.
# Jan Psota <jasiupsota@gmail.com>, 2008, 2009, 2010, 2011.
# Jan Psota <jasiupsota@gmail.com>, 2008, 2009, 2010, 2011, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 20:57+0100\n"
"PO-Revision-Date: 2012-03-04 01:45+0100\n"
"PO-Revision-Date: 2013-04-02 01:44+0200\n"
"Last-Translator: Jan Psota <jasiupsota@gmail.com>\n"
"Language-Team: polski <>\n"
"Language: \n"
@@ -475,7 +475,7 @@ msgstr "Wyłączenie możliwości negocjowania wielkości bloku dla przesyłów
#: option.c:373
msgid "Convert TFTP filenames to lowercase"
msgstr ""
msgstr "Konwertowanie nazw plików żądanych przez TFTP do małych liter"
#: option.c:374
msgid "Ephemeral port range for use by TFTP transfers."
@@ -575,54 +575,51 @@ msgstr "Załączenie anonsowania (RA) na interfejsach serwujących DHCPv6"
#: option.c:398
msgid "Specify DUID_EN-type DHCPv6 server DUID"
msgstr ""
msgstr "Określenie DHCPv6 DUID"
#: option.c:399
#, fuzzy
msgid "Specify host (A/AAAA and PTR) records"
msgstr "Specyfikacja rekordu MX."
msgstr "Określenie rekordów A/AAAA i PTR"
#: option.c:400
#, fuzzy
msgid "Specify arbitrary DNS resource record"
msgstr "Specyfikacja rekordu DNS TXT."
msgstr "Określenie rekordu TXT"
#: option.c:401
#, fuzzy
msgid "Bind to interfaces in use - check for new interfaces"
msgstr "nieznany interfejs %s w bridge-u"
msgstr "Dynamiczne podpinanie do interfejsów sieciowych"
#: option.c:402
msgid "Export local names to global DNS"
msgstr ""
msgstr "Eksportowanie lokalnych nazw hostów do globalnego DNS-a"
#: option.c:403
msgid "Domain to export to global DNS"
msgstr ""
msgstr "Domena pod którą będą eksportowane lokalne nazwy"
#: option.c:404
msgid "Set TTL for authoritative replies"
msgstr ""
msgstr "Określenie TTL dla odpowiedzi autorytatywnych"
#: option.c:405
msgid "Set authoritive zone information"
msgstr ""
msgstr "Określenie danych strefy autorytatywnej (SOA)"
#: option.c:406
msgid "Secondary authoritative nameservers for forward domains"
msgstr ""
msgstr "Pomocnicze serwery autorytatywne dla forwardowanych domen"
#: option.c:407
msgid "Peers which are allowed to do zone transfer"
msgstr ""
msgstr "Wskazanie serwerów uprawnionych do transferu stref"
#: option.c:408
msgid "Specify ipsets to which matching domains should be added"
msgstr ""
msgstr "Wyszczególnienie ipset-ów, do których będą dopisywane adresy IP leżące we wskazanych domenach"
#: option.c:410
msgid "Specify DHCPv6 prefix class"
msgstr ""
msgstr "Określenie prefiksu klasy DHCPv6"
#: option.c:596
#, c-format
@@ -656,9 +653,8 @@ msgid "bad interface name"
msgstr "nieprawidłowa nazwa interfejsu"
#: option.c:720
#, fuzzy
msgid "bad address"
msgstr "zły adres IP"
msgstr "zły adres"
#: option.c:847
msgid "unsupported encapsulation for IPv6 option"
@@ -739,14 +735,12 @@ msgid "recompile with HAVE_LUASCRIPT defined to enable Lua scripts"
msgstr "używanie skryptów Lua, wymaga skompilowania dnsmasq-a z flagą HAVE_LUASCRIPT"
#: option.c:1631
#, fuzzy
msgid "bad prefix"
msgstr "nieprawidłowy numer portu"
msgstr "zła maska"
#: option.c:2043
#, fuzzy
msgid "recompile with HAVE_IPSET defined to enable ipset directives"
msgstr "używanie skryptów Lua, wymaga skompilowania dnsmasq-a z flagą HAVE_LUASCRIPT"
msgstr "chcąc korzystać z ipsets przekompiluj dnsmasq-a z HAVE_IPSET"
#: option.c:2223
msgid "bad port range"
@@ -769,13 +763,12 @@ msgid "inconsistent DHCP range"
msgstr "niespójny zakres adresów DHCP"
#: option.c:2402
#, fuzzy
msgid "prefix must be exactly 64 for RA subnets"
msgstr "prefix musi mieć wartość >=64"
msgstr "prefix musi mieć wartość =64 dla podsieci RA"
#: option.c:2404
msgid "prefix must be exactly 64 for subnet constructors"
msgstr ""
msgstr "prefix dla podsieci musi wynosić równo 64"
#: option.c:2407
msgid "prefix must be at least 64"
@@ -794,9 +787,9 @@ msgid "cannot match tags in --dhcp-host"
msgstr "--dhcp-host nie dopuszcza dopasowywania na podstawie znaczników"
#: option.c:2589
#, fuzzy, c-format
#, c-format
msgid "duplicate dhcp-host IP address %s"
msgstr "powtórzony adres IP (%s) w pliku %s"
msgstr "powtórzony adres IP %s w specyfikacji dhcp-host"
#: option.c:2645
msgid "bad DHCP host name"
@@ -816,7 +809,7 @@ msgstr "zły adres dhcp-proxy"
#: option.c:3124
msgid "bad DUID"
msgstr ""
msgstr "zły DUID"
#: option.c:3166
msgid "invalid alias range"
@@ -839,9 +832,8 @@ msgid "bad NAPTR record"
msgstr "nieprawidłowy zapis rekordu NAPTR"
#: option.c:3295
#, fuzzy
msgid "bad RR record"
msgstr "nieprawidłowy zapis rekordu PTR"
msgstr "nieprawidłowy zapis rekordu RR"
#: option.c:3324
msgid "bad TXT record"
@@ -864,13 +856,12 @@ msgid "invalid weight"
msgstr "nieprawidłowa waga"
#: option.c:3417
#, fuzzy
msgid "Bad host-record"
msgstr "nieprawidłowy zapis rekordu PTR"
msgstr "nieprawidłowy zapis host-record"
#: option.c:3434
msgid "Bad name in host-record"
msgstr ""
msgstr "niedopuszczalna nazwa w host-record"
#: option.c:3464
msgid "unsupported option (check that dnsmasq was compiled with DHCP/TFTP/DBus support)"
@@ -897,9 +888,9 @@ msgid "error"
msgstr "błąd"
#: option.c:3592
#, fuzzy, c-format
#, c-format
msgid " at line %d of %s"
msgstr "%s w linii %d pliku %%s"
msgstr " w linii %d pliku %s"
#: option.c:3656 tftp.c:648
#, c-format
@@ -1009,9 +1000,9 @@ msgid "failed to create listening socket for %s: %s"
msgstr "nie udało się otworzyć gniazda %s: %s"
#: network.c:743
#, fuzzy, c-format
#, c-format
msgid "interface %s failed to join DHCPv6 multicast group: %s"
msgstr "nie udało się przyłączyć do grupy rozgłoszeniowej DHCPv6: %s"
msgstr "interfejs %s nie pozwolił się przyłączyć do grupy rozgłoszeniowej DHCPv6: %s"
#: network.c:937
#, c-format
@@ -1090,21 +1081,20 @@ msgid "asychronous logging is not available under Android"
msgstr "zapis do logów w trybie asynchronicznym nie jest dostępny w Androidzie"
#: dnsmasq.c:154
#, fuzzy
msgid "authoritative DNS not available: set HAVE_AUTH in src/config.h"
msgstr "Obsługa DBus nie została wkompilowana -- ustaw HAVE_DBUS w src/config.h"
msgstr "tryb autorytatywny DNS-a niedostępny - ustaw HAVE_AUTH w src/config.h"
#: dnsmasq.c:164
msgid "zone serial must be configured in --auth-soa"
msgstr ""
msgstr "za pomocą --auth-soa musi zostać ustawiony numer seryjny strefy"
#: dnsmasq.c:186
msgid "dhcp-range constructor not available on this platform"
msgstr ""
msgstr "konstrukcja dhcp-range nie jest dostępna w tym systemie"
#: dnsmasq.c:225
msgid "cannot set --bind-interfaces and --bind-dynamic"
msgstr ""
msgstr "--bind-interfaces i --bind-dynamic wzajemnie się wykluczają"
#: dnsmasq.c:229
#, c-format
@@ -1258,7 +1248,7 @@ msgstr "nie udało się wczytać skryptu Lua: %s"
#: dnsmasq.c:1031
#, c-format
msgid "TFTP directory %s inaccessible: %s"
msgstr ""
msgstr "katalog TFTP %s nie jest dostępny: %s"
#: dnsmasq.c:1095
#, c-format
@@ -1630,9 +1620,9 @@ msgid "cannot create DHCPv6 socket: %s"
msgstr "nie udało się utworzyć gniazda dla DHCPv6: %s"
#: dhcp6.c:62
#, fuzzy, c-format
#, c-format
msgid "failed to set SO_REUSE{ADDR|PORT} on DHCPv6 socket: %s"
msgstr "nie udało się ustawić SO_REUSE{ADDR|PORT} gniazda DHCP: %s"
msgstr "nie udało się ustawić SO_REUSE{ADDR|PORT} gniazda DHCPv6: %s"
#: dhcp6.c:74
#, c-format
@@ -1655,58 +1645,54 @@ msgid "%u available DHCPv6 subnet: %s/%d"
msgstr "%u dostępna podsieć DHCPv6: %s/%d"
#: rfc3315.c:350
#, fuzzy, c-format
#, c-format
msgid "%u vendor class: %u"
msgstr "%u klasa dostawcy: %s"
msgstr "%u klasa dostawcy: %u"
#: rfc3315.c:609
#, fuzzy, c-format
#, c-format
msgid "unknown prefix-class %d"
msgstr "nieznana dzierżawa"
msgstr "nieznana klasa sieci %d"
#: rfc3315.c:741 rfc3315.c:854
msgid "success"
msgstr ""
msgstr "udane"
#: rfc3315.c:756 rfc3315.c:758 rfc3315.c:862 rfc3315.c:864
#, fuzzy
msgid "no addresses available"
msgstr "brak dostępnego adresu"
msgstr "brak wolnych adresów"
#: rfc3315.c:806
#, fuzzy
msgid "address unavailable"
msgstr "adres niedostępny"
#: rfc3315.c:841
msgid "not on link"
msgstr ""
msgstr "poza zasięgiem"
#: rfc3315.c:915 rfc3315.c:1073 rfc3315.c:1150
msgid "no binding found"
msgstr ""
msgstr "brak powiązania"
#: rfc3315.c:948
msgid "deprecated"
msgstr ""
msgstr "przestarzały"
#: rfc3315.c:951
#, fuzzy
msgid "address invalid"
msgstr "adres jest w użyciu"
msgstr "niepoprawny adres"
#: rfc3315.c:992
msgid "confirm failed"
msgstr ""
msgstr "brak potwierdzenia"
#: rfc3315.c:1003
#, fuzzy
msgid "all addresses still on link"
msgstr "błędny adres w pliku %s, w linii %d"
msgstr "wszystkie adresy ciągle w użyciu"
#: rfc3315.c:1082
msgid "release received"
msgstr ""
msgstr "adres został zwolniony"
#: dhcp-common.c:145
#, c-format
@@ -1729,9 +1715,9 @@ msgid "duplicate IP address %s (%s) in dhcp-config directive"
msgstr "powtórzenie adresu IP %s (%s) w opcji dhcp-config"
#: dhcp-common.c:367
#, fuzzy, c-format
#, c-format
msgid "failed to set SO_BINDTODEVICE on DHCP socket: %s"
msgstr "nie udało się ustawić SO_REUSE{ADDR|PORT} gniazda DHCP: %s"
msgstr "nie udało się ustawić SO_BINDTODEVICE gniazda DHCP: %s"
#: dhcp-common.c:489
#, c-format
@@ -1745,42 +1731,42 @@ msgstr "Rozpoznawane opcje DHCPv6:\n"
#: dhcp-common.c:693
msgid ", prefix deprecated"
msgstr ""
msgstr ", przestarzały prefiks"
#: dhcp-common.c:696
#, c-format
msgid ", lease time "
msgstr ""
msgstr ", czas dzierżawy"
#: dhcp-common.c:727
#, c-format
msgid "%s stateless on %s%.0s%.0s%s"
msgstr ""
msgstr "%s bezstanowy na %s%.0s%.0s%s"
#: dhcp-common.c:729
#, fuzzy, c-format
#, c-format
msgid "%s, static leases only on %.0s%s%s%.0s"
msgstr "DHCP: tylko statyczne dzierżawy na %.0s%s, czas dzierżawy %s"
msgstr "%s, wyłącznie statyczne dzierżawy na %.0s%s%s%.0s"
#: dhcp-common.c:731
#, fuzzy, c-format
#, c-format
msgid "%s, proxy on subnet %.0s%s%.0s%.0s"
msgstr "DHCP: pośrednik na podsieci %.0s%s%.0s"
msgstr "%s, wykryto pośrednika na podsieci %.0s%s%.0s%.0s"
#: dhcp-common.c:732
#, fuzzy, c-format
#, c-format
msgid "%s, IP range %s -- %s%s%.0s"
msgstr "DHCP: zakres IP %s -- %s, czas dzierżawy %s"
msgstr "%s, zakres IP %s -- %s%s%.0s"
#: dhcp-common.c:739
#, c-format
msgid "DHCPv4-derived IPv6 names on %s%s"
msgstr ""
msgstr "pochodzące z DHCPv4 nazwy IPv6 na %s%s"
#: dhcp-common.c:742
#, fuzzy, c-format
#, c-format
msgid "router advertisement on %s%s"
msgstr "tylko anonsowanie routera na %.0s%s, czas życia %s"
msgstr "anonsowanie routera na %s%s"
#: radv.c:87
#, c-format
@@ -1788,19 +1774,19 @@ msgid "cannot create ICMPv6 socket: %s"
msgstr "nie udało się utworzyć gniazda dla ICMPv6: %s"
#: auth.c:402
#, fuzzy, c-format
#, c-format
msgid "ignoring zone transfer request from %s"
msgstr "nieobsługiwane żądanie od komputera %s"
msgstr "ignoruję żądanie transferu strefy od %s"
#: ipset.c:71
#, fuzzy, c-format
#, c-format
msgid "failed to find kernel version: %s"
msgstr "błąd przy przyznawaniu nazwy gniazdu serwera DHCP: %s"
msgstr "niezgodna wersja jądra: %s"
#: ipset.c:90
#, fuzzy, c-format
#, c-format
msgid "failed to create IPset control socket: %s"
msgstr "nie powiodło się otwieranie gniazda dla usługi TFTP: %s"
msgstr "nie powiodło się otwieranie gniazda sterującego IPset: %s"
#~ msgid "no interface with address %s"
#~ msgstr "brak interfejsu z adresem %s"
+8 -1
View File
@@ -91,6 +91,7 @@ struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *con
{
struct dhcp_netid *tagif = run_tag_if(tags);
struct dhcp_opt *opt;
struct dhcp_opt *tmp;
/* flag options which are valid with the current tag set (sans context tags) */
for (opt = opts; opt; opt = opt->next)
@@ -135,7 +136,6 @@ struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *con
for (opt = opts; opt; opt = opt->next)
if (!(opt->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR | DHOPT_RFC3925 | DHOPT_TAGOK)) && !opt->netid)
{
struct dhcp_opt *tmp;
for (tmp = opts; tmp; tmp = tmp->next)
if (tmp->opt == opt->opt && (tmp->flags & DHOPT_TAGOK))
break;
@@ -145,6 +145,13 @@ struct dhcp_netid *option_filter(struct dhcp_netid *tags, struct dhcp_netid *con
my_syslog(MS_DHCP | LOG_WARNING, _("Ignoring duplicate dhcp-option %d"), tmp->opt);
}
/* Finally, eliminate duplicate options later in the chain, and therefore earlier in the config file. */
for (opt = opts; opt; opt = opt->next)
if (opt->flags & DHOPT_TAGOK)
for (tmp = opt->next; tmp; tmp = tmp->next)
if (tmp->opt == opt->opt)
tmp->flags &= ~DHOPT_TAGOK;
return tagif;
}
+12 -4
View File
@@ -65,14 +65,22 @@ static int make_fd(int port)
/* When bind-interfaces is set, there might be more than one dnmsasq
instance binding port 67. That's OK if they serve different networks.
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
Need to set REUSEADDR|REUSEPORT to make this posible.
Handle the case that REUSEPORT is defined, but the kernel doesn't
support it. This handles the introduction of REUSEPORT on Linux. */
if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
{
int rc = -1, porterr = 0;
#ifdef SO_REUSEPORT
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt));
#else
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt));
if ((rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt))) == -1 &&
errno != ENOPROTOOPT)
porterr = 1;
#endif
if (rc == -1 && !porterr)
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt));
if (rc == -1)
die(_("failed to set SO_REUSE{ADDR|PORT} on DHCP socket: %s"), NULL, EC_BADNET);
}
+14 -6
View File
@@ -48,16 +48,24 @@ void dhcp6_init(void)
!set_ipv6pktinfo(fd))
die (_("cannot create DHCPv6 socket: %s"), NULL, EC_BADNET);
/* When bind-interfaces is set, there might be more than one dnmsasq
/* When bind-interfaces is set, there might be more than one dnmsasq
instance binding port 547. That's OK if they serve different networks.
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
Need to set REUSEADDR|REUSEPORT to make this posible.
Handle the case that REUSEPORT is defined, but the kernel doesn't
support it. This handles the introduction of REUSEPORT on Linux. */
if (option_bool(OPT_NOWILD) || option_bool(OPT_CLEVERBIND))
{
int rc = -1, porterr = 0;
#ifdef SO_REUSEPORT
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt));
#else
int rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt));
if ((rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt))) == -1 &&
errno != ENOPROTOOPT)
porterr = 1;
#endif
if (rc == -1 && !porterr)
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt));
if (rc == -1)
die(_("failed to set SO_REUSE{ADDR|PORT} on DHCPv6 socket: %s"), NULL, EC_BADNET);
}
@@ -326,7 +334,7 @@ struct dhcp_context *address6_allocate(struct dhcp_context *context, unsigned c
} while (addr != start);
}
return 0;
return NULL;
}
/* can dynamically allocate addr */
+1
View File
@@ -543,6 +543,7 @@ struct dhcp_lease {
int backoff; /* zero -> confirmed */
struct slaac_address *next;
} *slaac_address;
int vendorclass_count;
#endif
struct dhcp_lease *next;
};
+1 -1
View File
@@ -680,7 +680,7 @@ void receive_query(struct listener *listen, time_t now)
dst_addr_4.s_addr = 0;
netmask.s_addr = 0;
if (listen->iface && option_bool(OPT_NOWILD))
if (option_bool(OPT_NOWILD) && listen->iface)
{
auth_dns = listen->iface->dns_auth;
+8 -2
View File
@@ -655,8 +655,9 @@ void queue_script(int action, struct dhcp_lease *lease, char *hostname, time_t n
unsigned char *p;
unsigned int hostname_len = 0, clid_len = 0, ed_len = 0;
int fd = daemon->dhcpfd;
#ifdef HAVE_DHCP6
int is6 = !!(lease->flags & (LEASE_TA | LEASE_NA));
#ifdef HAVE_DHCP6
if (!daemon->dhcp)
fd = daemon->dhcp6fd;
#endif
@@ -676,7 +677,12 @@ void queue_script(int action, struct dhcp_lease *lease, char *hostname, time_t n
buf->action = action;
buf->flags = lease->flags;
buf->hwaddr_len = lease->hwaddr_len;
#ifdef HAVE_DHCP6
if (is6)
buf->hwaddr_len = lease->vendorclass_count;
else
#endif
buf->hwaddr_len = lease->hwaddr_len;
buf->hwaddr_type = lease->hwaddr_type;
buf->clid_len = clid_len;
buf->ed_len = ed_len;
+3 -1
View File
@@ -115,7 +115,7 @@ void lease_init(time_t now)
s++;
}
hw_type = atoi(s);
hw_type = strtoul(s, NULL, 10);
if ((lease = lease6_allocate(&addr.addr.addr6, lease_type)))
{
@@ -595,6 +595,8 @@ struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_typ
if (!first)
first = leases;
else
first = first->next;
for (lease = first; lease; lease = lease->next)
{
+5 -4
View File
@@ -124,6 +124,7 @@ static int dhcp6_maybe_relay(struct in6_addr *link_address, struct dhcp_netid **
is_same_net6(link_address, &c->start6, c->prefix) &&
is_same_net6(link_address, &c->end6, c->prefix))
{
c->preferred = c->valid = 0xffffffff;
c->current = context;
context = c;
}
@@ -693,7 +694,7 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
if (dump_all_prefix_classes && state.ia_type == OPTION6_IA_NA)
state.send_prefix_class = prefix_class_from_context(c);
#endif
add_address(&state, c, lease_time, requested_time, &min_time, &addr, rapid_commit != NULL, now);
add_address(&state, c, lease_time, lease_time, &min_time, &addr, rapid_commit != NULL, now);
mark_context_used(&state, context, &addr);
get_context_tag(&state, c);
address_assigned = 1;
@@ -1608,12 +1609,12 @@ static void update_leases(struct state *state, struct dhcp_context *context, str
free(lease->extradata);
lease->extradata = NULL;
lease->extradata_size = lease->extradata_len = 0;
lease->hwaddr_len = 0; /* surrogate for no of vendor classes */
lease->vendorclass_count = 0;
if ((class_opt = opt6_find(state->packet_options, state->end, OPTION6_VENDOR_CLASS, 4)))
{
void *enc_opt, *enc_end = opt6_ptr(class_opt, opt6_len(class_opt));
lease->hwaddr_len++;
lease->vendorclass_count++;
/* send enterprise number first */
sprintf(daemon->dhcp_buff2, "%u", opt6_uint(class_opt, 0, 4));
lease_add_extradata(lease, (unsigned char *)daemon->dhcp_buff2, strlen(daemon->dhcp_buff2), 0);
@@ -1621,7 +1622,7 @@ static void update_leases(struct state *state, struct dhcp_context *context, str
if (opt6_len(class_opt) >= 6)
for (enc_opt = opt6_ptr(class_opt, 4); enc_opt; enc_opt = opt6_next(enc_opt, enc_end))
{
lease->hwaddr_len++;
lease->vendorclass_count++;
lease_add_extradata(lease, opt6_ptr(enc_opt, 0), opt6_len(enc_opt), 0);
}
}