Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-07-01 Thread Lennart Poettering
On Tue, 01.07.14 10:37, Eugene Yakubovich (eugene.yakubov...@coreos.com) wrote: > > > > > +/* make sure the hostname is not "localhost" */ > > > +static bool is_localhost(const char *hostname) { > > > +char *hostend; > > > + > > > +assert(hostname); > > > + > > > +hostend =

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-07-01 Thread Eugene Yakubovich
> > > +/* make sure the hostname is not "localhost" */ > > +static bool is_localhost(const char *hostname) { > > +char *hostend; > > + > > +assert(hostname); > > + > > +hostend = strchr(hostname, '.'); > > +if (hostend) > > +return strneq(hostname, "l

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-07-01 Thread Lennart Poettering
On Mon, 30.06.14 16:52, Eugene Yakubovich (eugene.yakubov...@coreos.com) wrote: > uint32_t xid; > usec_t start_time; > uint16_t secs; > @@ -178,6 +179,20 @@ int sd_dhcp_client_set_mac(sd_dhcp_client *client, > return 0; > } > > +int sd_dhcp_client_set_hostnam

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-06-30 Thread Tom Gundersen
On Tue, Jul 1, 2014 at 2:36 AM, Eugene Yakubovich wrote: > On Mon, Jun 30, 2014 at 5:09 PM, Greg KH wrote: >> >> > +/* make sure the hostname is not "localhost" */ >> > +static bool is_localhost(const char *hostname) { >> > +char *hostend; >> > + >> > +assert(hostname); >> >> You

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-06-30 Thread Tom Gundersen
On Tue, Jul 1, 2014 at 1:52 AM, Eugene Yakubovich wrote: > Send hostname (option 12) in DISCOVER and REQUEST messages so the > DHCP server could use it to register with dynamic DNS and such. Nice! A couple of minor nits below. Apart from that, could you add a config option to make this opt-out (

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-06-30 Thread Eugene Yakubovich
On Mon, Jun 30, 2014 at 5:09 PM, Greg KH wrote: > > +/* make sure the hostname is not "localhost" */ > > +static bool is_localhost(const char *hostname) { > > +char *hostend; > > + > > +assert(hostname); > > You only call this in one place, with an array on the stack, so it can >

Re: [systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-06-30 Thread Greg KH
On Mon, Jun 30, 2014 at 04:52:21PM -0700, Eugene Yakubovich wrote: > Send hostname (option 12) in DISCOVER and REQUEST messages so the > DHCP server could use it to register with dynamic DNS and such. > --- > src/libsystemd-network/sd-dhcp-client.c | 35 > + > src/

[systemd-devel] [PATCH] networkd: send hostname to dhcp server

2014-06-30 Thread Eugene Yakubovich
Send hostname (option 12) in DISCOVER and REQUEST messages so the DHCP server could use it to register with dynamic DNS and such. --- src/libsystemd-network/sd-dhcp-client.c | 35 + src/network/networkd-link.c | 26 src/systemd/s