Opened 14 years ago

Closed 14 years ago

#5189 closed enhancement (fixed)

[PATCH] openfirmware: Provide fallback for DHCP

Reported by: andreasf Owned by: axeld
Priority: normal Milestone: R1
Component: System/Boot Loader Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: PowerPC

Description

The IP address (e.g., for communicating with remote disk servers) is currently taken from /chosen/dhcp-response, which is commented as non-standardized.

On my PowerMac G3 b&w, DHCP does not work at all. I need to either specify it as part of the boot command or set a default for it in default-client-ip.

If we don't have the binary address in /chosen/dhcp-response, try to parse the address from /options/default-client-ip.

Attachments (2)

network-ipaddress.diff (2.0 KB ) - added by andreasf 14 years ago.
patch
network-ipaddress-v2.diff (2.5 KB ) - added by andreasf 14 years ago.
patch

Download all attachments as: .zip

Change History (7)

by andreasf, 14 years ago

Attachment: network-ipaddress.diff added

patch

comment:1 by stippi, 14 years ago

Resolution: fixed
Status: newclosed

Applied in hrev34850. (Small changes to keep pointer style consistent.)

comment:2 by axeld, 14 years ago

Thanks for the patch, but please have another look at our coding style: cryptic names like "sz" or "psz" must not be used.

comment:3 by andreasf, 14 years ago

Thanks to both of you, I'll rework it after a short vacation.

And I'll try extracting the IP from the boot path as well.

by andreasf, 14 years ago

Attachment: network-ipaddress-v2.diff added

patch

comment:4 by andreasf, 14 years ago

Resolution: fixed
Status: closedreopened

For the record, Axel has reworked the code in hrev34870.

Attached is a new patch which:

  • fixes Coding Style issues pointed out by Axel
  • fixes a potential buffer overflow and fault in my default-client-ip code path (OF counts terminating zero char, too)
  • adds an intermediate fallback to parsing the boot path
  • adds me to the file header, having added the second feature now (don't care about the exact format, cf. Coding Style)

comment:5 by stippi, 14 years ago

Resolution: fixed
Status: reopenedclosed

Applied in hrev34918. Thanks again!

Note: See TracTickets for help on using tickets.