LKML Archive on
help / color / mirror / Atom feed
From: "Kevin Nicoll" <>
Subject: Multiple ip= boot arguments?
Date: Mon, 29 Jan 2007 12:36:33 -0600	[thread overview]
Message-ID: <> (raw)


I am using kernel 2.6.18, and have been trying without success to set
up multiple network interfaces using kernel boot arguments.  It makes
sense to be able to specify multiple interface configurations on the
command line, but it has occurred to me that I may not be correctly
understanding the purpose of the "ip=" parameter.  My question is if
it is intended to be able to use more than one "ip=" parameter in the
kernel command line, or if I'm supposed to use a startup script

I have been testing this using a variety of different boot command
lines, and it appears to me that the only network interface that ever
gets brought up by the kernel is the one defined in the last "ip="
parameter.  Here is some example output with debugging messages
enabled (lines beginning with "IP-Config(me):" are lines I added to
help with my understanding):

LINUX started...
 UART clock set to 50000000
 Linux version 2.6.18-pmc (nicollke@mozart) (gcc version 3.4.5) #46
PREEMPT Fri Jan 26 14:36:58 CST 2007
 Kernel command line: console=ttyS0,57600
 IP-Config(me): Parsing
 IP-Config: Parameter #0: `'
 IP-Config: Parameter #5: `eth1'
 IP-Config: Parameter #6: `none'
 IP-Config: Parameter #7: `100fs'
 IP-Config(me): Parsing
 IP-Config: Parameter #0: `'
 IP-Config: Parameter #4: `pmcgw'
 IP-Config: Parameter #5: `eth0'
 IP-Config: Parameter #6: `none'
 IP-Config: Parameter #7: `an'
IP-Config: Entered.
IP-Config(me): Trying to bring up eth0
IP-Config(me): Got inside!
MSPETH (init_cmdline) eth0: boot = console=ttyS0,57600
ip=, option = 00
MSPETH (init_cmdline) eth0: boot = console=ttyS0,57600
ip=, option = 00
MSPETH (init_phyaddr): hwunit = 0, phystr prom = "0:5"
MSPETH (queue_init) eth0:FD_base = a11a6000
arc 0x4: 000700e0
arc 0x8: 04000007
MSPETH eth0: Auto Negotiation... done.
MSPETH eth0: Waiting for carrier ... carrier detected.
MSPETH eth0: Autoneg, Link up, linkspeed 100Mbps, Full Duplex
IP-Config: eth0 UP (able=1, xid=4d9cf06a)
IP-Config(me): Trying to bring up eth1
IP-Config(me): Trying to bring up lo
IP-Config(me): Trying to bring up dummy0
IP-Config: Guessing netmask
arc 0xc: 01005e00
arc 0x10: 0001e307
IP-Config: Complete:
      device=eth0, addr=, mask=, gw=,
     host=pmcgw, domain=, nis-domain=(none),
     bootserver=, rootserver=, rootpath=
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 156k freed

The problem seems to be in the ic_open_devs() function in ipconfig.c,
which is the function responsible for actually starting up the network
interfaces.  I have copied function out below for your convenience:

static int __init ic_open_devs(void)
	struct ic_device *d, **last;
	struct net_device *dev;
	unsigned short oflags;

	last = &ic_first_dev;

	/* bring loopback device up first */
	if (dev_change_flags(&loopback_dev, loopback_dev.flags | IFF_UP) < 0)
		printk(KERN_ERR "IP-Config: Failed to open %s\n",;

	for (dev = dev_base; dev; dev = dev->next) {
		printk(KERN_WARNING "IP-Config(me): Trying to bring up %s\n", dev->name);
		if (dev == &loopback_dev)
		if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) :
		    (!(dev->flags & IFF_LOOPBACK) &&
		     (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) &&
		     strncmp(dev->name, "dummy", 5))) {
			printk(KERN_WARNING "IP-Config(me): Got inside!\n");
			int able = 0;
			if (dev->mtu >= 364)
				able |= IC_BOOTP;
				printk(KERN_WARNING "DHCP/BOOTP: Ignoring device %s, MTU %d too
small", dev->name, dev->mtu);
			if (!(dev->flags & IFF_NOARP))
				able |= IC_RARP;
			able &= ic_proto_enabled;
			if (ic_proto_enabled && !able)
			oflags = dev->flags;
			if (dev_change_flags(dev, oflags | IFF_UP) < 0) {
				printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name);
			if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) {
				return -1;
			d->dev = dev;
			*last = d;
			last = &d->next;
			d->flags = oflags;
			d->able = able;
			if (able & IC_BOOTP)
				get_random_bytes(&d->xid, sizeof(u32));
				d->xid = 0;
			ic_proto_have_if |= able;
			DBG(("IP-Config: %s UP (able=%d, xid=%08x)\n",
				dev->name, able, d->xid));

	*last = NULL;

	if (!ic_first_dev) {
		if (user_dev_name[0])
			printk(KERN_ERR "IP-Config: Device `%s' not found.\n", user_dev_name);
			printk(KERN_ERR "IP-Config: No network devices available.\n");
		return -1;
	return 0;

Given the looping structure, I would like to assume that multiple
"ip=" parameters are intended to be supported.  However, for some
reason, eth1 fails the if condition inside the loop, resulting in it
not being initialized.  This happens for any number of "ip="
parameters that I define:  the first few defined "ip=" parameters do
not meet the condition and are not brought online, but the last "ip="
parameter meets the condition and is brought online.

Please CC comments and replies to me.  Any replies or feedback for
this issue is greatly appreciated.


             reply	other threads:[~2007-01-29 18:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 18:36 Kevin Nicoll [this message]
2007-01-29 20:48 ` Jan Engelhardt
2007-01-30  0:00   ` H. Peter Anvin
2007-01-30  0:24     ` Chris Friesen
2007-01-30  0:27       ` H. Peter Anvin
     [not found]   ` <>
2007-01-30  9:07     ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: Multiple ip= boot arguments?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).