Gene Cumm
2013-Jun-24 03:21 UTC
[syslinux] [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
On Sun, Jun 23, 2013 at 11:09 PM, Gene Cumm <gene.cumm at gmail.com> wrote:> On Sun, Jun 23, 2013 at 11:06 PM, Gene Cumm <gene.cumm at gmail.com> wrote: >> core and the simple menu do not interpret the IPAPPEND/SYSAPPEND >> directives in the same way. Which is the proper way? Either way, >> this should be clarified in the documentation. > > To be clear: core treats the value as always hexidecimal while simple > menu treats it as decimal unless a 0x prefix is present.Correction: simple menu always does decimal (as should be expected).>> com32/elflink/ldlinux/readconfig.c: >> } else if ((ep = looking_at(p, "ipappend")) || >> (ep = looking_at(p, "sysappend"))) { >> uint32_t s = strtoul(skipspace(ep), NULL, 16); >> if (ld.label) >> ld.ipappend = s; >> else >> SysAppends = s; >> >> com32/menu/readconfig.c >> } else if ((ep = looking_at(p, "ipappend")) || (ep >> looking_at(p, "sysappend"))) { >> if (ld.label) >> ld.ipappend = atoi(skipspace(ep)); >> else >> ipappend = atoi(skipspace(ep)); >> >> -- >> -Gene
Matt Fleming
2013-Jun-26 10:11 UTC
[syslinux] [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
On Sun, 23 Jun, at 11:21:45PM, Gene Cumm wrote:> Correction: simple menu always does decimal (as should be expected). > > >> com32/elflink/ldlinux/readconfig.c: > >> } else if ((ep = looking_at(p, "ipappend")) || > >> (ep = looking_at(p, "sysappend"))) { > >> uint32_t s = strtoul(skipspace(ep), NULL, 16); > >> if (ld.label) > >> ld.ipappend = s; > >> else > >> SysAppends = s;This looks incorrect to me, and is likely a regression in the 5.x code. It appears as though the 4.x parser treated the ipappend string as decimal. Peter, does this look incorrect to you too? The com32/menu code gets this right. -- Matt Fleming, Intel Open Source Technology Center
H. Peter Anvin
2013-Jun-26 15:33 UTC
[syslinux] [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
It is wrong, but it wasn't decimal either. The right answer is to use strtoul with a base of 0. Matt Fleming <matt at console-pimps.org> wrote:>On Sun, 23 Jun, at 11:21:45PM, Gene Cumm wrote: >> Correction: simple menu always does decimal (as should be expected). >> >> >> com32/elflink/ldlinux/readconfig.c: >> >> } else if ((ep = looking_at(p, "ipappend")) || >> >> (ep = looking_at(p, "sysappend"))) { >> >> uint32_t s = strtoul(skipspace(ep), NULL, 16); >> >> if (ld.label) >> >> ld.ipappend = s; >> >> else >> >> SysAppends = s; > >This looks incorrect to me, and is likely a regression in the 5.x code. >It appears as though the 4.x parser treated the ipappend string as >decimal. > >Peter, does this look incorrect to you too? The com32/menu code gets >this right.-- Sent from my mobile phone. Please excuse brevity and lack of formatting.
Possibly Parallel Threads
- [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
- [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
- [bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
- [5.11-pre1] SYSAPPEND does not work (IPAPPEND alias works)
- [5.11-pre1] SYSAPPEND does not work (IPAPPEND alias works)