From 00d42d1a6ff7bc360add8a25f17007ca7099898d Mon Sep 17 00:00:00 2001 From: mzz2017 <2017@duck.com> Date: Tue, 7 Feb 2023 23:52:37 +0800 Subject: [PATCH] chore --- control/{objects.go => bpf_subobjects.go} | 2 +- control/{objects.tmpl => bpf_subobjects.tmpl} | 0 control/control_plane_core.go | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename control/{objects.go => bpf_subobjects.go} (98%) rename control/{objects.tmpl => bpf_subobjects.tmpl} (100%) diff --git a/control/objects.go b/control/bpf_subobjects.go similarity index 98% rename from control/objects.go rename to control/bpf_subobjects.go index fabe0b1..596f0a2 100644 --- a/control/objects.go +++ b/control/bpf_subobjects.go @@ -20,7 +20,7 @@ type ProgField struct { Ebpf string } -//go:embed objects.tmpl +//go:embed bpf_subobjects.tmpl var tmpl []byte func generate(output string) error { diff --git a/control/objects.tmpl b/control/bpf_subobjects.tmpl similarity index 100% rename from control/objects.tmpl rename to control/bpf_subobjects.tmpl diff --git a/control/control_plane_core.go b/control/control_plane_core.go index 25fa940..df6b312 100644 --- a/control/control_plane_core.go +++ b/control/control_plane_core.go @@ -46,7 +46,7 @@ func (c *ControlPlaneCore) Close() (err error) { return err } -func getifParamsFromLink(link netlink.Link) (ifParams bpfIfParams, err error) { +func getIfParamsFromLink(link netlink.Link) (ifParams bpfIfParams, err error) { // TODO: We should monitor IP change of the link. ipnets, err := netlink.AddrList(link, netlink.FAMILY_ALL) if err != nil { @@ -136,7 +136,7 @@ func (c *ControlPlaneCore) bindLan(ifname string) error { `).Run() }) /// Insert an elem into IfindexParamsMap. - ifParams, err := getifParamsFromLink(link) + ifParams, err := getIfParamsFromLink(link) if err != nil { return err } @@ -218,7 +218,7 @@ func (c *ControlPlaneCore) bindWan(ifname string) error { return fmt.Errorf("cannot bind to loopback interface") } /// Insert an elem into IfindexParamsMap. - ifParams, err := getifParamsFromLink(link) + ifParams, err := getIfParamsFromLink(link) if err != nil { return err }