~ubuntu-branches/ubuntu/wily/grub2/wily-proposed

« back to all changes in this revision

Viewing changes to fs/i386/pc/pxe.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Zielcke, Robert Millan, Felix Zielcke
  • Date: 2010-01-26 19:26:25 UTC
  • mfrom: (1.13.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126192625-coq6czap2ofjollf
Tags: 1.98~20100126-1
* New Bazaar snapshot.
  - Includes mipsel-yeeloong port.

[ Robert Millan ]
* config.in: Lower priority of grub2/linux_cmdline_default.

[ Felix Zielcke ]
* Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now.
* Ship grub-bin2h and grub-script-check in grub-common.
* Terminate NEWS.Debian with a blank line like lintian would suggest
  if that check would be working correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
 
357
357
  for (i = 0; i < mac_len; i++)
358
358
    {
359
 
      grub_sprintf (ptr, "%02x:", mac_addr[i] & 0xff);
 
359
      grub_snprintf (ptr, sizeof (buf) - (ptr - buf),
 
360
                     "%02x:", mac_addr[i] & 0xff);
360
361
      ptr += (sizeof ("XX:") - 1);
361
362
    }
362
363
  if (mac_len)
483
484
{
484
485
  char buf[sizeof ("XXX.XXX.XXX.XXX")];
485
486
 
486
 
  grub_sprintf (buf, "%d.%d.%d.%d", (ip & 0xff),
487
 
                (ip >> 8) & 0xff, (ip >> 16) & 0xff, (ip >> 24) & 0xff);
 
487
  grub_snprintf (buf, sizeof (buf), "%d.%d.%d.%d", (ip & 0xff),
 
488
                 (ip >> 8) & 0xff, (ip >> 16) & 0xff, (ip >> 24) & 0xff);
488
489
  grub_env_set (varname, buf);
489
490
}
490
491
 
500
501
    return 0;
501
502
 
502
503
  /* Normalize the IP.  */
503
 
  buf = grub_malloc (sizeof ("XXX.XXX.XXX.XXX"));
 
504
  buf = grub_xasprintf ("%d.%d.%d.%d", (newip & 0xff), (newip >> 8) & 0xff,
 
505
                       (newip >> 16) & 0xff, (newip >> 24) & 0xff);
504
506
  if (!buf)
505
507
    return 0;
506
508
 
507
509
  *ip = newip;
508
510
 
509
 
  grub_sprintf (buf, "%d.%d.%d.%d", (newip & 0xff), (newip >> 8) & 0xff,
510
 
                (newip >> 16) & 0xff, (newip >> 24) & 0xff);
511
 
 
512
511
  return buf; 
513
512
}
514
513
 
544
543
  else if (size > GRUB_PXE_MAX_BLKSIZE)
545
544
    size = GRUB_PXE_MAX_BLKSIZE;
546
545
  
547
 
  buf = grub_malloc (sizeof ("XXXXXX XXXXXX"));
 
546
  buf = grub_xasprintf ("%d", size);
548
547
  if (!buf)
549
548
    return 0;
550
549
 
551
 
  grub_sprintf (buf, "%d", size);
552
550
  grub_pxe_blksize = size;
553
551
  
554
552
  return buf;
562
560
    {
563
561
      char *buf;
564
562
 
565
 
      buf = grub_malloc (sizeof ("XXXXXX XXXXXX"));
 
563
      buf = grub_xasprintf ("%d", grub_pxe_blksize);
566
564
      if (buf)
567
 
        {
568
 
          grub_sprintf (buf, "%d", grub_pxe_blksize);
569
 
          grub_env_set ("net_pxe_blksize", buf);
570
 
        }
 
565
        grub_env_set ("net_pxe_blksize", buf);
 
566
      grub_free (buf);
571
567
 
572
568
      set_ip_env ("pxe_default_server", grub_pxe_default_server_ip);
573
569
      set_ip_env ("pxe_default_gateway", grub_pxe_default_gateway_ip);