[systemd-devel] [PATCH] Add support for DHCP static route options in networkd

2014-06-25 Thread Eugene Yakubovich
This adds support for DHCP options 33 and 121: Static Route and Classless Static Route. To enable this feature, set UseRoutes=true in .network file. Returned routes are added to the routing table. --- man/systemd.network.xml | 7 ++ src/libsystemd-network/dhcp-lease-internal

[systemd-devel] [PATCH resend] Add support for DHCP static route options in networkd

2014-06-25 Thread Eugene Yakubovich
This adds support for DHCP options 33 and 121: Static Route and Classless Static Route. To enable this feature, set UseRoutes=true in .network file. Returned routes are added to the routing table. --- man/systemd.network.xml | 7 ++ src/libsystemd-network/dhcp-lease-internal

Re: [systemd-devel] [PATCH] Add support for DHCP static route options in networkd

2014-06-26 Thread Eugene Yakubovich
> On Wed, 25.06.14 18:03, Eugene Yakubovich (eyakubov...@gmail.com) wrote: > > The patch is line-broken I resent it last night with [PATCH resent] in the subject. Is that one also line broken? It was resent with git send-email so should be ok. > Just one quick question without

Re: [systemd-devel] [PATCH] Add support for DHCP static route options in networkd

2014-06-26 Thread Eugene Yakubovich
On Thu, Jun 26, 2014 at 11:17 AM, Lennart Poettering wrote: > I am tempted to say that we should try to apply as much information from > DHCP as we can by default, but make sure it doesn't become a security > problem. i.e. we should probably use metrics or so so that manual routes > always win, o

Re: [systemd-devel] [PATCH] Add support for DHCP static route options in networkd

2014-06-27 Thread Eugene Yakubovich
On Fri, Jun 27, 2014 at 11:09 AM, Marcel Holtmann wrote: >> Hmm, something in the middle of the range, I figure, that is still nice >> to type and look at for whatever that is. pick something... Also I >> figure the default route added due to dhcp config should also use this >> same metric. > > it

Re: [systemd-devel] [PATCH resend] Add support for DHCP static route options in networkd

2014-06-27 Thread Eugene Yakubovich
On Thu, Jun 26, 2014 at 1:45 PM, Zbigniew Jędrzejewski-Szmek wrote: >> +r = sd_dhcp_lease_get_routes(link->dhcp_lease, >> &static_routes, &static_routes_size); >> +if (r >= 0) { >> +for (i = 0; i < static_routes_size; i++) { >> +

[systemd-devel] [PATCH v2] Add support for DHCP static route options

2014-06-27 Thread Eugene Yakubovich
This adds support for DHCP options 33 and 121: Static Route and Classless Static Route. To enable this feature, set UseRoutes=true in .network file. Returned routes are added to the routing table. --- man/systemd.network.xml | 7 ++ src/libsystemd-network/dhcp-lease-internal

[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

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-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

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

2014-07-01 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. To opt-out of this behaviour set SendHostname to false in [DHCPv4] section of .network file --- man/systemd.network.xml | 7 ++ src/libsystemd-ne

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

2014-07-01 Thread Eugene Yakubovich
On Tue, Jul 1, 2014 at 12:53 PM, Lennart Poettering wrote: > On Tue, 01.07.14 11:58, Eugene Yakubovich (eugene.yakubov...@coreos.com) > wrote: > > > +int sd_dhcp_client_set_hostname(sd_dhcp_client *client, > > +const char *hostname) { > > +