summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch')
-rw-r--r--net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch134
1 files changed, 134 insertions, 0 deletions
diff --git a/net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch b/net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch
new file mode 100644
index 000000000000..6c52a533f1a1
--- /dev/null
+++ b/net-dns/dnsmasq/files/dnsmasq-2.66-dhcp-option-zero.patch
@@ -0,0 +1,134 @@
+commit bd08ae67f9a0cae2ce15be885254cad9449d4551
+Author: Simon Kelley <simon@thekelleys.org.uk>
+Date: Fri Apr 19 10:22:06 2013 +0100
+
+ Allow option number zero in encapsulated DHCP options.
+
+diff --git a/src/dhcp-common.c b/src/dhcp-common.c
+index f4fd088..8de4268 100644
+--- a/src/dhcp-common.c
++++ b/src/dhcp-common.c
+@@ -512,7 +512,7 @@ void display_opts6(void)
+ }
+ #endif
+
+-u16 lookup_dhcp_opt(int prot, char *name)
++int lookup_dhcp_opt(int prot, char *name)
+ {
+ const struct opttab_t *t;
+ int i;
+@@ -528,10 +528,10 @@ u16 lookup_dhcp_opt(int prot, char *name)
+ if (strcasecmp(t[i].name, name) == 0)
+ return t[i].val;
+
+- return 0;
++ return -1;
+ }
+
+-u16 lookup_dhcp_len(int prot, u16 val)
++int lookup_dhcp_len(int prot, int val)
+ {
+ const struct opttab_t *t;
+ int i;
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 69ae7a7..41e2798 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -1216,8 +1216,8 @@ void log_tags(struct dhcp_netid *netid, u32 xid);
+ int match_bytes(struct dhcp_opt *o, unsigned char *p, int len);
+ void dhcp_update_configs(struct dhcp_config *configs);
+ void display_opts(void);
+-u16 lookup_dhcp_opt(int prot, char *name);
+-u16 lookup_dhcp_len(int prot, u16 val);
++int lookup_dhcp_opt(int prot, char *name);
++int lookup_dhcp_len(int prot, int val);
+ char *option_string(int prot, unsigned int opt, unsigned char *val,
+ int opt_len, char *buf, int buf_len);
+ #ifdef HAVE_LINUX_NETWORK
+diff --git a/src/option.c b/src/option.c
+index b2596ec..2a61017 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -750,6 +750,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
+ struct dhcp_netid *np = NULL;
+ u16 opt_len = 0;
+ int is6 = 0;
++ int option_ok = 0;
+
+ new->len = 0;
+ new->flags = flags;
+@@ -769,16 +770,19 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
+ {
+ new->opt = atoi(arg);
+ opt_len = 0;
++ option_ok = 1;
+ break;
+ }
+
+ if (strstr(arg, "option:") == arg)
+ {
+- new->opt = lookup_dhcp_opt(AF_INET, arg+7);
+- opt_len = lookup_dhcp_len(AF_INET, new->opt);
+- /* option:<optname> must follow tag and vendor string. */
+- if ((opt_len & OT_INTERNAL) && flags != DHOPT_MATCH)
+- new->opt = 0;
++ if ((new->opt = lookup_dhcp_opt(AF_INET, arg+7)) != -1)
++ {
++ opt_len = lookup_dhcp_len(AF_INET, new->opt);
++ /* option:<optname> must follow tag and vendor string. */
++ if (!(opt_len & OT_INTERNAL) || flags == DHOPT_MATCH)
++ option_ok = 1;
++ }
+ break;
+ }
+ #ifdef HAVE_DHCP6
+@@ -792,13 +796,16 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
+ {
+ new->opt = atoi(arg+8);
+ opt_len = 0;
++ option_ok = 1;
+ }
+ else
+ {
+- new->opt = lookup_dhcp_opt(AF_INET6, arg+8);
+- opt_len = lookup_dhcp_len(AF_INET6, new->opt);
+- if ((opt_len & OT_INTERNAL) && flags != DHOPT_MATCH)
+- new->opt = 0;
++ if ((new->opt = lookup_dhcp_opt(AF_INET6, arg+8)) != -1)
++ {
++ opt_len = lookup_dhcp_len(AF_INET6, new->opt);
++ if (!(opt_len & OT_INTERNAL) || flags == DHOPT_MATCH)
++ option_ok = 1;
++ }
+ }
+ /* option6:<opt>|<optname> must follow tag and vendor string. */
+ is6 = 1;
+@@ -821,7 +828,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
+ new->flags |= DHOPT_RFC3925;
+ if (flags == DHOPT_MATCH)
+ {
+- new->opt = 1; /* avoid error below */
++ option_ok = 1;
+ break;
+ }
+ }
+@@ -848,16 +855,16 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
+
+ if (opt_len == 0 &&
+ !(new->flags & DHOPT_RFC3925))
+- opt_len = lookup_dhcp_len(AF_INET6 ,new->opt);
++ opt_len = lookup_dhcp_len(AF_INET6, new->opt);
+ }
+ else
+ #endif
+ if (opt_len == 0 &&
+ !(new->flags & (DHOPT_VENDOR | DHOPT_ENCAPSULATE | DHOPT_RFC3925)))
+- opt_len = lookup_dhcp_len(AF_INET ,new->opt);
++ opt_len = lookup_dhcp_len(AF_INET, new->opt);
+
+ /* option may be missing with rfc3925 match */
+- if (new->opt == 0)
++ if (!option_ok)
+ ret_err(_("bad dhcp-option"));
+
+ if (comma)