fix: problem that cannot proxy lan_interface

This commit is contained in:
mzz2017
2023-02-01 10:24:11 +08:00
parent db50c80a96
commit 18e1eeea80
4 changed files with 5 additions and 4 deletions

View File

@ -53,4 +53,5 @@ See [example.dae](https://github.com/v2rayA/dae/blob/main/example.dae).
1. Handle the case that nodes do not support UDP. 1. Handle the case that nodes do not support UDP.
1. L4Checksum problem. 1. L4Checksum problem.
1. Config support list like: `wan_interface: [wlp5s0, eth0]`. 1. Config support list like: `wan_interface: [wlp5s0, eth0]`.
1. MACv2 extension extraction.
1. ... 1. ...

View File

@ -104,7 +104,7 @@ type bpfObjectsLan struct {
bpfMaps bpfMaps
} }
func AssignBpfPrograms(to *bpfObjects, from interface{}) { func AssignBpfObjects(to *bpfObjects, from interface{}) {
vTo := reflect.Indirect(reflect.ValueOf(to)) vTo := reflect.Indirect(reflect.ValueOf(to))
vFrom := reflect.Indirect(reflect.ValueOf(from)) vFrom := reflect.Indirect(reflect.ValueOf(from))
tFrom := vFrom.Type() tFrom := vFrom.Type()

View File

@ -125,7 +125,7 @@ retryLoadBpf:
} }
if kernelVersion.Less(consts.FtraceFeatureVersion) { if kernelVersion.Less(consts.FtraceFeatureVersion) {
// Reverse takeover. // Reverse takeover.
AssignBpfPrograms(&bpf, &bpfLan) AssignBpfObjects(&bpf, &bpfLan)
} }
// Write params. // Write params.
@ -581,7 +581,7 @@ func (c *ControlPlane) ListenAndServe(port uint16) (err error) {
go func() { go func() {
defer cancel() defer cancel()
for { for {
var buf [65536]byte var buf [65535]byte
n, lAddrPort, err := lConn.ReadFromUDPAddrPort(buf[:]) n, lAddrPort, err := lConn.ReadFromUDPAddrPort(buf[:])
if err != nil { if err != nil {
if !strings.Contains(err.Error(), "use of closed network connection") { if !strings.Contains(err.Error(), "use of closed network connection") {

View File

@ -566,7 +566,7 @@ static __always_inline int get_tproxy_ip(__u8 ipversion, __u32 ifindex,
return 0; return 0;
} }
static __always_inline int ip_is_host(bool ipversion, __u32 ifindex, static __always_inline int ip_is_host(__u8 ipversion, __u32 ifindex,
__be32 ip[4], __be32 tproxy_ip[4]) { __be32 ip[4], __be32 tproxy_ip[4]) {
if (tproxy_ip) { if (tproxy_ip) {
int ret; int ret;