diff --git a/.gitignore b/.gitignore index cc21f2f..50092c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ go.sum etherguard-go +vendor .ipynb_checkpoints \ No newline at end of file diff --git a/Makefile b/Makefile index f296836..168fdfd 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ generate-version-and-build: @$(MAKE) etherguard-go etherguard-go: $(wildcard *.go) $(wildcard */*.go) + go mod vendor && \ + patch -p0 -i govpp_remove_crcstring_check.patch && \ go build -v -o "$@" install: etherguard-go diff --git a/govpp_remove_crcstring_check.patch b/govpp_remove_crcstring_check.patch new file mode 100644 index 0000000..2ed08da --- /dev/null +++ b/govpp_remove_crcstring_check.patch @@ -0,0 +1,20 @@ +--- vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go 2021-07-29 22:21:35.560204223 +0800 ++++ vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go 2021-07-30 04:53:13.528822544 +0800 +@@ -314,6 +314,8 @@ + for _, x := range reply.MessageTable { + msgName := strings.Split(x.Name, "\x00")[0] + name := strings.TrimSuffix(msgName, "\x13") ++ nameslice := strings.Split(name, "_") ++ name = strings.Join(nameslice[:len(nameslice)-1], "_") + c.msgTable[name] = x.Index + if strings.HasPrefix(name, "sockclnt_delete_") { + c.sockDelMsgId = x.Index +@@ -327,7 +329,7 @@ + } + + func (c *Client) GetMsgID(msgName string, msgCrc string) (uint16, error) { +- if msgID, ok := c.msgTable[msgName+"_"+msgCrc]; ok { ++ if msgID, ok := c.msgTable[msgName]; ok { + return msgID, nil + } + return 0, &adapter.UnknownMsgError{ \ No newline at end of file