public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: Ian.Dall@dsto.defence.gov.au
Cc: "Torvalds; Linus" <torvalds@transmeta.com>,
	linux kernel <linux-kernel@vger.kernel.org>,
	alan@redhat.com
Subject: Re: IPCONFIG fails for BOOTP
Date: Thu, 30 Aug 2001 08:32:17 -0700	[thread overview]
Message-ID: <20010830083217.A8134@lucon.org> (raw)

This is the patch I have been using since May.


H.J.
----
--- linux-2.4.5-ac3-ext3/net/ipv4/ipconfig.c.dhcp	Tue May  1 20:59:24 2001
+++ linux-2.4.5-ac3-ext3/net/ipv4/ipconfig.c	Tue May 29 09:30:16 2001
@@ -816,61 +816,63 @@ static int __init ic_bootp_recv(struct s
 		u8 *ext;
 
 #ifdef IPCONFIG_DHCP
+		if (ic_proto_enabled & IC_USE_DHCP) {
 
-		u32 server_id = INADDR_NONE;
-		int mt = 0;
+			u32 server_id = INADDR_NONE;
+			int mt = 0;
 
-		ext = &b->exten[4];
-		while (ext < end && *ext != 0xff) {
-			u8 *opt = ext++;
-			if (*opt == 0)	/* Padding */
-				continue;
-			ext += *ext + 1;
-			if (ext >= end)
-				break;
-			switch (*opt) {
-			case 53:	/* Message type */
-				if (opt[1])
-					mt = opt[2];
-				break;
-			case 54:	/* Server ID (IP address) */
-				if (opt[1] >= 4)
-					memcpy(&server_id, opt + 2, 4);
-				break;
+			ext = &b->exten[4];
+			while (ext < end && *ext != 0xff) {
+				u8 *opt = ext++;
+				if (*opt == 0)	/* Padding */
+					continue;
+				ext += *ext + 1;
+				if (ext >= end)
+					break;
+				switch (*opt) {
+				case 53:	/* Message type */
+					if (opt[1])
+						mt = opt[2];
+					break;
+				case 54:	/* Server ID (IP address) */
+					if (opt[1] >= 4)
+						memcpy(&server_id, opt + 2, 4);
+					break;
+				}
 			}
-		}
 
 #ifdef IPCONFIG_DEBUG
-		printk("DHCP: Got message type %d\n", mt);
+			printk("DHCP: Got message type %d\n", mt);
 #endif
 
-		switch (mt) {
-		    case DHCPOFFER:
-			/* While in the process of accepting one offer,
-			   ignore all others. */
-			if (ic_myaddr != INADDR_NONE)
-				goto drop;
-			/* Let's accept that offer. */
-			ic_myaddr = b->your_ip;
-			ic_servaddr = server_id;
+			switch (mt) {
+			case DHCPOFFER:
+				/* While in the process of accepting one offer,
+				   ignore all others. */
+				if (ic_myaddr != INADDR_NONE)
+					goto drop;
+				/* Let's accept that offer. */
+				ic_myaddr = b->your_ip;
+				ic_servaddr = server_id;
 #ifdef IPCONFIG_DEBUG
-			printk("DHCP: Offered address %u.%u.%u.%u", NIPQUAD(ic_myaddr));
-			printk(" by server %u.%u.%u.%u\n", NIPQUAD(ic_servaddr));
+				printk("DHCP: Offered address %u.%u.%u.%u", NIPQUAD(ic_myaddr));
+				printk(" by server %u.%u.%u.%u\n", NIPQUAD(ic_servaddr));
 #endif
-			break;
+				break;
 
-		    case DHCPACK:
-			/* Yeah! */
-			break;
-
-		    default:
-			/* Urque.  Forget it*/
-			ic_myaddr = INADDR_NONE;
-			ic_servaddr = INADDR_NONE;
-			goto drop;
-		}
+			case DHCPACK:
+				/* Yeah! */
+				break;
+
+			default:
+				/* Urque.  Forget it*/
+				ic_myaddr = INADDR_NONE;
+				ic_servaddr = INADDR_NONE;
+				goto drop;
+			}
 
-		ic_dhcp_msgtype = mt;
+			ic_dhcp_msgtype = mt;
+		}
 
 #endif /* IPCONFIG_DHCP */
 

             reply	other threads:[~2001-08-30 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-30 15:32 H . J . Lu [this message]
2001-09-25 23:24 ` IPCONFIG fails for BOOTP David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2001-08-29  4:04 Ian Dall

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20010830083217.A8134@lucon.org \
    --to=hjl@lucon.org \
    --cc=Ian.Dall@dsto.defence.gov.au \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox