Compare commits

...

5 Commits

Author SHA1 Message Date
David Anderson
dde7ba4ecf VERSION.txt: this is v1.4.1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-28 13:54:32 -08:00
Brad Fitzpatrick
fc30cff688 wgengine/router: don't configure IPv6 on Linux when IPv6 is unavailable
Fixes #1214

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit c7fc4a06da)
2021-01-28 13:45:59 -08:00
David Anderson
775fe13e27 cmd/tailscaled: add /run to the allowed paths for iptables.
Signed-off-by: David Anderson <danderson@tailscale.com>
(cherry picked from commit de497358b8)
2021-01-28 13:45:08 -08:00
Josh Bleecher Snyder
2e33fdfe67 types/logger: fix rateFree interaction with verbosity prefixes
We log lines like this:

c.logf("[v1] magicsock: disco: %v->%v (%v, %v) sent %v", c.discoShort, dstDisco.ShortString(), dstKey.ShortString(), derpStr(dst.String()), disco.MessageSummary(m))

The leading [v1] causes it to get unintentionally rate limited.
Until we have a proper fix, work around it.

Fixes #1216

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
(cherry picked from commit 1e28207a15)
2021-01-28 10:22:09 -08:00
David Anderson
3d7cff91b3 VERSION.txt: this is v1.4.0
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-27 15:40:21 -08:00
4 changed files with 19 additions and 6 deletions

View File

@@ -1 +1 @@
1.3.0
1.4.1

View File

@@ -34,6 +34,8 @@ ProtectHome=true
ProtectKernelTunables=true
ProtectSystem=strict
ReadWritePaths=/etc/
ReadWritePaths=/run/
ReadWritePaths=/var/run/
RestrictSUIDSGID=true
SystemCallArchitectures=native

View File

@@ -64,9 +64,9 @@ type limitData struct {
var disableRateLimit = os.Getenv("TS_DEBUG_LOG_RATE") == "all"
// rateFreePrefix are format string prefixes that are exempt from rate limiting.
// rateFree are format string substrings that are exempt from rate limiting.
// Things should not be added to this unless they're already limited otherwise.
var rateFreePrefix = []string{
var rateFree = []string{
"magicsock: disco: ",
"magicsock: CreateEndpoint:",
}
@@ -93,8 +93,8 @@ func RateLimitedFn(logf Logf, f time.Duration, burst int, maxCache int) Logf {
)
judge := func(format string) verdict {
for _, pfx := range rateFreePrefix {
if strings.HasPrefix(format, pfx) {
for _, sub := range rateFree {
if strings.Contains(format, sub) {
return allow
}
}

View File

@@ -366,7 +366,9 @@ func (r *linuxRouter) setNetfilterMode(mode NetfilterMode) error {
// address is already assigned to the interface, or if the addition
// fails.
func (r *linuxRouter) addAddress(addr netaddr.IPPrefix) error {
if !r.v6Available && addr.IP.Is6() {
return nil
}
if err := r.cmd.run("ip", "addr", "add", addr.String(), "dev", r.tunname); err != nil {
return fmt.Errorf("adding address %q to tunnel interface: %w", addr, err)
}
@@ -380,6 +382,9 @@ func (r *linuxRouter) addAddress(addr netaddr.IPPrefix) error {
// the address is not assigned to the interface, or if the removal
// fails.
func (r *linuxRouter) delAddress(addr netaddr.IPPrefix) error {
if !r.v6Available && addr.IP.Is6() {
return nil
}
if err := r.delLoopbackRule(addr.IP); err != nil {
return err
}
@@ -437,6 +442,9 @@ func (r *linuxRouter) delLoopbackRule(addr netaddr.IP) error {
// interface. Fails if the route already exists, or if adding the
// route fails.
func (r *linuxRouter) addRoute(cidr netaddr.IPPrefix) error {
if !r.v6Available && cidr.IP.Is6() {
return nil
}
args := []string{
"ip", "route", "add",
normalizeCIDR(cidr),
@@ -452,6 +460,9 @@ func (r *linuxRouter) addRoute(cidr netaddr.IPPrefix) error {
// interface. Fails if the route doesn't exist, or if removing the
// route fails.
func (r *linuxRouter) delRoute(cidr netaddr.IPPrefix) error {
if !r.v6Available && cidr.IP.Is6() {
return nil
}
args := []string{
"ip", "route", "del",
normalizeCIDR(cidr),