]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Clients that sent a parameter request list containing the routers option
authorEvan Hunt <each@isc.org>
Sat, 19 Jul 2008 01:11:40 +0000 (01:11 +0000)
committerEvan Hunt <each@isc.org>
Sat, 19 Jul 2008 01:11:40 +0000 (01:11 +0000)
before the subnet mask option were receiving only the latter. [rt18133]

RELNOTES
common/options.c

index dbf36ff4cb61af0518cb6ff9dcfe5517709964e4..8c250ac549d2ee65baedfd0403728414b14aa9a7 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -54,6 +54,10 @@ work on other platforms. Please report any problems and suggested fixes to
 
 - Fixed a bug that caused some request types to be logged incorrectly.
 
+- Clients that sent a parameter request list containing the
+  routers option before the subnet mask option were receiving
+  only the latter.  Fixed.
+
                        Changes since 4.1.0a1
 
 - Fixed a coredump when adding a class via OMAPI.
index 8728513bfcb8ba730e41c6c8faaaf3b31b2e32fa..7971d7458b607ed255e0bca010890ae258e93d2e 100644 (file)
@@ -1180,15 +1180,10 @@ store_options(int *ocount,
                 */
                if (priority_list[i] == DHO_SUBNET_MASK) {
                        for (ix = i - 1 ; ix >= 0 ; ix--) {
-                               /* We know that anything before 'i' can only
-                                * appear once.  So shovel the options to make
-                                * room to bubble the subnet mask ahead, and
-                                * then break out of the loop, we're done.
-                                */
                                if (priority_list[ix] == DHO_ROUTERS) {
-                                       memmove(priority_list + ix + 1,
-                                               priority_list + ix, i - ix);
+                                        /* swap */
                                        priority_list[ix] = DHO_SUBNET_MASK;
+                                       priority_list[i] = DHO_ROUTERS;
                                        break;
                                }
                        }