This commit is contained in:
mzz2017 2023-02-07 23:52:37 +08:00
parent c49ca89683
commit 00d42d1a6f
3 changed files with 4 additions and 4 deletions

View File

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

View File

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