Skip to content

Commit

Permalink
fix to support 32b platform
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Feb 25, 2024
1 parent 5d9bdb7 commit f674800
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,12 @@ jobs:
- name: Build the Docker image
run: |
docker build --build-arg VERSION=dev . --file Dockerfile -t go-dnscollector
docker32b:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: |
docker build --build-arg VERSION=dev . --platform linux/386 --file Dockerfile -t go-dnscollector
4 changes: 2 additions & 2 deletions dnsutils/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ func (dm *DNSMessage) ToDNSTap(extended bool) ([]byte, error) {
if dm.NetworkInfo.ResponsePort != "-" {
if port, err := strconv.Atoi(dm.NetworkInfo.ResponsePort); err != nil {
return nil, err
} else if port < 0 || port > math.MaxUint32 {
} else if port < 0 || port > 65535 {
return nil, errors.New("invalid response port value")
} else {
rport = uint32(port)
Expand All @@ -821,7 +821,7 @@ func (dm *DNSMessage) ToDNSTap(extended bool) ([]byte, error) {
if dm.NetworkInfo.QueryPort != "-" {
if port, err := strconv.Atoi(dm.NetworkInfo.QueryPort); err != nil {
return nil, err
} else if port < 0 || port > math.MaxUint32 {
} else if port < 0 || port > 65535 {
return nil, errors.New("invalid query port value")
} else {
qport = uint32(port)
Expand Down

0 comments on commit f674800

Please sign in to comment.