Bug 230886 - 12-ALPHA3 r338309: nooptions INET6 causes kernel build error in al_eth.c
Summary: 12-ALPHA3 r338309: nooptions INET6 causes kernel build error in al_eth.c
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Many People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-25 08:34 UTC by O. Hartmann
Modified: 2019-01-11 01:51 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2018-08-25 08:34:24 UTC
I'm trying to build a kernel for PINE64 (aarch64) and I run into this error while
building a customised kernel:

[...]
al_eth.c:1262:14: error: invalid application of 'sizeof' to an incomplete
type 'struct ip6_hdr' ip_hlen = sizeof(struct ip6_hdr)

when "nooptions INET6" is given in the kernel config file.

Leaving "options INET6" as it is from GENERIC or disabling al_eth via

nodevice al_eth

in the kernel config solves the problem.

Build system is FreeBSD 12.0-ALPHA3 #455 r338309: Sat Aug 25 07:10:45 CEST 2018 amd64, sources are at r338309.
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2018-08-25 10:28:32 UTC
Hi,

Thanks, I've added Marcin as iirc Semihalf did the annapurna port.
I'll have a look myself if Marcin can't
Comment 2 mw 2018-08-28 06:27:04 UTC
Hi,

We will fix it - thank you for the report.

Marcin
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-08-28 17:09:53 UTC
A commit references this bug:

Author: mw
Date: Tue Aug 28 17:09:41 UTC 2018
New revision: 338351
URL: https://svnweb.freebsd.org/changeset/base/338351

Log:
  Use ip/ipv6 structures in al_eth only if they are supported

  The ip/ipv6 header files are included only if the appropriate definition
  exists, but the driver was missing similar checks when using the
  ip and ip6_hdr structures.

  If the kernel was not built with the INET or INET6 option, the driver
  was preventing kernel from being built.

  To fix that, the missing ifdef checks were added to the driver.

  PR: Bug 230886
  Submitted by: Michal Krawczyk <mk@semihalf.com>
  Reported by: O. Hartmann
  Approved by: re (gjb)
  Obtained from: Semihalf
  MFC after: 1 week
  Sponsored by: Amazon, Inc.

Changes:
  head/sys/dev/al_eth/al_eth.c