cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

fix(openbsd): fix mtu on newline in hostname files

Open tobias-urdin opened this issue 1 year ago • 6 comments

Proposed Commit Message

fix(openbsd): fix mtu on newline in hostname files

The /etc/hostname.* files should have the mtu on
a separate line otherwise it gives error:

  ifconfig: mtu: bad value

The lines are executed in order by ifconfig and
mtu should be on it's own line.

Fixes: GH-5413

Additional Context

Test Steps

use cloud-init with a config drive instead of dhcp

Merge type

  • [x] Squash merge using "Proposed Commit Message"
  • [ ] Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

tobias-urdin avatar Jun 19 '24 11:06 tobias-urdin

@tobias-urdin , thanks for the PR. Changes look good to me according to https://man.openbsd.org/ifconfig.8 .

Before we can accept your change, you need to sign the CLA and add your Github username (alphabetically) to the cla signers file . The full details are described in the documentation

TheRealFalcon avatar Jun 20 '24 15:06 TheRealFalcon

@tobias-urdin , thanks for the PR. Changes look good to me according to https://man.openbsd.org/ifconfig.8 .

Before we can accept your change, you need to sign the CLA and add your Github username (alphabetically) to the cla signers file . The full details are described in the documentation

Thanks, done now.

tobias-urdin avatar Jun 23 '24 12:06 tobias-urdin

@igalic Hey Meena, would you mind taking a peak at this PR please?

holmanb avatar Jun 24 '24 15:06 holmanb

@tobias-urdin thank you for this contribution! Would you mind modifying your PR description so that it matches the expected PR template/format?

PULL_REQUEST_TEMPLATE.md

a-dubs avatar Jun 25 '24 12:06 a-dubs

@tobias-urdin thank you for this contribution! Would you mind modifying your PR description so that it matches the expected PR template/format?

PULL_REQUEST_TEMPLATE.md

Done.

tobias-urdin avatar Jun 26 '24 08:06 tobias-urdin

@tobias-urdin thank you so much!!

a-dubs avatar Jun 26 '24 12:06 a-dubs

I'm going to go ahead and merge this as-is. Some excepts from the hostname.if manpage:

Any lines not matching these packed formats are passed directly to ifconfig(8).Any lines not matching these packed formats are passed directly to ifconfig(8). The packed formats are converted using a somewhat inflexible parser and the administrator should not expect magic — if in doubt study ifconfig(8) and the per-driver manual pages to see what arguments are permitted.

Further down:

Regular IPv4 network setup:
inet [alias] addr netmask broadcast_addr options

and

options
    Miscellaneous options to set on the interface...Valid options for a particular interface type can be found in [ifconfig(8)](https://man.openbsd.org/ifconfig.8). When used, the netmask and broadcast_addr options must also be present.

As currently implemented, broadcast_addr is NOT present, so an mtu option on the same line is not valid, thus the newline is required.

If an option including the broadcast_addr and mtu on the same line is preferred, that could be added in a later PR.

TheRealFalcon avatar Jul 03 '24 19:07 TheRealFalcon