mirror of
https://github.com/soypat/lneto.git
synced 2026-09-11 17:19:30 +00:00
V2 Netbird integration - UDP MIMO/SIMO, ICMPv6, DHCPv6 implementations (#106)
* begin adding udp.MuxHandler * add udp MuxHandlerSIMO/MIMO * add tcp rx shutdown * icmpv6 client * icmpv6 Client shared NDP/Echo preparation * icmpv6 client ndp/echo split * icmpv6 client ndp/echo split done * icmpv6 adjustments * add dhcpv6 stubs * dhcpv4 preliminary revision * add dns.NextLabel * dns label name tweaks * dns begin work on TCP client * add dnstcp package * apply gofmt changes * add udp mux tests * clean up, remove StackBig for now * remove dnstcp so as to merged confident parts and we continue dnstcp work elsewhere
This commit is contained in:
+16
-1
@@ -173,6 +173,20 @@ func (conn *Conn) OpenListen(localPort uint16, iss Value) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CloseRead activates local discard mode on the connection. Incoming data is
|
||||
// still ACKed normally but payload is dropped; future Read calls return io.EOF.
|
||||
// The write side is unaffected.
|
||||
func (conn *Conn) CloseRead() error {
|
||||
conn.mu.Lock()
|
||||
defer conn.mu.Unlock()
|
||||
err := conn.checkPipeOpen()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
conn.h.ShutdownRead()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (conn *Conn) Close() error {
|
||||
conn.mu.Lock()
|
||||
defer conn.mu.Unlock()
|
||||
@@ -294,10 +308,11 @@ func (conn *Conn) Read(b []byte) (int, error) {
|
||||
break
|
||||
} else {
|
||||
state := conn.h.State()
|
||||
rxRefuse := conn.h.shutdownRx
|
||||
conn.mu.Unlock()
|
||||
if state.IsClosed() {
|
||||
return n, net.ErrClosed
|
||||
} else if !state.RxDataOpen() {
|
||||
} else if !state.RxDataOpen() || rxRefuse {
|
||||
return n, io.EOF
|
||||
} else if conn.deadlineExceeded(&conn.rdead) {
|
||||
return n, errDeadlineExceeded
|
||||
|
||||
Reference in New Issue
Block a user