Skip to content

syscall: ztypes_linux_s390x.go: struct members with just underscore as names #18628

@sharkcz

Description

@sharkcz

Structure members in syscall/ztypes_linux_s390x.go that should have a underscore in their names contain only the underscore as the name. It results in error like

# github.com/vishvananda/netlink/nl
../../rpmbuild/BUILDROOT/golang-github-vishvananda-netlink-0-0.10.gite73bad4.fc26.s390x/usr/share/gocode/src/github.com/vishvananda/netlink/nl/nl_linux_test.go:34: msg.X__ifi_pad undefined (type *IfInfomsg has no field or method X__ifi_pad)
FAIL	github.com/vishvananda/netlink/nl [build failed]

For a downstream bug please see https://bugzilla.redhat.com/show_bug.cgi?id=1404679

https://github.com/golang/sys/blob/master/unix/ztypes_linux_s390x.go from the standalone sys package is wrong as well.

What version of Go are you using (go version)?

git

What operating system and processor architecture are you using (go env)?

Linux/s390x

What did you do?

compile eg. golang-github-vishvananda-netlink library

What did you expect to see?

type IfInfomsg struct {
		Family     uint8
		X__ifi_pad uint8
		Type       uint16
		Index      int32
		Flags      uint32
		Change     uint32
	}

for example on https://golang.org/src/syscall/ztypes_linux_ppc64.go

The corresponding kernel structure is defined in include/uapi/linux/rtnetlink.h as

struct ifinfomsg {
        unsigned char   ifi_family;
        unsigned char   __ifi_pad;
        unsigned short  ifi_type;               /* ARPHRD_* */
        int             ifi_index;              /* Link index   */
        unsigned        ifi_flags;              /* IFF_* flags  */
        unsigned        ifi_change;             /* IFF_* change mask */
};

What did you see instead?

from https://golang.org/src/syscall/ztypes_linux_s390x.go

type IfInfomsg struct {
		Family uint8
		_      uint8
		Type   uint16
		Index  int32
		Flags  uint32
		Change uint32
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions