Fixed incomming initiation bug
This commit is contained in:
		
							parent
							
								
									44c9896883
								
							
						
					
					
						commit
						9c4acb9f35
					
				@ -18,9 +18,7 @@ func main() {
 | 
			
		||||
	}
 | 
			
		||||
	deviceName := os.Args[1]
 | 
			
		||||
 | 
			
		||||
	// Open TUN device
 | 
			
		||||
 | 
			
		||||
	// TODO: Fix capabilities
 | 
			
		||||
	// open TUN device
 | 
			
		||||
 | 
			
		||||
	tun, err := CreateTUN(deviceName)
 | 
			
		||||
	log.Println(tun, err)
 | 
			
		||||
@ -29,8 +27,9 @@ func main() {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	device := NewDevice(tun, LogLevelDebug)
 | 
			
		||||
	device.log.Info.Println("Starting device")
 | 
			
		||||
 | 
			
		||||
	// Start configuration lister
 | 
			
		||||
	// start configuration lister
 | 
			
		||||
 | 
			
		||||
	socketPath := fmt.Sprintf("/var/run/wireguard/%s.sock", deviceName)
 | 
			
		||||
	l, err := net.Listen("unix", socketPath)
 | 
			
		||||
 | 
			
		||||
@ -358,11 +358,13 @@ func (device *Device) RoutineHandshake() {
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				logDebug.Println("Creating response...")
 | 
			
		||||
 | 
			
		||||
				outElem := device.NewOutboundElement()
 | 
			
		||||
				writer := bytes.NewBuffer(outElem.data[:0])
 | 
			
		||||
				binary.Write(writer, binary.LittleEndian, response)
 | 
			
		||||
				elem.packet = writer.Bytes()
 | 
			
		||||
				peer.mac.AddMacs(elem.packet)
 | 
			
		||||
				outElem.packet = writer.Bytes()
 | 
			
		||||
				peer.mac.AddMacs(outElem.packet)
 | 
			
		||||
				addToOutboundQueue(peer.queue.outbound, outElem)
 | 
			
		||||
 | 
			
		||||
			case MessageResponseType:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user