]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Note that we encode the hostname according to RFC1035. As such, we can't use the...
authorRoy Marples <roy@marples.name>
Thu, 7 Aug 2008 10:15:15 +0000 (10:15 +0000)
committerRoy Marples <roy@marples.name>
Thu, 7 Aug 2008 10:15:15 +0000 (10:15 +0000)
dhcpcd.8.in
dhcpcd.c
dhcpcd.conf.5.in
dhcpcd.h

index d17e8e6280c67d2d234657ae3058f925c9950510..9f7fcb03607c8ae1b3bb64193a39790818a008a2 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 6, 2008
+.Dd August 7, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
@@ -302,6 +302,9 @@ The current hostname or the hostname specified using the
 option must be a FQDN.
 .Nm
 itself never does any DNS updates.
+.Nm
+encodes the FQDN hostname as specified in
+.Li RFC1035 .
 .It Fl I , -clientid Ar clientid
 Change the default clientid sent from the interface hardware address.
 If the string is of the format 01:02:03 then it is encoded as hex.
index 75fc3a4017853fabef68aabe1ba43b58316c9d90..889cf7778eec51e7aae89324bbff03c8d28025c8 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -325,7 +325,7 @@ parse_option(int opt, char *oarg, struct options *options)
        case 'h':
                if (oarg)
                        s = parse_string(options->hostname + 1,
-                                        MAXHOSTNAMELEN, oarg);
+                                        HOSTNAME_MAX_LEN, oarg);
                else
                        s = 0;
                if (s == -1) {
index b2a7e356f79cf621c602c10f53e08201234de074..84bb9be0991282f2373bdaaff75d735432551d2b 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 30, 2008
+.Dd August 7, 2008
 .Dt DHCPCD.CONF 5 SMM
 .Sh NAME
 .Nm dhcpcd.conf
@@ -75,6 +75,9 @@ The current hostname or the hostname specified using the
 option must be a FQDN.
 .Nm dhcpcd
 itself never does any DNS updates.
+.Nm dhcpcd
+encodes the FQDN hostname as specified in
+.Li RFC1035 .
 .It Ic interface Ar interface
 Subsequent options are only parsed for this
 .Ar interface .
index c9a42e1c8b7b67321b99f082b6313a3f937b02b4..068a65eb3c069539a50d0211fee094e9dedb2c88 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -41,6 +41,7 @@
 #define DEFAULT_TIMEOUT                30
 #define DEFAULT_LEASETIME      3600    /* 1 hour */
 
+#define HOSTNAME_MAX_LEN       254     /* Trailing NULL for FQDN */
 #define CLASSID_MAX_LEN                48
 #define CLIENTID_MAX_LEN       48
 #define USERCLASS_MAX_LEN      255
@@ -87,7 +88,7 @@ struct options {
        char script[PATH_MAX];
        char pidfile[PATH_MAX];
 
-       char hostname[MAXHOSTNAMELEN];
+       char hostname[HOSTNAME_MAX_LEN + 1];
        int fqdn;
        uint8_t classid[CLASSID_MAX_LEN + 1];
        char clientid[CLIENTID_MAX_LEN + 1];