Skip to content

Commit

Permalink
refactor/fix: match dscp instead of tos (daeuniverse#294)
Browse files Browse the repository at this point in the history
Co-authored-by: dae-bot[bot] <136105375+dae-bot[bot]@users.noreply.github.com>
  • Loading branch information
mzz2017 and dae-prow[bot] committed Aug 20, 2023
1 parent 5c9e0cf commit c6557ce
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 128 deletions.
2 changes: 1 addition & 1 deletion cmd/honk.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ var (

func init() {
rootCmd.AddCommand(honkCmd)
}
}
2 changes: 1 addition & 1 deletion common/consts/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
MatchType_IpVersion
MatchType_Mac
MatchType_ProcessName
MatchType_Tos
MatchType_Dscp
MatchType_Fallback
MatchType_MustRules

Expand Down
2 changes: 1 addition & 1 deletion common/consts/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
Function_IpVersion = "ipversion"
Function_Mac = "mac"
Function_ProcessName = "pname"
Function_Tos = "tos"
Function_Dscp = "dscp"

Function_QName = "qname"
Function_QType = "qtype"
Expand Down
2 changes: 1 addition & 1 deletion component/routing/function_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func UintParserFactory[T constraints.Unsigned](callback func(f *config_parser.Fu
return func(log *logrus.Logger, f *config_parser.Function, key string, paramValueGroup []string, overrideOutbound *Outbound) (err error) {
var values []T
for _, v := range paramValueGroup {
val, err := strconv.ParseUint(v, 10, 8*size)
val, err := strconv.ParseUint(v, 0, 8*size)
if err != nil {
return fmt.Errorf("cannot parse %v: %w", v, err)
}
Expand Down
1 change: 1 addition & 0 deletions control/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ func (c *ControlPlane) Serve(readyChan chan<- bool, listener *Listener) (err err
Outbound: uint8(consts.OutboundControlPlaneRouting),
Pname: [16]uint8{},
Pid: 0,
Dscp: 0,
}
realDst = pktDst
goto destRetrieved
Expand Down
2 changes: 1 addition & 1 deletion control/dns_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte
"_qname": qname,
"qtype": qtype,
"pid": req.routingResult.Pid,
"tos": req.routingResult.Tos,
"dscp": req.routingResult.Dscp,
"pname": ProcessName2String(req.routingResult.Pname[:]),
"mac": Mac2String(req.routingResult.Mac[:]),
}
Expand Down
Loading

0 comments on commit c6557ce

Please sign in to comment.