<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-06-30 16:56 GMT+02:00 Albert ARIBAUD <span dir="ltr"><<a href="mailto:albert.aribaud@free.fr" target="_blank">albert.aribaud@free.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Bonjour Maciej,<br>
<br>
Le Tue, 30 Jun 2015 15:56:36 +0200, Maciej Soltysiak<br>
<<a href="mailto:maciej@soltysiak.com">maciej@soltysiak.com</a>> a écrit :<br>
<div><div class="h5"><br>
> On Tue, Jun 30, 2015 at 3:24 PM, Albert ARIBAUD <<a href="mailto:albert.aribaud@free.fr">albert.aribaud@free.fr</a>><br>
> wrote:<br>
><br>
> > Bonjour Michał,<br>
> ><br>
> > Le Tue, 30 Jun 2015 13:54:11 +0200, Michał Lipka <michal@lipka.email> a<br>
> > écrit :<br>
> ><br>
> > > 2015-06-30 12:10 GMT+02:00 Maciej Soltysiak <<a href="mailto:maciej@soltysiak.com">maciej@soltysiak.com</a>>:<br>
> > ><br>
> > > > On Tue, Jun 30, 2015 at 4:03 AM, <a href="mailto:wkitty42@gmail.com">wkitty42@gmail.com</a> <<br>
> > <a href="mailto:wkitty42@gmail.com">wkitty42@gmail.com</a>><br>
> > > > wrote:<br>
> > > ><br>
> > > >><br>
> > > >> On 06/29/2015 04:01 PM, Michał Lipka wrote:<br>
> > > >><br>
> > > >>><br>
> > > >>> 2015-06-25 16:02 GMT+02:00 <a href="mailto:wkitty42@gmail.com">wkitty42@gmail.com</a><br>
> > > >>> does breaking the line work?<br>
> > > >>><br>
> > > >>> eg:<br>
> > > >>> dhcp-option=249,<a href="http://10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4" rel="noreferrer" target="_blank">10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4</a><br>
> > > >>> <<a href="http://10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4" rel="noreferrer" target="_blank">http://10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4</a>>, \<br>
> > > >>> <a href="http://192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4" rel="noreferrer" target="_blank">192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4</a><br>
> > > >>> <<a href="http://192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4" rel="noreferrer" target="_blank">http://192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4</a>>, \<br>
> > > >>> <a href="http://192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4" rel="noreferrer" target="_blank">192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4</a><br>
> > > >>> <<a href="http://192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4" rel="noreferrer" target="_blank">http://192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4</a>>, \<br>
> > > >>> <a href="http://192.168.13.20/32,1.2.3.4" rel="noreferrer" target="_blank">192.168.13.20/32,1.2.3.4</a> <<a href="http://192.168.13.20/32,1.2.3.4" rel="noreferrer" target="_blank">http://192.168.13.20/32,1.2.3.4</a>><br>
> > > >>><br>
> > > >>><br>
> > > >>> Thank you for this idea. Unfortunately it does not work. dnsmasq<br>
> > fails<br>
> > > >>> at first<br>
> > > >>> line which has no option:<br>
> > > >>><br>
> > > >><br>
> > > >> sounds like an option that should maybe be implemented... especially<br>
> > > >> since it is an apparent standard that so many tools do follow ;)<br>
> > > >><br>
> > > > I think dnsmasq has a 1024 characters for config lines. I browsed the<br>
> > > > source briefly last night but couldn't find it.<br>
> > > ><br>
> > ><br>
> > > I checked it more precisely and it turned out that is not line length<br>
> > that<br>
> > > bothers dnsmasq. It's routes count.<br>
> > > I can set up to 28 routes in single dhcp-option line. It doesn't matter<br>
> > if<br>
> > > it will take 600 or 800 characters. If I set 29th route dnsmasq complains<br>
> > > about option too long:<br>
> > ><br>
> > > dnsmasq: dhcp-option too long at line 320 of /etc/dnsmasq.conf<br>
> > > Can you check the code once again and try to find this limit (28) ? Why<br>
> > it<br>
> > > is like that?<br>
> ><br>
> > Could it be that the total DHCP packet size goes over the maximum<br>
> > allowed size for an UDP frame?<br>
> ><br>
> Perhaps. The offending code is related to the length of the dhcp option,<br>
> not the number of routes per se:<br>
><br>
> if (!is6 &&<br>
> ((new->len > 255) ||<br>
> (new->len > 253 && (new->flags & (DHOPT_VENDOR | DHOPT_ENCAPSULATE)))<br>
> ||<br>
> (new->len > 250 && (new->flags & DHOPT_RFC3925))))<br>
> ret_err(_("dhcp-option too long"));<br></div></div></blockquote><div><br></div><div>route can use different number of bytes 17-33 - (<a href="http://1.1.1.1/8,2.2.2.2">1.1.1.1/8,2.2.2.2</a> <a href="http://111.111.111.111/32,222.222.222.222">111.111.111.111/32,222.222.222.222</a>) and I checked that you can insert only 28 routes despite of the fact how many bytes it will take (if you try to assign 28 "smallest" routes it will take 28*17+27(commas)=503 and 28 "largest" routes would take 28*33+27=951 bytes). and you cannot set 29 "smallest" routes as it will yell "dhcp-option too long" (tested).<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5">
><br>
> I guess you can stick more than 255 bytes in a dhcp packet, anyone knows if<br>
> the limit is coming from RFCs or elsewhere?<br>
<br>
</div></div>There is actually an option's size limit, see RFC 2132 section 2:<br>
the option second byte contains the length and its content does not<br>
include the tag and length fields, so the actual option content cannot<br>
be bigger than 253 bytes.<br></blockquote><div><br></div><div>yes but RFC 3396 is about "Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)"<br><br></div><div>and setting 28 routes is working (client gets them)</div><div><br></div><div>Michal</div></div></div></div>