wg-quick: freebsd: allow loopback to work
FreeBSD adds a route for point-to-point destination addresses. We don't really want to specify any destination address, but unfortunately we have to. Before we tried to cheat by giving our own address as the destination, but this had the unfortunate effect of preventing loopback from working on our local ip address. We work around this with yet another kludge: we set the destination address to 127.0.0.1. Since 127.0.0.1 is already assigned to an interface, this has the same effect of not specifying a destination address, and therefore we accomplish the intended behavior. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
		
							parent
							
								
									a6e4ec487d
								
							
						
					
					
						commit
						3f7a31faea
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -158,7 +158,7 @@ add_addr() {
 | 
				
			||||||
	if [[ $1 == *:* ]]; then
 | 
						if [[ $1 == *:* ]]; then
 | 
				
			||||||
		cmd ifconfig "$INTERFACE" inet6 "$1" alias
 | 
							cmd ifconfig "$INTERFACE" inet6 "$1" alias
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		cmd ifconfig "$INTERFACE" inet "$1" "${1%%/*}" alias
 | 
							cmd ifconfig "$INTERFACE" inet "$1" 127.0.0.1 alias
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue