MINOR: version: emit the link to the known bugs in output of "haproxy -v"

The link to the known bugs page for the current version is built and
reported there. When it is a development version (less than 2 dots),
instead a link to github open issues is reported as there's no way to
be sure about the current situation in this case and it's better that
users report their trouble there.
diff --git a/include/common/version.h b/include/common/version.h
index fd5c954..b610c50 100644
--- a/include/common/version.h
+++ b/include/common/version.h
@@ -42,6 +42,12 @@
 #define PRODUCT_STATUS   "Status: development branch - not safe for use in production."
 #endif
 
+#ifdef CONFIG_PRODUCT_URL_BUGS
+#define PRODUCT_URL_BUGS  CONFIG_PRODUCT_URL_BUGS
+#else
+#define PRODUCT_URL_BUGS "http://www.haproxy.org/bugs/bugs-%s.html"
+#endif
+
 #ifdef  CONFIG_PRODUCT_URL
 #define PRODUCT_URL    CONFIG_PRODUCT_URL
 #else
diff --git a/src/haproxy.c b/src/haproxy.c
index 32d9d33..b03d0ad 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -545,6 +545,26 @@
 {
 	printf("HA-Proxy version %s %s - https://haproxy.org/\n"
 	       PRODUCT_STATUS "\n", haproxy_version, haproxy_date);
+
+	if (strlen(PRODUCT_URL_BUGS) > 0) {
+		char base_version[20];
+		int dots = 0;
+		char *del;
+
+		/* only retrieve the base version without distro-specific extensions */
+		for (del = haproxy_version; *del; del++) {
+			if (*del == '.')
+				dots++;
+			else if (*del < '0' || *del > '9')
+				break;
+		}
+
+		strlcpy2(base_version, haproxy_version, del - haproxy_version + 1);
+		if (dots < 2)
+			printf("Known bugs: https://github.com/haproxy/haproxy/issues?q=is:issue+is:open\n");
+		else
+			printf("Known bugs: " PRODUCT_URL_BUGS "\n", base_version);
+	}
 }
 
 static void display_build_opts()