This commit is contained in:
KusakabeSi 2021-08-24 14:08:32 +00:00
parent 6b563b5ad5
commit c4183ca924
3 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
go.sum
etherguard-go
vendor
.ipynb_checkpoints

View File

@ -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

View File

@ -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{