Opened 9 years ago

Closed 9 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:
Has a Patch: no 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 9 years ago.
patch
network-ipaddress-v2.diff (2.5 KB) - added by andreasf 9 years ago.
patch

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by andreasf

Attachment: network-ipaddress.diff added

patch

comment:1 Changed 9 years ago by stippi

Resolution: fixed
Status: newclosed

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

comment:2 Changed 9 years ago by axeld

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 Changed 9 years ago by andreasf

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.

Changed 9 years ago by andreasf

Attachment: network-ipaddress-v2.diff added

patch

comment:4 Changed 9 years ago by andreasf

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 Changed 9 years ago by stippi

Resolution: fixed
Status: reopenedclosed

Applied in hrev34918. Thanks again!

Note: See TracTickets for help on using tickets.