Skip to content

Commit

Permalink
docs: improve docs about pppoe and mark (#305)
Browse files Browse the repository at this point in the history
Co-authored-by: kev <yqlbu@bu.edu>
Co-authored-by: dae-bot[bot] <136105375+dae-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 2, 2023
1 parent a333079 commit b9b1624
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 107 deletions.
4 changes: 4 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ loop:
sdnotify.Ready()
continue
}
newConf.Global = deepcopy.Copy(conf.Global).(config.Global)
newConf.Global.WanInterface = nil
newConf.Global.LanInterface = nil
newConf.Global.LogLevel = "warning"
} else {
var includes []string
newConf, includes, err = readConfig(cfgFile)
Expand Down
4 changes: 2 additions & 2 deletions common/consts/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ const (
)

const (
LinkType_None uint32 = iota
LinkType_Ethernet
LinkHdrLen_None uint32 = 0
LinkHdrLen_Ethernet uint32 = 14
)
9 changes: 5 additions & 4 deletions control/control_plane_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,16 @@ func (c *controlPlaneCore) mapLinkType(ifname string) error {
if err != nil {
return err
}
linkType := uint32(0xffff)
var linkHdrLen uint32
switch link.Attrs().EncapType {
case "none":
linkType = consts.LinkType_None
linkHdrLen = consts.LinkHdrLen_None
case "ether":
linkType = consts.LinkType_Ethernet
linkHdrLen = consts.LinkHdrLen_Ethernet
default:
return nil
}
return c.bpf.bpfMaps.LinktypeMap.Update(uint32(link.Attrs().Index), linkType, ebpf.UpdateAny)
return c.bpf.bpfMaps.LinklenMap.Update(uint32(link.Attrs().Index), linkHdrLen, ebpf.UpdateAny)
}

func (c *controlPlaneCore) addQdisc(ifname string) error {
Expand Down
Loading

0 comments on commit b9b1624

Please sign in to comment.