From fdf4ed8169b21bdf1aba13f11cb392a869b03696 Mon Sep 17 00:00:00 2001
From: Leo Balduf <balduf@hm.edu>
Date: Sun, 5 Feb 2017 17:24:53 +0100
Subject: [PATCH] frontend: fix recording of address family

---
 frontend/http/frontend.go | 2 ++
 frontend/udp/frontend.go  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/frontend/http/frontend.go b/frontend/http/frontend.go
index ebda2e8..8ff5998 100644
--- a/frontend/http/frontend.go
+++ b/frontend/http/frontend.go
@@ -166,6 +166,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
 		WriteError(w, err)
 		return
 	}
+	af = new(bittorrent.AddressFamily)
 	*af = req.IP.AddressFamily
 
 	resp, err := t.logic.HandleAnnounce(context.Background(), req)
@@ -213,6 +214,7 @@ func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprou
 		WriteError(w, ErrInvalidIP)
 		return
 	}
+	af = new(bittorrent.AddressFamily)
 	*af = req.AddressFamily
 
 	resp, err := t.logic.HandleScrape(context.Background(), req)
diff --git a/frontend/udp/frontend.go b/frontend/udp/frontend.go
index fdc0919..405d1ca 100644
--- a/frontend/udp/frontend.go
+++ b/frontend/udp/frontend.go
@@ -232,6 +232,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
 			WriteError(w, txID, err)
 			return
 		}
+		af = new(bittorrent.AddressFamily)
 		*af = req.IP.AddressFamily
 
 		var resp *bittorrent.AnnounceResponse
@@ -264,6 +265,7 @@ func (t *Frontend) handleRequest(r Request, w ResponseWriter) (actionName string
 			WriteError(w, txID, ErrInvalidIP)
 			return
 		}
+		af = new(bittorrent.AddressFamily)
 		*af = req.AddressFamily
 
 		var resp *bittorrent.ScrapeResponse