Skip to content

Commit

Permalink
replace google/gopacket with gopacket/gopacket
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Jun 21, 2024
1 parent 4500a25 commit 07f2331
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 74 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.20-bookworm AS build
FROM golang:1.22-alpine3.20 AS build
WORKDIR /app
COPY . .
RUN env GOBIN=/build go install .
RUN env CGO_ENABLED=0 GOBIN=/build go install .

FROM debian:bookworm
FROM scratch
COPY --from=build /build/* /
ENTRYPOINT ["/ndpresponder"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2021-2023, Junxiao Shi
Copyright (c) 2021-2024, Junxiao Shi

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ See my [blog post](https://yoursunny.com/t/2021/ndpresponder/) for more informat
## Installation

This program is written in Go.
It requires both Go compiler and C compiler.
You can compile and install this program with:

```bash
Expand All @@ -21,8 +20,8 @@ go install github.com/yoursunny/ndpresponder@main
This program is also available as a Docker container:

```bash
docker build -t ndpresponder 'github.com/yoursunny/ndpresponder#main'
docker run -d --name ndpresponder --network host ndpresponder [arguments]
docker build -t localhost/ndpresponder 'github.com/yoursunny/ndpresponder#main'
docker run -d --name localhost/ndpresponder --network host ndpresponder [arguments]
```

## Static Mode
Expand Down Expand Up @@ -56,7 +55,7 @@ docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--cap-drop=ALL --cap-add=NET_RAW --cap-add=NET_ADMIN \
--network host --name ndpresponder \
ndpresponder -i eth0 -N ipv6exposed
localhost/ndpresponder -i eth0 -N ipv6exposed
```

* `-i` flag specifies the network interface name.
Expand Down
27 changes: 13 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
module github.com/yoursunny/ndpresponder

go 1.20
go 1.22

require (
github.com/fsouza/go-dockerclient v1.9.7
github.com/google/gopacket v1.1.19
github.com/urfave/cli/v2 v2.25.7
github.com/fsouza/go-dockerclient v1.11.0
github.com/gopacket/gopacket v1.2.0
github.com/urfave/cli/v2 v2.27.2
github.com/vishvananda/netlink v1.2.1-beta.2
go.uber.org/zap v1.24.0
golang.org/x/net v0.11.0
golang.org/x/sys v0.9.0
go.uber.org/zap v1.27.0
golang.org/x/net v0.26.0
golang.org/x/sys v0.21.0
inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/containerd/containerd v1.7.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/docker/docker v24.0.2+incompatible // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/docker/docker v25.0.4+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/opencontainers/runc v1.1.7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org/intern v0.0.0-20230525184215-6c62f75575cb // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect
Expand Down
Loading

0 comments on commit 07f2331

Please sign in to comment.