mt7621 编译报错:expected 'struct sockaddr *' but argument is of type 'struct sockaddr_unsized *'

Closed Beginner friendly
#14,283 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
networking

Research direction

The build error points to drivers/net/ethernet/mt7621-vendor/mtk_hnat/hnat_mcast.c:244, in hnat_mcast_netlink_open, after commit 3e55a98. Read that call and the bind function's expected argument type, then compare the relevant socket address declarations. Done when the Xiaomi AC2100 MT7621 build passes this compilation step without the incompatible pointer type error.

Written by the indexing model from the issue text.

Description

详细叙述

在 3e55a98 后出现该错误

重复 issue
  • 没有类似的 issue
具体型号

小米AC2100

详细日志

drivers/net/ethernet/mt7621-vendor/mtk_hnat/hnat_mcast.c: In function 'hnat_mcast_netlink_open':
drivers/net/ethernet/mt7621-vendor/mtk_hnat/hnat_mcast.c:244:37: error: passing argument 2 of 'sock->ops->bind' from incompatible pointer type [-Werror=incompatible-pointer-types]
244 | ret = sock->ops->bind(sock, (struct sockaddr_unsized *)&addr, sizeof(addr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| struct sockaddr_unsized *
drivers/net/ethernet/mt7621-vendor/mtk_hnat/hnat_mcast.c:244:37: note: expected 'struct sockaddr *' but argument is of type 'struct sockaddr_unsized *'
cc1: all warnings being treated as errors
make[12]: *** [scripts/Makefile.build:287: drivers/net/ethernet/mt7621-vendor/mtk_hnat/hnat_mcast.o] Error 1
make[11]: *** [scripts/Makefile.build:544: drivers/net/ethernet/mt7621-vendor/mtk_hnat] Error 2
make[10]: *** [scripts/Makefile.build:544: drivers/net/ethernet/mt7621-vendor] Error 2
make[9]: *** [scripts/Makefile.build:544: drivers/net/ethernet] Error 2
make[8]: *** [scripts/Makefile.build:544: drivers/net] Error 2
make[7]: *** [scripts/Makefile.build:544: drivers] Error 2

Dominant language
C
Stars
31.6k
Forks
19k
Avg merge
1d 16m
Merged PRs (30d)
7

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coolsnowwolf/lede

All issues in coolsnowwolf/lede

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.