summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Makefile.am1
-rw-r--r--bgpd/bgp_aspath.c80
-rw-r--r--bgpd/bgp_aspath.h1
-rw-r--r--bgpd/bgp_clist.c2
-rw-r--r--bgpd/bgp_community.c66
-rw-r--r--bgpd/bgp_community.h2
-rw-r--r--bgpd/bgp_debug.c3
-rw-r--r--bgpd/bgp_route.c13
-rw-r--r--bgpd/bgp_routemap.c4
-rw-r--r--bgpd/bgp_vty.c6
-rwxr-xr-xconfigure.ac8
-rw-r--r--debian/control48
-rw-r--r--debian/frr-doc.install1
-rw-r--r--debian/frr.config4
-rw-r--r--debian/patches/50_vtysh__vtysh.conf.sample.diff16
-rw-r--r--debian/patches/75_vtysh__vtysh.c__PAGER.diff26
-rw-r--r--debian/patches/80_vtysh__vtysh.c__privs.diff59
-rw-r--r--debian/patches/82_vtysh__vtysh_user.c__pam.diff10
-rw-r--r--debian/patches/90_configure_ncurses.diff47
-rw-r--r--debian/patches/series5
-rw-r--r--debian/po/POTFILES.in1
-rw-r--r--debian/po/cs.po41
-rw-r--r--debian/po/da.po33
-rw-r--r--debian/po/de.po34
-rw-r--r--debian/po/es.po57
-rw-r--r--debian/po/fr.po42
-rw-r--r--debian/po/it.po35
-rw-r--r--debian/po/ja.po32
-rw-r--r--debian/po/nl.po35
-rw-r--r--debian/po/pt.po34
-rw-r--r--debian/po/pt_BR.po34
-rw-r--r--debian/po/ru.po37
-rw-r--r--debian/po/sv.po40
-rw-r--r--debian/po/templates.pot31
-rwxr-xr-xdebian/rules102
-rw-r--r--debian/watch8
-rw-r--r--debianpkg/Makefile.am38
-rw-r--r--debianpkg/README.Debian (renamed from debian/README.Debian)0
-rw-r--r--debianpkg/README.Maintainer (renamed from debian/README.Maintainer)0
-rw-r--r--debianpkg/README.deb_build.md102
-rw-r--r--debianpkg/backports/.gitignore2
-rw-r--r--debianpkg/backports/README28
-rw-r--r--debianpkg/backports/debian8/debian/source/format1
-rw-r--r--debianpkg/backports/debian8/exclude0
-rw-r--r--debianpkg/backports/debian8/versionext1
-rw-r--r--debianpkg/backports/debian9/debian/source/format1
-rw-r--r--debianpkg/backports/debian9/exclude0
-rw-r--r--debianpkg/backports/debian9/versionext1
-rwxr-xr-xdebianpkg/backports/rules137
-rw-r--r--debianpkg/backports/ubuntu12.04/debian/control56
l---------debianpkg/backports/ubuntu12.04/debian/frr.install1
l---------debianpkg/backports/ubuntu12.04/debian/frr.postinst1
l---------debianpkg/backports/ubuntu12.04/debian/frr.postrm1
-rwxr-xr-xdebianpkg/backports/ubuntu12.04/debian/rules179
-rw-r--r--debianpkg/backports/ubuntu12.04/debian/source/format1
-rw-r--r--debianpkg/backports/ubuntu12.04/exclude0
-rw-r--r--debianpkg/backports/ubuntu12.04/versionext1
-rw-r--r--debianpkg/backports/ubuntu14.04/debian/control56
-rw-r--r--debianpkg/backports/ubuntu14.04/debian/frr.install21
-rw-r--r--debianpkg/backports/ubuntu14.04/debian/frr.postinst (renamed from debian/frr.postinst)4
-rw-r--r--debianpkg/backports/ubuntu14.04/debian/frr.postrm14
-rwxr-xr-xdebianpkg/backports/ubuntu14.04/debian/rules185
-rw-r--r--debianpkg/backports/ubuntu14.04/debian/source/format1
-rw-r--r--debianpkg/backports/ubuntu14.04/exclude0
-rw-r--r--debianpkg/backports/ubuntu14.04/versionext1
-rw-r--r--debianpkg/backports/ubuntu16.04/debian/source/format1
-rw-r--r--debianpkg/backports/ubuntu16.04/exclude0
-rw-r--r--debianpkg/backports/ubuntu16.04/versionext1
-rw-r--r--debianpkg/changelog.in (renamed from debian/changelog)19
-rw-r--r--debianpkg/compat (renamed from debian/compat)0
-rw-r--r--debianpkg/control54
-rw-r--r--debianpkg/copyright (renamed from debian/copyright)0
-rw-r--r--debianpkg/frr-doc.docs (renamed from debian/frr-doc.docs)0
-rw-r--r--debianpkg/frr-doc.info (renamed from debian/frr-doc.info)0
-rw-r--r--debianpkg/frr-doc.install2
-rw-r--r--debianpkg/frr-doc.lintian-overrides (renamed from debian/frr-doc.lintian-overrides)0
-rw-r--r--debianpkg/frr-pythontools.install1
-rw-r--r--debianpkg/frr.conf (renamed from debian/frr.conf)0
-rw-r--r--debianpkg/frr.dirs (renamed from debian/frr.dirs)0
-rw-r--r--debianpkg/frr.docs (renamed from debian/frr.docs)0
-rw-r--r--debianpkg/frr.install (renamed from debian/frr.install)1
-rw-r--r--debianpkg/frr.lintian-overrides (renamed from debian/frr.lintian-overrides)3
-rw-r--r--debianpkg/frr.logrotate (renamed from debian/frr.logrotate)0
-rw-r--r--debianpkg/frr.manpages (renamed from debian/frr.manpages)0
-rw-r--r--debianpkg/frr.pam (renamed from debian/frr.pam)0
-rw-r--r--debianpkg/frr.postinst36
-rw-r--r--debianpkg/frr.postrm (renamed from debian/frr.postrm)0
-rw-r--r--debianpkg/frr.preinst (renamed from debian/frr.preinst)0
-rw-r--r--debianpkg/frr.prerm (renamed from debian/frr.prerm)2
-rwxr-xr-xdebianpkg/rules218
-rw-r--r--debianpkg/source/format (renamed from debian/source/format)0
-rw-r--r--debianpkg/tests/control (renamed from debian/tests/control)0
-rw-r--r--debianpkg/tests/daemons (renamed from debian/tests/daemons)0
-rw-r--r--debianpkg/watchfrr.rc (renamed from debian/watchfrr.rc)0
-rw-r--r--doc/Building_FRR_on_Debian9.md121
-rw-r--r--doc/install.texi4
-rw-r--r--isisd/isisd.c2
-rw-r--r--ldpd/l2vpn.c6
-rw-r--r--ldpd/ldp_vty_cmds.c2
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/bgpd/test_packet.c85
-rw-r--r--tools/frr.service4
-rw-r--r--zebra/main.c21
-rw-r--r--zebra/rt.h11
-rw-r--r--zebra/rt_socket.c21
-rw-r--r--zebra/zebra_mpls.c32
-rw-r--r--zebra/zebra_mpls_netlink.c19
-rw-r--r--zebra/zebra_mpls_openbsd.c9
-rw-r--r--zebra/zebra_rib.c2
-rw-r--r--zebra/zebra_vty.c4
-rw-r--r--zebra/zserv.c47
-rw-r--r--zebra/zserv.h4
113 files changed, 1625 insertions, 946 deletions
diff --git a/.gitignore b/.gitignore
index 7ed1255d9e..f7c731b4bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,7 @@ aclocal.m4
Makefile.in
*.tar.gz
*.tar.gz.asc
+*.tar.?z
.nfs*
libtool
.libs
@@ -61,6 +62,10 @@ debian/frr.prerm.debhelper
debian/frr.substvars
debian/frr/
debian/tmp/
+*.deb
+*.ddeb
+*.dsc
+*.changes
*.pyc
*.swp
cscope.*
diff --git a/Makefile.am b/Makefile.am
index 15f86dff4f..dfa9d7a175 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,6 +64,7 @@ DIST_SUBDIRS = . bgpd \
vtysh doc tests \
solaris bgpd/rfp-example/librfp \
bgpd/rfp-example/rfptest \
+ debianpkg \
# end
if PKGSRC
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 6c03ba3059..caac385fb5 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -479,7 +479,7 @@ unsigned int aspath_has_as4(struct aspath *aspath)
}
/* Convert aspath structure to string expression. */
-static void aspath_make_str_count(struct aspath *as)
+static void aspath_make_str_count(struct aspath *as, bool make_json)
{
struct assegment *seg;
int str_size;
@@ -489,14 +489,18 @@ static void aspath_make_str_count(struct aspath *as)
json_object *jseg = NULL;
json_object *jseg_list = NULL;
- as->json = json_object_new_object();
- jaspath_segments = json_object_new_array();
+ if (make_json) {
+ as->json = json_object_new_object();
+ jaspath_segments = json_object_new_array();
+ }
/* Empty aspath. */
if (!as->segments) {
- json_object_string_add(as->json, "string", "Local");
- json_object_object_add(as->json, "segments", jaspath_segments);
- json_object_int_add(as->json, "length", 0);
+ if (make_json) {
+ json_object_string_add(as->json, "string", "Local");
+ json_object_object_add(as->json, "segments", jaspath_segments);
+ json_object_int_add(as->json, "length", 0);
+ }
as->str = XMALLOC(MTYPE_AS_STR, 1);
as->str[0] = '\0';
as->str_len = 0;
@@ -539,6 +543,7 @@ static void aspath_make_str_count(struct aspath *as)
as->str_len = 0;
json_object_free(as->json);
as->json = NULL;
+
return;
}
@@ -564,12 +569,14 @@ static void aspath_make_str_count(struct aspath *as)
str_buf + len, str_size - len, "%c",
aspath_delimiter_char(seg->type, AS_SEG_START));
- jseg_list = json_object_new_array();
+ if (make_json)
+ jseg_list = json_object_new_array();
/* write out the ASNs, with their seperators, bar the last one*/
for (i = 0; i < seg->length; i++) {
- json_object_array_add(jseg_list,
- json_object_new_int(seg->as[i]));
+ if (make_json)
+ json_object_array_add(jseg_list,
+ json_object_new_int(seg->as[i]));
len += snprintf(str_buf + len, str_size - len, "%u",
seg->as[i]);
@@ -579,11 +586,13 @@ static void aspath_make_str_count(struct aspath *as)
"%c", seperator);
}
- jseg = json_object_new_object();
- json_object_string_add(jseg, "type",
- aspath_segment_type_str[seg->type]);
- json_object_object_add(jseg, "list", jseg_list);
- json_object_array_add(jaspath_segments, jseg);
+ if (make_json) {
+ jseg = json_object_new_object();
+ json_object_string_add(jseg, "type",
+ aspath_segment_type_str[seg->type]);
+ json_object_object_add(jseg, "list", jseg_list);
+ json_object_array_add(jaspath_segments, jseg);
+ }
if (seg->type != AS_SEQUENCE)
len += snprintf(
@@ -601,13 +610,16 @@ static void aspath_make_str_count(struct aspath *as)
as->str = str_buf;
as->str_len = len;
- json_object_string_add(as->json, "string", str_buf);
- json_object_object_add(as->json, "segments", jaspath_segments);
- json_object_int_add(as->json, "length", aspath_count_hops(as));
+ if (make_json) {
+ json_object_string_add(as->json, "string", str_buf);
+ json_object_object_add(as->json, "segments", jaspath_segments);
+ json_object_int_add(as->json, "length", aspath_count_hops(as));
+ }
+
return;
}
-static void aspath_str_update(struct aspath *as)
+void aspath_str_update(struct aspath *as, bool make_json)
{
if (as->str)
XFREE(MTYPE_AS_STR, as->str);
@@ -617,7 +629,7 @@ static void aspath_str_update(struct aspath *as)
as->json = NULL;
}
- aspath_make_str_count(as);
+ aspath_make_str_count(as, make_json);
}
/* Intern allocated AS path. */
@@ -1079,7 +1091,7 @@ struct aspath *aspath_aggregate(struct aspath *as1, struct aspath *as2)
}
assegment_normalise(aspath->segments);
- aspath_str_update(aspath);
+ aspath_str_update(aspath, false);
return aspath;
}
@@ -1214,7 +1226,7 @@ struct aspath *aspath_replace_specific_asn(struct aspath *aspath,
seg = seg->next;
}
- aspath_str_update(new);
+ aspath_str_update(new, false);
return new;
}
@@ -1237,7 +1249,7 @@ struct aspath *aspath_replace_private_asns(struct aspath *aspath, as_t asn)
seg = seg->next;
}
- aspath_str_update(new);
+ aspath_str_update(new, false);
return new;
}
@@ -1307,7 +1319,7 @@ struct aspath *aspath_remove_private_asns(struct aspath *aspath)
seg = seg->next;
}
- aspath_str_update(new);
+ aspath_str_update(new, false);
return new;
}
@@ -1362,7 +1374,7 @@ static struct aspath *aspath_merge(struct aspath *as1, struct aspath *as2)
last->next = as2->segments;
as2->segments = new;
- aspath_str_update(as2);
+ aspath_str_update(as2, false);
return as2;
}
@@ -1381,7 +1393,7 @@ struct aspath *aspath_prepend(struct aspath *as1, struct aspath *as2)
/* If as2 is empty, only need to dupe as1's chain onto as2 */
if (seg2 == NULL) {
as2->segments = assegment_dup_all(as1->segments);
- aspath_str_update(as2);
+ aspath_str_update(as2, false);
return as2;
}
@@ -1432,7 +1444,7 @@ struct aspath *aspath_prepend(struct aspath *as1, struct aspath *as2)
/* we've now prepended as1's segment chain to as2, merging
* the inbetween AS_SEQUENCE of seg2 in the process
*/
- aspath_str_update(as2);
+ aspath_str_update(as2, false);
return as2;
} else {
/* AS_SET merge code is needed at here. */
@@ -1511,7 +1523,7 @@ struct aspath *aspath_filter_exclude(struct aspath *source,
lastseg->next = newseg;
lastseg = newseg;
}
- aspath_str_update(newpath);
+ aspath_str_update(newpath, false);
/* We are happy returning even an empty AS_PATH, because the
* administrator
* might expect this very behaviour. There's a mean to avoid this, if
@@ -1549,7 +1561,7 @@ static struct aspath *aspath_add_asns(struct aspath *aspath, as_t asno,
aspath->segments = newsegment;
}
- aspath_str_update(aspath);
+ aspath_str_update(aspath, false);
return aspath;
}
@@ -1639,7 +1651,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
if (!hops) {
newpath = aspath_dup(as4path);
- aspath_str_update(newpath);
+ aspath_str_update(newpath, false);
return newpath;
}
@@ -1701,7 +1713,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
mergedpath = aspath_merge(newpath, aspath_dup(as4path));
aspath_free(newpath);
mergedpath->segments = assegment_normalise(mergedpath->segments);
- aspath_str_update(mergedpath);
+ aspath_str_update(mergedpath, false);
if (BGP_DEBUG(as4, AS4))
zlog_debug("[AS4] result of synthesizing is %s",
@@ -1773,7 +1785,7 @@ struct aspath *aspath_delete_confed_seq(struct aspath *aspath)
}
if (removed_confed_segment)
- aspath_str_update(aspath);
+ aspath_str_update(aspath, false);
return aspath;
}
@@ -1824,7 +1836,7 @@ struct aspath *aspath_empty_get(void)
struct aspath *aspath;
aspath = aspath_new();
- aspath_make_str_count(aspath);
+ aspath_make_str_count(aspath, false);
return aspath;
}
@@ -1975,7 +1987,7 @@ struct aspath *aspath_str2aspath(const char *str)
}
}
- aspath_make_str_count(aspath);
+ aspath_make_str_count(aspath, false);
return aspath;
}
@@ -1987,7 +1999,7 @@ unsigned int aspath_key_make(void *p)
unsigned int key = 0;
if (!aspath->str)
- aspath_str_update(aspath);
+ aspath_str_update(aspath, false);
key = jhash(aspath->str, aspath->str_len, 2334325);
diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h
index f085cf3cb9..0c065cc936 100644
--- a/bgpd/bgp_aspath.h
+++ b/bgpd/bgp_aspath.h
@@ -92,6 +92,7 @@ extern struct aspath *aspath_delete_confed_seq(struct aspath *);
extern struct aspath *aspath_empty(void);
extern struct aspath *aspath_empty_get(void);
extern struct aspath *aspath_str2aspath(const char *);
+extern void aspath_str_update(struct aspath *as, bool make_json);
extern void aspath_free(struct aspath *);
extern struct aspath *aspath_intern(struct aspath *);
extern void aspath_unintern(struct aspath **);
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index f3bae9535c..72b1098ede 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -438,7 +438,7 @@ static int community_regexp_match(struct community *com, regex_t *reg)
if (com == NULL || com->size == 0)
str = "";
else
- str = community_str(com);
+ str = community_str(com, false);
/* Regular expression match. */
if (regexec(reg, str, 0, NULL, 0) == 0)
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index b0f00d67d6..7c83eaa091 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -169,7 +169,6 @@ struct community *community_uniq_sort(struct community *com)
return NULL;
new = community_new();
- ;
new->json = NULL;
for (i = 0; i < com->size; i++) {
@@ -195,7 +194,7 @@ struct community *community_uniq_sort(struct community *com)
0xFFFF0000 "graceful-shutdown"
For other values, "AS:VAL" format is used. */
-static void set_community_string(struct community *com)
+static void set_community_string(struct community *com, bool make_json)
{
int i;
char *str;
@@ -211,16 +210,20 @@ static void set_community_string(struct community *com)
if (!com)
return;
- com->json = json_object_new_object();
- json_community_list = json_object_new_array();
+ if (make_json) {
+ com->json = json_object_new_object();
+ json_community_list = json_object_new_array();
+ }
/* When communities attribute is empty. */
if (com->size == 0) {
str = XMALLOC(MTYPE_COMMUNITY_STR, 1);
str[0] = '\0';
- json_object_string_add(com->json, "string", "");
- json_object_object_add(com->json, "list", json_community_list);
+ if (make_json) {
+ json_object_string_add(com->json, "string", "");
+ json_object_object_add(com->json, "list", json_community_list);
+ }
com->str = str;
return;
}
@@ -273,47 +276,61 @@ static void set_community_string(struct community *com)
case COMMUNITY_INTERNET:
strcpy(pnt, "internet");
pnt += strlen("internet");
- json_string = json_object_new_string("internet");
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string("internet");
+ json_object_array_add(json_community_list, json_string);
+ }
break;
case COMMUNITY_NO_EXPORT:
strcpy(pnt, "no-export");
pnt += strlen("no-export");
- json_string = json_object_new_string("noExport");
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string("noExport");
+ json_object_array_add(json_community_list, json_string);
+ }
break;
case COMMUNITY_NO_ADVERTISE:
strcpy(pnt, "no-advertise");
pnt += strlen("no-advertise");
- json_string = json_object_new_string("noAdvertise");
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string("noAdvertise");
+ json_object_array_add(json_community_list, json_string);
+ }
break;
case COMMUNITY_LOCAL_AS:
strcpy(pnt, "local-AS");
pnt += strlen("local-AS");
- json_string = json_object_new_string("localAs");
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string("localAs");
+ json_object_array_add(json_community_list, json_string);
+ }
break;
case COMMUNITY_GSHUT:
strcpy(pnt, "graceful-shutdown");
pnt += strlen("graceful-shutdown");
- json_string = json_object_new_string("gracefulShutdown");
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string("gracefulShutdown");
+ json_object_array_add(json_community_list, json_string);
+ }
break;
default:
as = (comval >> 16) & 0xFFFF;
val = comval & 0xFFFF;
sprintf(pnt, "%u:%d", as, val);
- json_string = json_object_new_string(pnt);
- json_object_array_add(json_community_list, json_string);
+ if (make_json) {
+ json_string = json_object_new_string(pnt);
+ json_object_array_add(json_community_list, json_string);
+ }
pnt += strlen(pnt);
break;
}
}
*pnt = '\0';
- json_object_string_add(com->json, "string", str);
- json_object_object_add(com->json, "list", json_community_list);
+ if (make_json) {
+ json_object_string_add(com->json, "string", str);
+ json_object_object_add(com->json, "list", json_community_list);
+ }
com->str = str;
}
@@ -338,7 +355,7 @@ struct community *community_intern(struct community *com)
/* Make string. */
if (!find->str)
- set_community_string(find);
+ set_community_string(find, false);
return find;
}
@@ -396,13 +413,16 @@ struct community *community_dup(struct community *com)
}
/* Retrun string representation of communities attribute. */
-char *community_str(struct community *com)
+char *community_str(struct community *com, bool make_json)
{
if (!com)
return NULL;
+ if (make_json && !com->json && com->str)
+ XFREE(MTYPE_COMMUNITY_STR, com->str);
+
if (!com->str)
- set_community_string(com);
+ set_community_string(com, make_json);
return com->str;
}
diff --git a/bgpd/bgp_community.h b/bgpd/bgp_community.h
index f728debdb5..5016f132f2 100644
--- a/bgpd/bgp_community.h
+++ b/bgpd/bgp_community.h
@@ -63,7 +63,7 @@ extern struct community *community_uniq_sort(struct community *);
extern struct community *community_parse(u_int32_t *, u_short);
extern struct community *community_intern(struct community *);
extern void community_unintern(struct community **);
-extern char *community_str(struct community *);
+extern char *community_str(struct community *, bool make_json);
extern unsigned int community_hash_make(struct community *);
extern struct community *community_str2com(const char *);
extern int community_match(const struct community *, const struct community *);
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 6e16d5f45b..45ac8e6859 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -385,7 +385,8 @@ int bgp_dump_attr(struct attr *attr, char *buf, size_t size)
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES)))
snprintf(buf + strlen(buf), size - strlen(buf),
- ", community %s", community_str(attr->community));
+ ", community %s", community_str(attr->community,
+ false));
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)))
snprintf(buf + strlen(buf), size - strlen(buf),
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e0ae2a9611..0fb650c149 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7412,6 +7412,8 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
/* Line1 display AS-path, Aggregator */
if (attr->aspath) {
if (json_paths) {
+ if (!attr->aspath->json)
+ aspath_str_update(attr->aspath, true);
json_object_lock(attr->aspath->json);
json_object_object_add(json_path, "aspath",
attr->aspath->json);
@@ -7900,6 +7902,9 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
/* Line 4 display Community */
if (attr->community) {
if (json_paths) {
+ if (!attr->community->json)
+ community_str(attr->community,
+ true);
json_object_lock(attr->community->json);
json_object_object_add(json_path, "community",
attr->community->json);
@@ -8199,8 +8204,6 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
continue;
display = 0;
- if (!first && use_json)
- vty_out(vty, ",");
if (use_json)
json_paths = json_object_new_array();
else
@@ -8396,7 +8399,11 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
inet_ntop(p->family, &p->u.prefix,
buf, BUFSIZ),
p->prefixlen);
- vty_out(vty, "\"%s\": ", buf2);
+ if (first)
+ vty_out(vty, "\"%s\": ", buf2);
+ else
+ vty_out(vty, ",\"%s\": ", buf2);
+
vty_out(vty, "%s",
json_object_to_json_string_ext(json_paths, JSON_C_TO_STRING_PRETTY));
json_object_free(json_paths);
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index f26498fb03..cc8cfd550c 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -299,7 +299,7 @@ static void *route_match_peer_compile(const char *arg)
struct bgp_match_peer_compiled *pc;
int ret;
- pc = XMALLOC(MTYPE_ROUTE_MAP_COMPILED,
+ pc = XCALLOC(MTYPE_ROUTE_MAP_COMPILED,
sizeof(struct bgp_match_peer_compiled));
ret = str2sockunion(strcmp(arg, "local") ? arg : "0.0.0.0", &pc->su);
@@ -3813,7 +3813,7 @@ DEFUN (set_community,
}
/* Set communites attribute string. */
- str = community_str(com);
+ str = community_str(com, false);
if (additive) {
argstr = XCALLOC(MTYPE_TMP,
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index db19835f88..40f706a646 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -10010,7 +10010,7 @@ static void community_show_all_iterator(struct hash_backet *backet,
com = (struct community *)backet->data;
vty_out(vty, "[%p] (%ld) %s\n", (void *)com, com->refcnt,
- community_str(com));
+ community_str(com, false));
}
/* Show BGP's community internal data. */
@@ -12698,7 +12698,7 @@ static void community_list_show(struct vty *vty, struct community_list *list)
vty_out(vty, " %s %s\n",
community_direct_str(entry->direct),
entry->style == COMMUNITY_LIST_STANDARD
- ? community_str(entry->u.com)
+ ? community_str(entry->u.com, false)
: entry->config);
}
}
@@ -13354,7 +13354,7 @@ static const char *community_list_config_str(struct community_entry *entry)
str = "";
else {
if (entry->style == COMMUNITY_LIST_STANDARD)
- str = community_str(entry->u.com);
+ str = community_str(entry->u.com, false);
else
str = entry->config;
}
diff --git a/configure.ac b/configure.ac
index 41ebab6a16..cdbd48fe3c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -381,6 +381,8 @@ AC_ARG_ENABLE(cumulus,
AS_HELP_STRING([--enable-cumulus], [enable Cumulus Switch Special Extensions]))
AC_ARG_ENABLE(datacenter,
AS_HELP_STRING([--enable-datacenter], [enable Compilation for Data Center Extensions]))
+AC_ARG_ENABLE(fuzzing,
+ AS_HELP_STRING([--enable-fuzzing], [enable ability to fuzz various parts of FRR]))
AC_ARG_ENABLE(rr-semantics,
AS_HELP_STRING([--disable-rr-semantics], [disable the v6 Route Replace semantics]))
AC_ARG_ENABLE([protobuf],
@@ -434,6 +436,10 @@ else
DFLT_NAME="traditional"
fi
+if test "${enable_fuzzing}" = "yes" ; then
+ AC_DEFINE(HANDLE_ZAPI_FUZZING,,Compile extensions to use with a fuzzer)
+fi
+
if test "${enable_cumulus}" = "yes" ; then
AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in)
fi
@@ -1839,6 +1845,8 @@ AC_CONFIG_FILES([Makefile
doc/Makefile tests/Makefile
bgpd/rfp-example/rfptest/Makefile bgpd/rfp-example/librfp/Makefile
redhat/frr.spec
+ debianpkg/Makefile
+ debianpkg/changelog
snapcraft/snapcraft.yaml
lib/version.h
tests/lib/cli/test_cli.refout
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 84b04c347d..0000000000
--- a/debian/control
+++ /dev/null
@@ -1,48 +0,0 @@
-Source: frr
-Section: net
-Priority: optional
-Maintainer: Christian Hammers <ch@debian.org>
-Uploaders: Florian Weimer <fw@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), libncurses5-dev, libreadline-dev, texlive-latex-base, texlive-generic-recommended, libpam0g-dev | libpam-dev, libcap-dev, texinfo (>= 4.7), imagemagick, ghostscript, groff, po-debconf, autotools-dev, hardening-wrapper, libpcre3-dev, gawk, chrpath, libsnmp-dev, git, dh-autoreconf, libjson0, libjson0-dev, dh-systemd, libsystemd-dev, python-ipaddr, bison, flex, libc-ares-dev, python3-dev
-Standards-Version: 3.9.6
-Homepage: http://www.frr.net/
-XS-Testsuite: autopkgtest
-
-Package: frr
-Architecture: any
-Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), iproute2 | iproute, ${misc:Depends}, libc-ares2
-Pre-Depends: adduser
-Conflicts: zebra, zebra-pj, quagga
-Replaces: zebra, zebra-pj
-Suggests: snmpd
-Description: BGP/OSPF/RIP routing daemon
- Frr is free software which manages TCP/IP based routing protocols.
- It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, and RIPng as
- well as the IPv6 versions of these.
- .
- Frr uses threading if the kernel supports it, but can also run on
- kernels that do not support threading. Each protocol has its own daemon.
- .
- It is more than a routed replacement, it can be used as a Route Server and
- a Route Reflector.
-
-Package: frr-dbg
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, frr (= ${binary:Version})
-Priority: extra
-Section: debug
-Description: BGP/OSPF/RIP routing daemon (debug symbols)
- This package provides debugging symbols for all binary packages built from
- frr source package. It's highly recommended to have this package installed
- before reporting any Frr crashes to either Frr developers or Debian
- package maintainers.
-
-Package: frr-doc
-Section: net
-Architecture: all
-Depends: ${misc:Depends}
-Suggests: frr
-Description: documentation files for frr
- This package includes info files for frr, a free software which manages
- TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
- IS-IS, RIPv1, RIPv2, and RIPng as well as the IPv6 versions of these.
diff --git a/debian/frr-doc.install b/debian/frr-doc.install
deleted file mode 100644
index d2d3f1bbd9..0000000000
--- a/debian/frr-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/info
diff --git a/debian/frr.config b/debian/frr.config
deleted file mode 100644
index f642bea1d5..0000000000
--- a/debian/frr.config
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash -e
-
-. /usr/share/debconf/confmodule
-
diff --git a/debian/patches/50_vtysh__vtysh.conf.sample.diff b/debian/patches/50_vtysh__vtysh.conf.sample.diff
deleted file mode 100644
index d60581f70c..0000000000
--- a/debian/patches/50_vtysh__vtysh.conf.sample.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Change example to make it compatible with the Debian init scripts
- per default.
-Author: Christian Hammers <ch@debian.org>
-
---- old/vtysh/vtysh.conf.sample.orig 2004-10-30 23:07:40.000000000 +0200
-+++ new/vtysh/vtysh.conf.sample 2004-10-30 23:08:24.000000000 +0200
-@@ -1,7 +1,7 @@
- !
- ! Sample configuration file for vtysh.
- !
--!service integrated-vtysh-config
-+service integrated-vtysh-config
- !hostname quagga-router
--!username root nopassword
-+username root nopassword
- !
diff --git a/debian/patches/75_vtysh__vtysh.c__PAGER.diff b/debian/patches/75_vtysh__vtysh.c__PAGER.diff
deleted file mode 100644
index 2dbf6b2441..0000000000
--- a/debian/patches/75_vtysh__vtysh.c__PAGER.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-Description: Use the pager program that was choosen with the Debian
- update-alternative system. (Updated line numbers for 0.99.22)
-Author: Christian Hammers <ch@debian.org>
-
---- old/vtysh/vtysh.c.orig 2004-10-18 01:23:16.000000000 +0200
-+++ new/vtysh/vtysh.c 2004-10-18 01:25:15.000000000 +0200
-@@ -265,10 +265,16 @@
-
- pager_defined = getenv ("VTYSH_PAGER");
-
-- if (pager_defined)
-+ if (pager_defined) {
- vtysh_pager_name = strdup (pager_defined);
-- else
-- vtysh_pager_name = strdup ("more");
-+ } else {
-+ struct stat pager_stat;
-+ if (stat("/usr/bin/pager", &pager_stat) == 0) {
-+ vtysh_pager_name = strdup ("/usr/bin/pager");
-+ } else {
-+ vtysh_pager_name = strdup ("more");
-+ }
-+ }
- }
-
- /* Command execution over the vty interface. */
diff --git a/debian/patches/80_vtysh__vtysh.c__privs.diff b/debian/patches/80_vtysh__vtysh.c__privs.diff
deleted file mode 100644
index 863c81391f..0000000000
--- a/debian/patches/80_vtysh__vtysh.c__privs.diff
+++ /dev/null
@@ -1,59 +0,0 @@
-Description: Fixes group permission. (line numbers adjusted for 0.99.22)
-
-Index: quagga-0.99.23.1/vtysh/vtysh.c
-===================================================================
---- quagga-0.99.23.1.orig/vtysh/vtysh.c 2015-04-16 07:58:08.000000000 -0700
-+++ quagga-0.99.23.1/vtysh/vtysh.c 2015-04-16 08:02:16.108035000 -0700
-@@ -26,6 +26,8 @@
- #include <sys/wait.h>
- #include <sys/resource.h>
- #include <sys/stat.h>
-+#include <sys/types.h>
-+#include <grp.h>
-
- #include <readline/readline.h>
- #include <readline/history.h>
-@@ -2026,6 +2028,9 @@
- char line[] = "write terminal\n";
- FILE *fp, *fp1;
-
-+ /* Setting file permissions */
-+ struct group *quagga_vty_group;
-+
- fprintf (stdout,"Building Configuration...\n");
-
- backup_config_file(integrate_default);
-@@ -2058,16 +2063,31 @@
-
- fclose (fp);
-
-+ errno = 0;
-+ if ((quagga_vty_group = getgrnam(VTY_GROUP)) == NULL)
-+ {
-+ fprintf (stdout, "%% Can't get group %s: %s (%d)\n",
-+ VTY_GROUP, strerror(errno), errno);
-+ return CMD_WARNING;
-+ }
-+
-+ if ((chown(integrate_default, -1, quagga_vty_group->gr_gid)) != 0)
-+ {
-+ fprintf (stdout,"%% Can't chown configuration file %s: %s (%d)\n",
-+ integrate_default, strerror(errno), errno);
-+ return CMD_WARNING;
-+ }
-+
- if (chmod (integrate_default, CONFIGFILE_MASK) != 0)
- {
-- fprintf (stdout,"%% Can't chmod configuration file %s: %s (%d)\n",
-+ fprintf (stdout,"%% Can't chmod configuration file %s: %s (%d)\n",
- integrate_default, safe_strerror(errno), errno);
- return CMD_WARNING;
- }
-
- if (chmod (host.config, CONFIGFILE_MASK) != 0)
- {
-- fprintf (stdout,"%% Can't chmod configuration file %s: %s (%d)\n",
-+ fprintf (stdout,"%% Can't chmod configuration file %s: %s (%d)\n",
- integrate_default, safe_strerror(errno), errno);
- return CMD_WARNING;
- }
diff --git a/debian/patches/82_vtysh__vtysh_user.c__pam.diff b/debian/patches/82_vtysh__vtysh_user.c__pam.diff
deleted file mode 100644
index 5358ed8870..0000000000
--- a/debian/patches/82_vtysh__vtysh_user.c__pam.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-Description: Adds explanation why vtysh does not work if PAM fails.
-Author: Christian Hammers <ch@debian.org>
-
---- old/vtysh/vtysh_user.c.orig 2006-11-03 01:53:58.000000000 +0100
-+++ new/vtysh/vtysh_user.c 2006-11-03 01:59:02.000000000 +0100
-@@ -60,2 +60,4 @@ vtysh_pam (const char *user)
- ret = pam_authenticate (pamh, 0);
-+ if (ret != PAM_SUCCESS)
-+ printf("Not authenticated. Check /etc/pam.d/quagga.\n");
- /* printf ("ret %d\n", ret); */
diff --git a/debian/patches/90_configure_ncurses.diff b/debian/patches/90_configure_ncurses.diff
deleted file mode 100644
index 9d3dbb15d1..0000000000
--- a/debian/patches/90_configure_ncurses.diff
+++ /dev/null
@@ -1,47 +0,0 @@
-Description: To make checklib happy.
- See http://rerun.lefant.net/checklib/log.quagga_0.99.5-1.html
- (adjusted for 0.99.2)
-Author: Christian Hammers <ch@debian.org>
-
---- old/configure 2011-09-27 00:30:23.000000000 +0200
-+++ new/configure 2011-09-27 00:30:28.000000000 +0200
-@@ -14207,7 +14207,8 @@
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-ltermcap $LIBS"
-+#42#DEBIAN# LIBS="-ltermcap $LIBS"
-+LIBS="$LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-@@ -14238,7 +14238,8 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tputs" >&5
- $as_echo "$ac_cv_lib_termcap_tputs" >&6; }
- if test "x$ac_cv_lib_termcap_tputs" = xyes; then :
-- LIBREADLINE="$LIBREADLINE -ltermcap"
-+ #42#DEBIAN# LIBREADLINE="$LIBREADLINE -ltermcap"
-+ LIBREADLINE="$LIBREADLINE "
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -ltinfo" >&5
- $as_echo_n "checking for tputs in -ltinfo... " >&6; }
-@@ -14285,7 +14289,8 @@
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lcurses $LIBS"
-+#42#DEBIAN# LIBS="-lcurses $LIBS"
-+LIBS="$LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-@@ -14355,7 +14355,8 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tputs" >&5
- $as_echo "$ac_cv_lib_ncurses_tputs" >&6; }
- if test "x$ac_cv_lib_ncurses_tputs" = xyes; then :
-- LIBREADLINE="$LIBREADLINE -lncurses"
-+ #42#DEBIAN# LIBREADLINE="$LIBREADLINE -lncurses"
-+ LIBREADLINE="$LIBREADLINE"
- fi
-
-
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index b3f6cc1452..0000000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,5 +0,0 @@
-90_configure_ncurses.diff
-82_vtysh__vtysh_user.c__pam.diff
-80_vtysh__vtysh.c__privs.diff
-75_vtysh__vtysh.c__PAGER.diff
-50_vtysh__vtysh.conf.sample.diff
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
deleted file mode 100644
index 04d24252cd..0000000000
--- a/debian/po/POTFILES.in
+++ /dev/null
@@ -1 +0,0 @@
-[type: gettext/rfc822deb] quagga.templates
diff --git a/debian/po/cs.po b/debian/po/cs.po
deleted file mode 100644
index df4f47d914..0000000000
--- a/debian/po/cs.po
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2005-07-13 18:52+0200\n"
-"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
-"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
-"Language: cs\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Opravdu chcete zastavit daemon Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"VAROVÃNÃ: Abyste mohli pokraÄovat, musí se smÄ›rovací daemon Quagga "
-"pozastavit. To může vést ke zpanikaření BGP nebo ke ztrátě konektivity."
diff --git a/debian/po/da.po b/debian/po/da.po
deleted file mode 100644
index 22b2d56c66..0000000000
--- a/debian/po/da.po
+++ /dev/null
@@ -1,33 +0,0 @@
-# Danish translation quagga.
-# Copyright (C) 2010 quagga & nedenstående oversættere.
-# This file is distributed under the same license as the quagga package.
-# Joe Hansen <joedalton2@yahoo.dk>, 2010.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2010-09-09 23:51+0200\n"
-"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
-"Language-Team: Danish <debian-l10n-danish@lists.debian.org> \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Ønsker du virkelig at stoppe dæmonen Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"ADVARSEL: Ruteplanlægningsdæmonen Quagga skal stoppes for at fortsætte. "
-"Dette kan føre til BGP-udfald eller tab af netværksforbindelse."
diff --git a/debian/po/de.po b/debian/po/de.po
deleted file mode 100644
index cbf919e2e5..0000000000
--- a/debian/po/de.po
+++ /dev/null
@@ -1,34 +0,0 @@
-# translation of po-debconf template to German
-# Copyright (C) 2007, Matthias Julius
-# This file is distributed under the same license as the quagga package.
-#
-# Matthias Julius <mdeb@julius-net.net>, 2007.
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.6-2\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2007-02-01 19:32-0500\n"
-"Last-Translator: Matthias Julius <mdeb@julius-net.net>\n"
-"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Möchten Sie den Quagga-Daemon wirklich beenden?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"Warnung: Um fortzufahren muss der Quagga-Routing-Daemon beendet werden. Dies "
-"könnte zu BGP-Flaps oder Verlust der Netzwerkverbindung führen."
diff --git a/debian/po/es.po b/debian/po/es.po
deleted file mode 100644
index 3b9e421a48..0000000000
--- a/debian/po/es.po
+++ /dev/null
@@ -1,57 +0,0 @@
-# quagga translation to spanish
-# Copyright (C) 2004 Software in the Public Interest
-# This file is distributed under the same license as the quagga package.
-#
-# Changes:
-# - Initial translation
-# Carlos Galisteo de Cabo <cgalisteo@k-rolus.net>, 2007
-#
-#
-# Traductores, si no conoce el formato PO, merece la pena leer la
-# documentación de gettext, especialmente las secciones dedicadas a este
-# formato, por ejemplo ejecutando:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Equipo de traducción al español, por favor lean antes de traducir
-# los siguientes documentos:
-#
-# - El proyecto de traducción de Debian al español
-# http://www.debian.org/intl/spanish/coordinacion
-# especialmente las notas de traducción en
-# http://www.debian.org/intl/spanish/notas
-#
-# - La guía de traducción de po's de debconf:
-# /usr/share/doc/po-debconf/README-trans
-# o http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga_0.99.7-2\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2007-05-08 12:39+0200\n"
-"Last-Translator: Carlos Galisteo <cgalisteo@k-rolus.net>\n"
-"Language-Team: <debian-l10n-spanish@lists.debian.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-15\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "¿Está seguro de que quiere detener el servicio «Quagga»?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"ADVERTENCIA: Debe detenerse el servicio de encaminamiento «Quagga» para "
-"continuar. Ésto podría provocar intermitencias en BGP o pérdidas de "
-"conectividad."
diff --git a/debian/po/fr.po b/debian/po/fr.po
deleted file mode 100644
index a96649d2fd..0000000000
--- a/debian/po/fr.po
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.1-3\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2005-07-21 10:52+0200\n"
-"Last-Translator: Mohammed Adnène Trojette<adn+deb@diwi.org>\n"
-"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
-"Language: fr\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=iso-8859-15\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Faut-il vraiment arrêter le démon Quagga ?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"Veuillez noter que le démon de routage Quagga doit être arrêté avant de "
-"poursuivre cette installation. Cela peut provoquer des incohérences BGP ou "
-"des pertes de connectivité."
diff --git a/debian/po/it.po b/debian/po/it.po
deleted file mode 100644
index d305956685..0000000000
--- a/debian/po/it.po
+++ /dev/null
@@ -1,35 +0,0 @@
-# Italian translation of quagga debconf messages
-# Copyright (C) 2013, quagga package copyright holder
-# This file is distributed under the same license as the quagga package.
-# Beatrice Torracca <beatricet@libero.it>, 2013.
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2013-11-03 11:52+0200\n"
-"Last-Translator: Beatrice Torracca <beatricet@libero.it>\n"
-"Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n"
-"Language: it\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Virtaal 0.7.1\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Arrestare veramente il demone Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"ATTENZIONE: per procedere il demone di instradamento Quagga deve essere "
-"fermato. Questo può portare a flap BGP o a perdita della connettività di "
-"rete."
diff --git a/debian/po/ja.po b/debian/po/ja.po
deleted file mode 100644
index 0991d99236..0000000000
--- a/debian/po/ja.po
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2008 Christian Hammers <ch@debian.org>
-# This file is distributed under the same license as quagga package.
-# Hideki Yamane (Debian-JP) <henrich@debian.or.jp>, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.11-1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2008-12-28 22:26+0900\n"
-"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n"
-"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
-"Language: ja\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Quagga デーモンを本当ã«åœæ­¢ã—ã¾ã™ã‹?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"警告: Quagga ルーティングデーモンã®åœæ­¢ãŒå®Ÿæ–½ã•れã¾ã—ãŸã€‚ã“れã«ã‚ˆã£ã¦ BGP "
-"ルートフラップã®ç™ºç”Ÿã‚„ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯æŽ¥ç¶šã®åˆ‡æ–­ãŒèµ·ã“ã•れるå¯èƒ½æ€§ãŒã‚りã¾ã™ã€‚"
diff --git a/debian/po/nl.po b/debian/po/nl.po
deleted file mode 100644
index a9df615e0c..0000000000
--- a/debian/po/nl.po
+++ /dev/null
@@ -1,35 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2007-03-15 18:49+0100\n"
-"Last-Translator: Bart Cornelis <cobaco@skolelinux.no>\n"
-"Language-Team: debian-l10n-dutch <debian-l10n-dutch@lists.debian.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Dutch\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Bent u zeker dat u de Quagga-achtergronddienst wilt stoppen?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"WAARSCHUWING: De Quagga 'routing'-achtergronddienst dient stopgezet te "
-"worden voor u verder gaat. Dit kan BGP-flaps en verliezen van "
-"netwerkverbinding veroorzaken."
diff --git a/debian/po/pt.po b/debian/po/pt.po
deleted file mode 100644
index 05f9b2e383..0000000000
--- a/debian/po/pt.po
+++ /dev/null
@@ -1,34 +0,0 @@
-# Portuguese translations for quagga package.
-# Copyright (C) 2007 Miguel Figueiredo
-# This file is distributed under the same license as the quagga package.
-# Miguel Figueiredo <elmig@debianpt.org>, 2007.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.6-6\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2007-04-26 23:07+0100\n"
-"Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n"
-"Language-Team: Portuguese <traduz@debianpt.org>\n"
-"Language: pt\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Deseja mesmo parar o daemon Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"AVISO: O daemon de routing tem de ser parado para continuar. Isto pode levar "
-"a distúrbio do BGP ou perda da ligação de rede."
diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po
deleted file mode 100644
index 49b399c3e7..0000000000
--- a/debian/po/pt_BR.po
+++ /dev/null
@@ -1,34 +0,0 @@
-# quagga Brazilian Portuguese po-debconf translation
-# Copyright (C) 2007 THE quagga'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the quagga package.
-# Jefferson Alexandre dos Santos <jefferson.alexandre@gmail.com>, 2007.
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2007-09-29 00:34-0300\n"
-"Last-Translator: Jefferson Alexandre dos Santos<jefferson.alexandre@gmail."
-"com>\n"
-"Language-Team: Brazilian Portuguese <debian-l10n-portuguese@lists.debian."
-"org>\n"
-"Language: pt_BR\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Você realmente deseja parar o daemon Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"AVISO: O daemon de roteamento Quagga precisa ser parado para prosseguir. "
-"Isto pode causar \"BGP flaps\" ou perda de conectividade de rede."
diff --git a/debian/po/ru.po b/debian/po/ru.po
deleted file mode 100644
index e1db9d37d3..0000000000
--- a/debian/po/ru.po
+++ /dev/null
@@ -1,37 +0,0 @@
-# translation of ru.po to Russian
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Yuri Kozlov <yuray@komyakino.ru>, 2009.
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.13-1\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2009-07-19 09:04+0400\n"
-"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
-"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
-"Language: ru\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "ДейÑтвительно оÑтановить Ñлужбу Quagga?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"ПРЕДУПРЕЖДЕÐИЕ: Ð”Ð»Ñ Ð¿Ñ€Ð¾Ð´Ð¾Ð»Ð¶ÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñлужба маршрутизации Quagga должна "
-"быть оÑтановлена. Это может привеÑти к переÑтройке таблиц BGP или потере "
-"ÑвÑзноÑти узлов Ñети."
diff --git a/debian/po/sv.po b/debian/po/sv.po
deleted file mode 100644
index f97c5b8276..0000000000
--- a/debian/po/sv.po
+++ /dev/null
@@ -1,40 +0,0 @@
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-# Developers do not need to manually edit POT or PO files.
-# , fuzzy
-#
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: quagga 0.99.1-6\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: 2005-10-04 06:56+0200\n"
-"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
-"Language-Team: Swedish <sv@li.org>\n"
-"Language: sv\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr "Vill du stoppa Quagga-daemonen?"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
-"VARNING: routingdaemonen Quagga måste stoppas för att fortsätta. Detta kan "
-"leda till BGP-flaps eller att nätverksförbindelsen avbryts."
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
deleted file mode 100644
index c6fb636872..0000000000
--- a/debian/po/templates.pot
+++ /dev/null
@@ -1,31 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: ch@debian.org\n"
-"POT-Creation-Date: 2006-07-15 20:31+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid "Do you really want to stop the Quagga daemon?"
-msgstr ""
-
-#. Type: boolean
-#. Description
-#: ../quagga.templates:1001
-msgid ""
-"WARNING: The Quagga routing daemon has to be stopped to proceed. This could "
-"lead to BGP flaps or loss of network connectivity."
-msgstr ""
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 5744505e64..0000000000
--- a/debian/rules
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/make -f
-
-export DH_VERBOSE=1
-export DEB_BUILD_HARDENING=1
-export DH_OPTIONS=-v
-
-ifeq ($(WANT_SNMP), 1)
- USE_SNMP=--enable-snmp
- $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
-else
- $(warning "DEBIAN: SNMP disabled, see README.Debian")
-endif
-
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
- DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-endif
-
-ifdef DEBIAN_JOBS
-MAKEFLAGS += -j$(DEBIAN_JOBS)
-endif
-
-%:
- dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing
-
-override_dh_auto_configure:
- # Frr needs /proc to check some BSD vs Linux specific stuff.
- # Else it fails with an obscure error message pointing out that
- # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
- @if ! [ -d /proc/1 ]; then \
- echo "./configure needs a mounted /proc"; \
- exit 1; \
- fi
-
- if ! [ -e config.status ]; then \
- dh_auto_configure -- \
- --enable-exampledir=/usr/share/doc/frr/examples/ \
- --localstatedir=/var/run/frr \
- --sbindir=/usr/lib/frr \
- --sysconfdir=/etc/frr \
- $(USE_SNMP) \
- --enable-ospfapi=yes \
- --enable-vtysh=yes \
- --enable-isisd=yes \
- --enable-multipath=256 \
- --enable-user=frr \
- --enable-group=frr \
- --enable-vty-group=frrvty \
- --enable-configfile-mask=0640 \
- --enable-logfile-mask=0640 \
- --enable-werror \
- --enable-gcc-rdynamic \
- --with-libpam \
- --enable-systemd=yes \
- --enable-poll=yes \
- --enable-cumulus=yes \
- --enable-pimd=yes \
- --enable-dependency-tracking \
- --enable-bgp-vnc=no; \
- fi
-
-override_dh_auto_build:
- #dh_auto_build
- $(MAKE)
- dh_auto_build -- -C doc draft-zebra-00.txt
-
-
- # doc/ is a bit crazy
-ifeq ($(GENERATE_PDF), 1)
- dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
-endif
- rm -vf doc/frr.info
- dh_auto_build -- -C doc frr.info
- rm -vf doc/frr.info.html*
-
-override_dh_auto_test:
-
-override_dh_auto_install:
- dh_auto_install
-
- # cleaning up the info dir
- rm -f debian/tmp/usr/share/info/dir*
-
- # install config files
- mkdir -p debian/tmp/etc/frr/
- perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
-
- # installing the Frr specific SNMP MIB
-ifeq ($(WANT_SNMP), 1)
- install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
-else
- mkdir -p debian/tmp/usr/share/snmp/mibs/
-endif
-
- # cleaning .la files
- sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
-
-override_dh_systemd_start:
- dh_systemd_start frr.service
-
-override_dh_systemd_enable:
- dh_systemd_enable frr.service
-
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 46ff1c7dab..0000000000
--- a/debian/watch
+++ /dev/null
@@ -1,8 +0,0 @@
-# Example watch control file for uscan
-# Rename this file to "watch" and then you can run the "uscan" command
-# to check for upstream updates and more.
-# Site Directory Pattern Version Script
-version=3
-opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)[\-\.]?\d*)$/$1~$2/ \
- http://download.savannah.gnu.org/releases/frr/quagga-(\d.*)\.(?:tgz|tar\.(?:gz|bz2|xz))
-# Bart Martens <bartm@debian.org> Fri, 25 Jan 2013 06:38:53 +0000
diff --git a/debianpkg/Makefile.am b/debianpkg/Makefile.am
new file mode 100644
index 0000000000..5ab5b4c4fc
--- /dev/null
+++ b/debianpkg/Makefile.am
@@ -0,0 +1,38 @@
+
+EXTRA_DIST = README.Debian README.Maintainer \
+ changelog compat control copyright \
+ rules source/format tests/control \
+ tests/daemons watchfrr.rc \
+ backports/README backports/rules \
+ backports/debian8/debian/source/format \
+ backports/debian8/exclude \
+ backports/debian8/versionext \
+ backports/debian9/debian/source/format \
+ backports/debian9/exclude \
+ backports/debian9/versionext \
+ backports/ubuntu12.04/debian/control \
+ backports/ubuntu12.04/debian/frr.install \
+ backports/ubuntu12.04/debian/frr.postinst \
+ backports/ubuntu12.04/debian/frr.postrm \
+ backports/ubuntu12.04/debian/rules \
+ backports/ubuntu12.04/debian/source/format \
+ backports/ubuntu12.04/exclude \
+ backports/ubuntu12.04/versionext \
+ backports/ubuntu14.04/debian/control \
+ backports/ubuntu14.04/debian/frr.install \
+ backports/ubuntu14.04/debian/frr.postinst \
+ backports/ubuntu14.04/debian/frr.postrm \
+ backports/ubuntu14.04/debian/rules \
+ backports/ubuntu14.04/debian/source/format \
+ backports/ubuntu14.04/exclude \
+ backports/ubuntu14.04/versionext \
+ backports/ubuntu16.04/debian/source/format \
+ backports/ubuntu16.04/exclude \
+ backports/ubuntu16.04/versionext \
+ frr-doc.docs frr-doc.info frr-doc.install \
+ frr-doc.lintian-overrides frr.conf \
+ frr.dirs frr.docs frr.install \
+ frr.lintian-overrides frr.logrotate \
+ frr.manpages frr.pam frr.postinst frr.postrm \
+ frr.preinst frr.prerm \
+ frr-pythontools.install
diff --git a/debian/README.Debian b/debianpkg/README.Debian
index 1b04803366..1b04803366 100644
--- a/debian/README.Debian
+++ b/debianpkg/README.Debian
diff --git a/debian/README.Maintainer b/debianpkg/README.Maintainer
index 84b68e1949..84b68e1949 100644
--- a/debian/README.Maintainer
+++ b/debianpkg/README.Maintainer
diff --git a/debianpkg/README.deb_build.md b/debianpkg/README.deb_build.md
new file mode 100644
index 0000000000..3156c3672d
--- /dev/null
+++ b/debianpkg/README.deb_build.md
@@ -0,0 +1,102 @@
+Building your own FRRouting Debian Package
+==========================================
+(Tested on Ubuntu 12.04, 14.04, 16.04 and Debian 8)
+
+1. Follow the package installation as outlined in doc/Building_on_XXXX.md
+ (XXXX refers your OS Distribution) to install the required build packages
+
+2. Install the following additional packages:
+
+ apt-get install realpath equivs groff fakeroot debhelper
+
+3. Checkout FRR under a **unpriviledged** user account
+
+ git clone https://github.com/frrouting/frr.git frr
+
+4. Run Bootstrap and make distribution tar.gz
+
+ cd frr
+ ./bootstrap.sh
+ ./configure --with-pkg-extra-version=-MyDebPkgVersion
+ make dist
+
+ Note: configure parameters are not important for the Debian Package
+ building - except the `with-pkg-extra-version` if you want to give the
+ Debian Package a specific name to mark your own unoffical build
+
+5. Edit `debianpkg/rules` and set the configuration as needed
+
+ Look for section `dh_auto_configure` to modify the configure
+ options as needed. Options might be different between main `rules` and
+ `backports/XXXX/debian/rules`. Please adjust as needed on all files
+
+6. Create backports debian sources
+
+ Move the `debianpkg` to `debian` and create the backports
+ (Debian requires to not ship a `debian` directory inside the source
+ directory to avoid build conflicts with the reserved `debian` subdirectory
+ name during the build)
+
+ mv debianpkg debian
+ make -f debian/rules backports
+
+ This will create a `frr_*.orig.tar.gz` with the source (same as dist tar),
+ and multiple `frr_*.debian.tar.xz` and `frr_*.dsc` for the debian package
+ source on each backport supported distribution
+
+6. Create a new directory to build the package and populate with package src
+
+ mkdir frrpkg
+ cd frrpkg
+ tar xf ~/frr/frr_*.orig.tar.gz
+ cd frr*
+ . /etc/os-release
+ tar xf ~/frr/frr_*${ID}${VERSION_ID}*.debian.tar.xz
+
+7. Build Debian Package Dependencies and install them as needed
+
+ sudo mk-build-deps --install debian/control
+
+8. Build Debian Package
+
+ debuild -b -uc -us
+
+DONE.
+
+If all works correctly, then you should end up with the Debian packages under
+`frrpkg`. If distributed, please make sure you distribute it together with
+the sources (`frr_*.orig.tar.gz`, `frr_*.debian.tar.xz` and `frr_*.dsc`)
+
+
+Enabling daemons after installation of the package:
+---------------------------------------------------
+
+1. Edit `/etc/frr/daemons` and enable required routing daemons (Zebra is
+probably needed for most deployments, so make sure to enable it.)
+
+2. Check your firewall / IPtables to make sure the routing protocols are
+allowed.
+
+3. Enable FRR at startup
+
+ - On `init.d` based systems (Ubuntu 12.04)
+
+ sudo update-rc.d frr defaults
+
+ - On `systemd` based systems (Debian 8, Ubuntu 14.04, 16.04)
+
+ sudo systemctl enable frr
+
+4. Start/Restart the daemons (or reboot)
+
+ - On `init.d` based systems (Ubuntu 12.04)
+
+ sudo invoke-rc.d frr start
+
+ - on `systemd` based systems (Debian 8, Ubuntu 14.04, 16.04)
+
+ sudo systemctl start frr
+
+
+Configuration is stored in `/etc/frr/*.conf` files and daemon selection
+is stored in `/etc/frr/daemons`.
diff --git a/debianpkg/backports/.gitignore b/debianpkg/backports/.gitignore
new file mode 100644
index 0000000000..3b20d26891
--- /dev/null
+++ b/debianpkg/backports/.gitignore
@@ -0,0 +1,2 @@
+*/*.dirhash
+*/debian/changelog
diff --git a/debianpkg/backports/README b/debianpkg/backports/README
new file mode 100644
index 0000000000..efd322e1d9
--- /dev/null
+++ b/debianpkg/backports/README
@@ -0,0 +1,28 @@
+This directory contains the debian directories for backports to other debian
+platforms. These are built via the `3.0 (custom)' source format, which
+allows one to build a source package directly out of tarballs (e.g. an
+orig.tar.gz tarball and a debian.tar.gz file), at which point the format can
+be changed to a real format (e.g. `3.0 (quilt)').
+
+Source packages are assembled via targets of the same name as the system to
+which the backport is done (e.g. `precise'), included in debian/rules.
+
+To create a new debian backport:
+
+* Add its name to `KNOWN_BACKPORTS', defined in debian/rules.
+* Create a directory of the same name in debian/backports.
+* Add the files `exclude', `versionext', and `debian/source/format' under
+ this directory:
+ * `exclude' contains whitespace-separated paths (relative to the root of
+ the source dir) that should be excluded from the source package (e.g.
+ debian/patches).
+ * `versionext' contains the suffix added to the version number for this
+ backport's build. Distributions often have guidelines for what this
+ should be. If left empty, no new debian/changelog entry is created.
+ * `debian/source/format' should contain the source format of the resulting
+ source package. As of of the writing of this document the only supported
+ format is `3.0 (quilt)'.
+* Add appropriate files under the `debian/' subdirectory. These will be
+ included in the source package, overriding any top-level `debian/' files
+ with equivalent paths.
+
diff --git a/debianpkg/backports/debian8/debian/source/format b/debianpkg/backports/debian8/debian/source/format
new file mode 100644
index 0000000000..163aaf8d82
--- /dev/null
+++ b/debianpkg/backports/debian8/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debianpkg/backports/debian8/exclude b/debianpkg/backports/debian8/exclude
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/debianpkg/backports/debian8/exclude
diff --git a/debianpkg/backports/debian8/versionext b/debianpkg/backports/debian8/versionext
new file mode 100644
index 0000000000..4824521f8c
--- /dev/null
+++ b/debianpkg/backports/debian8/versionext
@@ -0,0 +1 @@
+-1~debian8+1
diff --git a/debianpkg/backports/debian9/debian/source/format b/debianpkg/backports/debian9/debian/source/format
new file mode 100644
index 0000000000..163aaf8d82
--- /dev/null
+++ b/debianpkg/backports/debian9/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debianpkg/backports/debian9/exclude b/debianpkg/backports/debian9/exclude
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/debianpkg/backports/debian9/exclude
diff --git a/debianpkg/backports/debian9/versionext b/debianpkg/backports/debian9/versionext
new file mode 100644
index 0000000000..db85932115
--- /dev/null
+++ b/debianpkg/backports/debian9/versionext
@@ -0,0 +1 @@
+-1~debian9+1
diff --git a/debianpkg/backports/rules b/debianpkg/backports/rules
new file mode 100755
index 0000000000..d0c6dcc066
--- /dev/null
+++ b/debianpkg/backports/rules
@@ -0,0 +1,137 @@
+.PHONY: backports $(KNOWN_BACKPORTS)
+
+# error out if these files are missing
+required_files = $(foreach backport,$(KNOWN_BACKPORTS), \
+ $(addprefix debian/backports/$(backport)/, \
+ debian/source/format \
+ versionext \
+ exclude))
+$(if $(filter-out $(wildcard $(required_files)),$(required_files)), \
+ $(error missing required backports files: \
+ $(filter-out $(wildcard $(required_files)),$(required_files)). \
+ see debian/backports/README) \
+)
+
+TARBALLDIR ?= $(shell dh_testdir debian/changelog && realpath .)
+
+define backports-targets
+# if this file is empty, no automatic changelog entry is created
+VERSIONEXT_$(1) ?= $(strip \
+ $(shell cat $(wildcard debian/backports/$(1)/versionext)))
+DEBIAN_VERSION_$(1) = $(DEBIAN_VERSION)$$(VERSIONEXT_$(1))
+BACKPORTDIR_$(1) = $(realpath debian/backports/$(1))
+
+# as of right now, must be '3.0 (quilt)'
+SOURCEFORMAT_$(1) ?= $(strip \
+ $(shell cat debian/backports/$(1)/debian/source/format))
+
+# files checked for the dirhash (see below)
+FINDCMD_$(1) = find -L debian/backports/$(1)/debian \
+ -type f \
+ ! -path debian/backports/$(1)/debian/changelog
+
+# files *not* pulled from the root debian directory into the backport tarball:
+# debian/changelog (copied and edited for backport version entry)
+# debian/backports itself (relevant contents are copied out separately)
+# anything provided in the current backports debian dir
+# anything specified in the 'exclude' file in the current backports debian dir
+EXCLUDEROOT_$(1) = debian/changelog debian/backports \
+ $$(subst debian/backports/$(1)/,,$$(shell $$(FINDCMD_$(1)))) \
+ $$(shell cat debian/backports/$(1)/exclude)
+
+EXCLUDEROOT_TAR_$(1) = $$(foreach file,$$(EXCLUDEROOT_$(1)),--exclude $$(file))
+EXCLUDEROOT_FIND_$(1) = $$(foreach file,$$(EXCLUDEROOT_$(1)),-o -path $$(file))
+
+# find command resulting in all files that *will* be pulled into the backport
+# tarball.
+FINDCMDROOT_$(1) = find -L debian/ \
+ '(' -false $$(EXCLUDEROOT_FIND_$(1)) ')' -prune -o \
+ -type f -a '!' '(' -false $$(EXCLUDEROOT_FIND_$(1)) ')'
+
+# usually using `find' output for dependencies has the downfall of not tracking
+# file removal. Work around that by introducing a dependency on a file whose
+# name contains the hash of `find' output, so that the name will change when a
+# file is deleted.
+DIRHASH_$(1) = \
+ $$(shell $$(FINDCMD_$(1)) | sha1sum | sed -r 's/^(......).*/\1/')
+DIRHASHROOT_$(1) = \
+ $$(shell $$(FINDCMDROOT_$(1)) | sha1sum | sed -r 's/^(......).*/\1/')
+
+CONTROL_$(1) = $$(strip \
+ $$(if $$(wildcard $$(BACKPORTDIR_$(1))/debian/control), \
+ $$(BACKPORTDIR_$(1))/debian/control, \
+ $(realpath debian/control) \
+ ))
+
+# TARGETS:
+
+$(1): $(TARBALLDIR)/$(SRCPKG)_$$(DEBIAN_VERSION_$(1)).dsc ;
+
+# we use 3.0 (custom) to build a source package directly from tarballs,
+# bypassing the usual checks (which wouldn't like our combination-of-
+# directories approach)
+$(TARBALLDIR)/$(SRCPKG)_$$(DEBIAN_VERSION_$(1)).dsc:
+ dpkg-source -l$$(BACKPORTDIR_$(1))/debian/changelog \
+ -c$$(CONTROL_$(1)) \
+ --format='3.0 (custom)' \
+ --target-format='$$(SOURCEFORMAT_$(1))' \
+ -b . $$^
+ mv $(TARBALLDIR)/../$$(notdir $$@) $$@
+
+ifeq ($$(SOURCEFORMAT_$(1)),3.0 (quilt))
+# this target depends on the orig.tar.gz file, for which there is no target in
+# this makefile. It is assumed to either already exist or be built by a target
+# provided elsewhere in debian/rules (e.g. via pristine-tar)
+$$(if $$(findstring $(ORIG_VERSION),$$(DEBIAN_VERSION_$(1))), \
+ $$(info downstream version matches upstream version (good)), \
+ $$(error quilt format expects downstream version \
+ ($$(DEBIAN_VERSION_$(1))) to contain upstream version \
+ ($(ORIG_VERSION)). Make a new debian/changelog entry \
+ to reflect the new upstream release) \
+)
+
+$(TARBALLDIR)/$(SRCPKG)_$$(DEBIAN_VERSION_$(1)).dsc: \
+ $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz \
+ $(TARBALLDIR)/$(SRCPKG)_$$(DEBIAN_VERSION_$(1)).debian.tar.xz
+else
+$$(error unsupported source format for $(1) backport: $$(SOURCEFORMAT_$(1)))
+endif #SOURCEFORMAT_$(1)
+
+# for 3.0 (quilt)
+$(TARBALLDIR)/$(SRCPKG)_$$(DEBIAN_VERSION_$(1)).debian.tar.xz: \
+ $$(BACKPORTDIR_$(1))/debian/changelog \
+ $$(shell $$(FINDCMD_$(1))) \
+ $$(BACKPORTDIR_$(1))/$$(DIRHASH_$(1)).backport.dirhash \
+ $$(shell $$(FINDCMDROOT_$(1))) \
+ $$(BACKPORTDIR_$(1))/$$(DIRHASHROOT_$(1)).root.dirhash \
+ $$(BACKPORTDIR_$(1))/exclude
+ rm -f $$(subst .tar.xz,.tar,$$@) $$@
+ tar -chf $$(subst .tar.xz,.tar,$$@) \
+ --exclude-vcs $$(EXCLUDEROOT_TAR_$(1)) debian/
+ cd debian/backports/$(1) && tar -uhf $$(subst .tar.xz,.tar,$$@) \
+ --exclude-vcs debian/
+ xz $$(subst .tar.xz,.tar,$$@)
+
+$$(BACKPORTDIR_$(1))/debian/changelog: \
+ debian/changelog \
+ debian/backports/$(1)/versionext
+ rm -f debian/backports/$(1)/debian/changelog
+ cp $$< $$@
+ $(if $$(VERSIONEXT_$(1)), \
+ dch -c $$@ -v '$$(DEBIAN_VERSION_$(1))' -b \
+ 'backport to $(1) systems', \
+ )
+
+$$(BACKPORTDIR_$(1))/$$(DIRHASH_$(1)).backport.dirhash:
+ rm -f debian/backports/$(1)/*.backport.dirhash
+ touch $$@
+
+$$(BACKPORTDIR_$(1))/$$(DIRHASHROOT_$(1)).root.dirhash:
+ rm -f debian/backports/$(1)/*.root.dirhash
+ touch $$@
+
+endef # backports-targets
+$(foreach backport,$(KNOWN_BACKPORTS),$(eval \
+ $(call backports-targets,$(backport))))
+
+backports: $(KNOWN_BACKPORTS)
diff --git a/debianpkg/backports/ubuntu12.04/debian/control b/debianpkg/backports/ubuntu12.04/debian/control
new file mode 100644
index 0000000000..17ceeb0381
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/control
@@ -0,0 +1,56 @@
+Source: frr
+Section: net
+Priority: optional
+Maintainer: Nobody <nobody@frrouting.org>
+Uploaders: Nobody <nobody@frrouting.org>
+XSBC-Original-Maintainer: <maintainers@frrouting.org>
+Build-Depends: debhelper (>= 7.0.50~), libncurses5-dev, libreadline-dev, texlive-latex-base, texlive-generic-recommended, libpam0g-dev | libpam-dev, libcap-dev, texinfo (>= 4.7), imagemagick, ghostscript, groff, autotools-dev, libpcre3-dev, gawk, chrpath, libsnmp-dev, git, dh-autoreconf, libjson0, libjson0-dev, pkg-config, python (>= 2.7), python-ipaddr
+Standards-Version: 3.9.6
+Homepage: http://www.frrouting.org/
+XS-Testsuite: autopkgtest
+
+Package: frr
+Architecture: any
+Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), ${misc:Depends}
+Pre-Depends: adduser
+Conflicts: zebra, zebra-pj
+Replaces: zebra, zebra-pj
+Suggests: snmpd
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon forked from Quagga
+ FRR is free software which manages TCP/IP based routing protocols.
+ It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, RIPng,
+ PIM and LDP as well as the IPv6 versions of these.
+ .
+ FRR is a fork of Quagga with an open community model. The main git
+ lives on https://github.com/frrouting/frr.git
+
+Package: frr-dbg
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, frr (= ${binary:Version})
+Priority: extra
+Section: debug
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (debug symbols)
+ This package provides debugging symbols for all binary packages built
+ from frr source package. It's highly recommended to have this package
+ installed before reporting any FRR crashes to either FRR developers or
+ Debian package maintainers.
+
+Package: frr-doc
+Section: net
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: frr
+Description: documentation files for FRR
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
+
+Package: frr-pythontools
+Section: net
+Architecture: all
+Depends: ${misc:Depends}, frr (= ${binary:Version}), python (>= 2.7), python-ipaddr
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (Python Tools)
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
+
diff --git a/debianpkg/backports/ubuntu12.04/debian/frr.install b/debianpkg/backports/ubuntu12.04/debian/frr.install
new file mode 120000
index 0000000000..83ecca5958
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/frr.install
@@ -0,0 +1 @@
+../../ubuntu14.04/debian/frr.install \ No newline at end of file
diff --git a/debianpkg/backports/ubuntu12.04/debian/frr.postinst b/debianpkg/backports/ubuntu12.04/debian/frr.postinst
new file mode 120000
index 0000000000..eb98053c7b
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/frr.postinst
@@ -0,0 +1 @@
+../../ubuntu14.04/debian/frr.postinst \ No newline at end of file
diff --git a/debianpkg/backports/ubuntu12.04/debian/frr.postrm b/debianpkg/backports/ubuntu12.04/debian/frr.postrm
new file mode 120000
index 0000000000..4f4380872f
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/frr.postrm
@@ -0,0 +1 @@
+../../ubuntu14.04/debian/frr.postrm \ No newline at end of file
diff --git a/debianpkg/backports/ubuntu12.04/debian/rules b/debianpkg/backports/ubuntu12.04/debian/rules
new file mode 100755
index 0000000000..5c3e1363ce
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/rules
@@ -0,0 +1,179 @@
+#!/usr/bin/make -f
+
+# FRRouting Configuration options
+######################################
+#
+# WANT_xxxx --> Set to 1 for enable, 0 for disable
+# The following are the defaults. They can be overridden by setting a
+# env variable to a different value
+#
+# export WANT_LDP=1
+# export WANT_PIM=1
+# export WANT_OSPFAPI=1
+# export WANT_TCP_ZEBRA=0
+# export WANT_BGP_VNC=0
+# export WANT_CUMULUS_MODE=0
+# export WANT_MULTIPATH=1
+#
+# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
+# Please be aware that 0 is NOT disabled, but treated as unlimited
+# export MULTIPATH=256
+#
+# Set the following to the value required (or leave undefined for the default below)
+# WANT_FRR_USER is used for the username and groupname of the FRR user account
+# export WANT_FRR_USER=frr
+# export WANT_FRR_VTY_GROUP=frrvty
+#
+####################################
+
+export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DH_OPTIONS=-v
+
+ifeq ($(WANT_SNMP), 1)
+ USE_SNMP=--enable-snmp
+ $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
+else
+ $(warning "DEBIAN: SNMP disabled, see README.Debian")
+endif
+
+ifneq ($(WANT_LDP), 0)
+ USE_LDP=--enable-ldpd
+else
+ USE_LDP=--disable-ldpd
+endif
+
+ifneq ($(WANT_PIM), 0)
+ USE_PIM=--enable-pimd
+else
+ USE_PIM=--disable-pimd
+endif
+
+ifneq ($(WANT_OSPFAPI), 0)
+ USE_OSPFAPI=--enable-ospfapi=yes
+else
+ USE_OSPFAPI=--enable-ospfapi=no
+endif
+
+ifeq ($(WANT_TCP_ZEBRA),1)
+ USE_TCP_ZEBRA=--enable-tcp-zebra
+endif
+
+ifneq ($(WANT_BGP_VNC), 0)
+ USE_BGP_VNC=--enable-bgp-vnc=yes
+else
+ USE_BGP_VNC=--enable-bgp-vnc=no
+endif
+
+ifndef WANT_FRR_USER
+ USE_FRR_USER=--enable-user=frr
+ USE_FRR_GROUP=--enable-group=frr
+else
+ USE_FRR_USER=$(WANT_FRR_USER)
+ USE_FRR_GROUP=$(WANT_FRR_USER)
+endif
+
+ifndef WANT_FRR_VTY_GROUP
+ USE_FRR_VTY_GROUP=--enable-vty-group=frrvty
+else
+ USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
+endif
+
+ifneq ($(WANT_MULTIPATH), 0)
+ ifdef MULTIPATH
+ USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
+ else
+ USE_MULTIPATH=--enable-multipath=256
+ endif
+else
+ USE_MULTIPATH=--disable-multipath
+endif
+
+ifeq ($(WANT_CUMULUS_NODE), 1)
+ USE_CUMULUS=--enable-cumulus=yes
+else
+ USE_CUMULUS=--enable-cumulus=no
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
+ifdef DEBIAN_JOBS
+MAKEFLAGS += -j$(DEBIAN_JOBS)
+endif
+
+%:
+ dh $@ --with=autoreconf --parallel --dbg-package=frr-dbg --list-missing
+
+override_dh_auto_configure:
+ # Frr needs /proc to check some BSD vs Linux specific stuff.
+ # Else it fails with an obscure error message pointing out that
+ # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
+ @if ! [ -d /proc/1 ]; then \
+ echo "./configure needs a mounted /proc"; \
+ exit 1; \
+ fi
+
+ if ! [ -e config.status ]; then \
+ dh_auto_configure -- \
+ --enable-exampledir=/usr/share/doc/frr/examples/ \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ $(USE_SNMP) \
+ $(USE_OSPFAPI) \
+ $(USE_MULTIPATH) \
+ $(USE_LDP) \
+ $(USE_TCP_ZEBRA) \
+ --enable-fpm \
+ $(USE_FRR_USER) $(USE_FRR_GROUP) \
+ $(USE_FRR_VTY_GROUP) \
+ --enable-configfile-mask=0640 \
+ --enable-logfile-mask=0640 \
+ --with-libpam \
+ --enable-systemd=no \
+ --enable-poll=yes \
+ $(USE_CUMULUS) \
+ $(USE_PIM) \
+ --enable-dependency-tracking \
+ $(USE_BGP_VNC) \
+ $(shell dpkg-buildflags --export=configure); \
+ fi
+
+override_dh_auto_build:
+ #dh_auto_build
+ $(MAKE)
+ dh_auto_build -- -C doc draft-zebra-00.txt
+
+
+ # doc/ is a bit crazy
+ifeq ($(GENERATE_PDF), 1)
+ dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
+endif
+ rm -vf doc/frr.info
+ dh_auto_build -- -C doc frr.info
+ rm -vf doc/frr.info.html*
+
+override_dh_auto_test:
+
+override_dh_auto_install:
+ dh_auto_install
+
+ # installed in frr-pythontools
+ rm debian/tmp/usr/lib/frr/frr-reload.py
+
+ # cleaning up the info dir
+ rm -f debian/tmp/usr/share/info/dir*
+
+ # install config files
+ mkdir -p debian/tmp/etc/frr/
+ perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
+
+ # installing the Frr specific SNMP MIB
+ install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
+
+ # cleaning .la files
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la
+
diff --git a/debianpkg/backports/ubuntu12.04/debian/source/format b/debianpkg/backports/ubuntu12.04/debian/source/format
new file mode 100644
index 0000000000..163aaf8d82
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debianpkg/backports/ubuntu12.04/exclude b/debianpkg/backports/ubuntu12.04/exclude
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/exclude
diff --git a/debianpkg/backports/ubuntu12.04/versionext b/debianpkg/backports/ubuntu12.04/versionext
new file mode 100644
index 0000000000..159e2e4160
--- /dev/null
+++ b/debianpkg/backports/ubuntu12.04/versionext
@@ -0,0 +1 @@
+-1~ubuntu12.04+1
diff --git a/debianpkg/backports/ubuntu14.04/debian/control b/debianpkg/backports/ubuntu14.04/debian/control
new file mode 100644
index 0000000000..c22bd3bd58
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/debian/control
@@ -0,0 +1,56 @@
+Source: frr
+Section: net
+Priority: optional
+Maintainer: Nobody <nobody@frrouting.org>
+Uploaders: Nobody <nobody@frrouting.org>
+XSBC-Original-Maintainer: <maintainers@frrouting.org>
+Build-Depends: debhelper (>= 7.0.50~), libncurses5-dev, libreadline-dev, texlive-latex-base, texlive-generic-recommended, libpam0g-dev | libpam-dev, libcap-dev, texinfo (>= 4.7), imagemagick, ghostscript, groff, autotools-dev, libpcre3-dev, gawk, chrpath, libsnmp-dev, git, dh-autoreconf, libjson-c-dev, libjson-c2, pkg-config, python (>= 2.7), python-ipaddr
+Standards-Version: 3.9.6
+Homepage: http://www.frrouting.org/
+XS-Testsuite: autopkgtest
+
+Package: frr
+Architecture: any
+Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), ${misc:Depends}
+Pre-Depends: adduser
+Conflicts: zebra, zebra-pj
+Replaces: zebra, zebra-pj
+Suggests: snmpd
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon forked from Quagga
+ FRR is free software which manages TCP/IP based routing protocols.
+ It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, RIPng,
+ PIM and LDP as well as the IPv6 versions of these.
+ .
+ FRR is a fork of Quagga with an open community model. The main git
+ lives on https://github.com/frrouting/frr.git
+
+Package: frr-dbg
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, frr (= ${binary:Version})
+Priority: extra
+Section: debug
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (debug symbols)
+ This package provides debugging symbols for all binary packages built
+ from frr source package. It's highly recommended to have this package
+ installed before reporting any FRR crashes to either FRR developers or
+ Debian package maintainers.
+
+Package: frr-doc
+Section: net
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: frr
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (documentation)
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
+
+Package: frr-pythontools
+Section: net
+Architecture: all
+Depends: ${misc:Depends}, frr (= ${binary:Version}), python (>= 2.7), python-ipaddr
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (Python Tools)
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
+
diff --git a/debianpkg/backports/ubuntu14.04/debian/frr.install b/debianpkg/backports/ubuntu14.04/debian/frr.install
new file mode 100644
index 0000000000..adce915e1f
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/debian/frr.install
@@ -0,0 +1,21 @@
+etc/frr/
+usr/bin/vtysh
+usr/include/frr/
+usr/lib/
+tools/frr etc/init.d/
+usr/share/doc/frr/
+usr/share/man/man1/vtysh.1
+usr/share/man/man1/frr.1
+usr/share/man/man8
+usr/share/man/man8/bgpd.8
+usr/share/man/man8/ospf6d.8
+usr/share/man/man8/ospfd.8
+usr/share/man/man8/ripd.8
+usr/share/man/man8/ripngd.8
+usr/share/man/man8/zebra.8
+usr/share/man/man8/isisd.8
+usr/share/man/man8/watchfrr.8
+usr/share/snmp/mibs/
+tools/etc/* etc/
+tools/*.service lib/systemd/system
+debian/frr.conf usr/lib/tmpfiles.d
diff --git a/debian/frr.postinst b/debianpkg/backports/ubuntu14.04/debian/frr.postinst
index 9020d7bf7a..b1d463a33d 100644
--- a/debian/frr.postinst
+++ b/debianpkg/backports/ubuntu14.04/debian/frr.postinst
@@ -32,9 +32,7 @@ if [ "$1" = "abort-upgrade" ]; then
exit 0
fi
-. /usr/share/debconf/confmodule
-
-db_stop
+update-rc.d frr defaults > /dev/null
#DEBHELPER#
diff --git a/debianpkg/backports/ubuntu14.04/debian/frr.postrm b/debianpkg/backports/ubuntu14.04/debian/frr.postrm
new file mode 100644
index 0000000000..48c23321f7
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/debian/frr.postrm
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
+# set -u not because of debhelper
+
+update-rc.d -f frr remove >> /dev/null
+
+if [ "$1" = "purge" ]; then
+ rm -rf /etc/frr /var/run/frr /var/log/frr
+ userdel frr >/dev/null 2>&1 || true
+fi
+
+#DEBHELPER#
diff --git a/debianpkg/backports/ubuntu14.04/debian/rules b/debianpkg/backports/ubuntu14.04/debian/rules
new file mode 100755
index 0000000000..b1f539def6
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/debian/rules
@@ -0,0 +1,185 @@
+#!/usr/bin/make -f
+
+# FRRouting Configuration options
+######################################
+#
+# WANT_xxxx --> Set to 1 for enable, 0 for disable
+# The following are the defaults. They can be overridden by setting a
+# env variable to a different value
+#
+# export WANT_LDP=1
+# export WANT_PIM=1
+# export WANT_OSPFAPI=1
+# export WANT_TCP_ZEBRA=0
+# export WANT_BGP_VNC=0
+# export WANT_CUMULUS_MODE=0
+# export WANT_MULTIPATH=1
+#
+# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
+# Please be aware that 0 is NOT disabled, but treated as unlimited
+# export MULTIPATH=256
+#
+# Set the following to the value required (or leave undefined for the default below)
+# WANT_FRR_USER is used for the username and groupname of the FRR user account
+# export WANT_FRR_USER=frr
+# export WANT_FRR_VTY_GROUP=frrvty
+#
+####################################
+
+export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DH_OPTIONS=-v
+
+ifeq ($(WANT_SNMP), 1)
+ USE_SNMP=--enable-snmp
+ $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
+else
+ $(warning "DEBIAN: SNMP disabled, see README.Debian")
+endif
+
+ifneq ($(WANT_LDP), 0)
+ USE_LDP=--enable-ldpd
+else
+ USE_LDP=--disable-ldpd
+endif
+
+ifneq ($(WANT_PIM), 0)
+ USE_PIM=--enable-pimd
+else
+ USE_PIM=--disable-pimd
+endif
+
+ifneq ($(WANT_OSPFAPI), 0)
+ USE_OSPFAPI=--enable-ospfapi=yes
+else
+ USE_OSPFAPI=--enable-ospfapi=no
+endif
+
+ifeq ($(WANT_TCP_ZEBRA),1)
+ USE_TCP_ZEBRA=--enable-tcp-zebra
+endif
+
+ifneq ($(WANT_BGP_VNC), 0)
+ USE_BGP_VNC=--enable-bgp-vnc=yes
+else
+ USE_BGP_VNC=--enable-bgp-vnc=no
+endif
+
+ifndef WANT_FRR_USER
+ USE_FRR_USER=--enable-user=frr
+ USE_FRR_GROUP=--enable-group=frr
+else
+ USE_FRR_USER=$(WANT_FRR_USER)
+ USE_FRR_GROUP=$(WANT_FRR_USER)
+endif
+
+ifndef WANT_FRR_VTY_GROUP
+ USE_FRR_VTY_GROUP=--enable-vty-group=frrvty
+else
+ USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
+endif
+
+ifneq ($(WANT_MULTIPATH), 0)
+ ifdef MULTIPATH
+ USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
+ else
+ USE_MULTIPATH=--enable-multipath=256
+ endif
+else
+ USE_MULTIPATH=--disable-multipath
+endif
+
+ifeq ($(WANT_CUMULUS_NODE), 1)
+ USE_CUMULUS=--enable-cumulus=yes
+else
+ USE_CUMULUS=--enable-cumulus=no
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
+ifdef DEBIAN_JOBS
+MAKEFLAGS += -j$(DEBIAN_JOBS)
+endif
+
+%:
+ dh $@ --with=autoreconf --parallel --dbg-package=frr-dbg --list-missing
+
+override_dh_auto_configure:
+ # Frr needs /proc to check some BSD vs Linux specific stuff.
+ # Else it fails with an obscure error message pointing out that
+ # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
+ @if ! [ -d /proc/1 ]; then \
+ echo "./configure needs a mounted /proc"; \
+ exit 1; \
+ fi
+
+ if ! [ -e config.status ]; then \
+ dh_auto_configure -- \
+ --enable-exampledir=/usr/share/doc/frr/examples/ \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ $(USE_SNMP) \
+ $(USE_OSPFAPI) \
+ $(USE_MULTIPATH) \
+ $(USE_LDP) \
+ $(USE_TCP_ZEBRA) \
+ --enable-fpm \
+ $(USE_FRR_USER) $(USE_FRR_GROUP) \
+ $(USE_FRR_VTY_GROUP) \
+ --enable-configfile-mask=0640 \
+ --enable-logfile-mask=0640 \
+ --with-libpam \
+ --enable-systemd=no \
+ --enable-poll=yes \
+ $(USE_CUMULUS) \
+ $(USE_PIM) \
+ --enable-dependency-tracking \
+ $(USE_BGP_VNC) \
+ $(shell dpkg-buildflags --export=configure); \
+ fi
+
+override_dh_auto_build:
+ #dh_auto_build
+ $(MAKE)
+ dh_auto_build -- -C doc draft-zebra-00.txt
+
+
+ # doc/ is a bit crazy
+ifeq ($(GENERATE_PDF), 1)
+ dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
+endif
+ rm -vf doc/frr.info
+ dh_auto_build -- -C doc frr.info
+ rm -vf doc/frr.info.html*
+
+override_dh_auto_test:
+
+override_dh_auto_install:
+ dh_auto_install
+
+ # installed in frr-pythontools
+ rm debian/tmp/usr/lib/frr/frr-reload.py
+
+ # cleaning up the info dir
+ rm -f debian/tmp/usr/share/info/dir*
+
+ # install config files
+ mkdir -p debian/tmp/etc/frr/
+ perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
+
+ # installing the Frr specific SNMP MIB
+ install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
+
+ # cleaning .la files
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la
+
+override_dh_systemd_start:
+ dh_systemd_start frr.service
+
+override_dh_systemd_enable:
+ dh_systemd_enable frr.service
+
diff --git a/debianpkg/backports/ubuntu14.04/debian/source/format b/debianpkg/backports/ubuntu14.04/debian/source/format
new file mode 100644
index 0000000000..163aaf8d82
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debianpkg/backports/ubuntu14.04/exclude b/debianpkg/backports/ubuntu14.04/exclude
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/exclude
diff --git a/debianpkg/backports/ubuntu14.04/versionext b/debianpkg/backports/ubuntu14.04/versionext
new file mode 100644
index 0000000000..c5be0650af
--- /dev/null
+++ b/debianpkg/backports/ubuntu14.04/versionext
@@ -0,0 +1 @@
+-1~ubuntu14.04+1
diff --git a/debianpkg/backports/ubuntu16.04/debian/source/format b/debianpkg/backports/ubuntu16.04/debian/source/format
new file mode 100644
index 0000000000..163aaf8d82
--- /dev/null
+++ b/debianpkg/backports/ubuntu16.04/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debianpkg/backports/ubuntu16.04/exclude b/debianpkg/backports/ubuntu16.04/exclude
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/debianpkg/backports/ubuntu16.04/exclude
diff --git a/debianpkg/backports/ubuntu16.04/versionext b/debianpkg/backports/ubuntu16.04/versionext
new file mode 100644
index 0000000000..dc33d97a12
--- /dev/null
+++ b/debianpkg/backports/ubuntu16.04/versionext
@@ -0,0 +1 @@
+-1~ubuntu16.04+1
diff --git a/debian/changelog b/debianpkg/changelog.in
index 4ea86929fc..8f3f4753de 100644
--- a/debian/changelog
+++ b/debianpkg/changelog.in
@@ -1,10 +1,16 @@
-frr (3.1-dev) Released; urgency=medium
+frr (@VERSION@) RELEASED; urgency=medium
* New Enabled: PIM draft Unnumbered
- -- frr <frog@lists.frrouting.org> Wed, 5 Apr 2017 22:29:42 -0500
+ -- FRRouting-Dev <dev@lists.frrouting.org> Wed, 18 Oct 2017 17:01:42 -0700
-frr (3.0) Released; urgency=medium
+frr (3.0-1) RELEASED; urgency=medium
+
+ * Added Debian 9 Backport
+
+ -- FRRouting-Dev <dev@lists.frrouting.org> Mon, 16 Oct 2017 03:28:00 -0700
+
+frr (3.0-0) RELEASED; urgency=medium
* New Enabled: BGP Shutdown Message
* New Enabled: BGP Large Community
@@ -22,14 +28,15 @@ frr (3.0) Released; urgency=medium
* New Enabled: PIM Sparse Mode
* New Enabled: NHRP RFC 2332
* New Enabled: Label Manager
+ * Switched from hardening-wrapper to dpkg-buildflags.
- -- frr <frr@lists.nox.tf> Wed, 5 Apr 2017 22:23:42 -0500
+ -- FRRouting-Dev <dev@lists.frrouting.org> Fri, 13 Oct 2017 16:17:26 -0700
-frr (2.1) Released; urgency=medium
+frr (2.0-0) RELEASED; urgency=medium
* Switchover to FRR
- -- frr <frr@lists.nox.tf> Mon, 23 Jan 2017 16:30:22 -0400
+ -- FRRouting-Dev <dev@lists.frrouting.org> Mon, 23 Jan 2017 16:30:22 -0400
quagga (0.99.24+cl3u5) RELEASED; urgency=medium
diff --git a/debian/compat b/debianpkg/compat
index 7f8f011eb7..7f8f011eb7 100644
--- a/debian/compat
+++ b/debianpkg/compat
diff --git a/debianpkg/control b/debianpkg/control
new file mode 100644
index 0000000000..297a7cf106
--- /dev/null
+++ b/debianpkg/control
@@ -0,0 +1,54 @@
+Source: frr
+Section: net
+Priority: optional
+Maintainer: Nobody <nobody@frrouting.org>
+Uploaders: Nobody <nobody@frrouting.org>
+XSBC-Original-Maintainer: <maintainers@frrouting.org>
+Build-Depends: debhelper (>= 7.0.50~), libncurses5-dev, libreadline-dev, texlive-latex-base, texlive-generic-recommended, libpam0g-dev | libpam-dev, libcap-dev, texinfo (>= 4.7), imagemagick, ghostscript, groff, autotools-dev, libpcre3-dev, gawk, chrpath, libsnmp-dev, git, dh-autoreconf, libjson-c-dev, libjson-c2 | libjson-c3, dh-systemd, libsystemd-dev, bison, flex, libc-ares-dev, pkg-config, python (>= 2.7), python-ipaddr
+Standards-Version: 3.9.6
+Homepage: http://www.frrouting.org/
+
+Package: frr
+Architecture: any
+Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), iproute2 | iproute, ${misc:Depends}, libc-ares2
+Pre-Depends: adduser
+Conflicts: zebra, zebra-pj, quagga
+Replaces: zebra, zebra-pj
+Suggests: snmpd
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon forked from Quagga
+ FRR is free software which manages TCP/IP based routing protocols.
+ It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, RIPng,
+ PIM and LDP as well as the IPv6 versions of these.
+ .
+ FRR is a fork of Quagga with an open community model. The main git
+ lives on https://github.com/frrouting/frr.git
+
+Package: frr-dbg
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, frr (= ${binary:Version})
+Priority: extra
+Section: debug
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (debug symbols)
+ This package provides debugging symbols for all binary packages built
+ from frr source package. It's highly recommended to have this package
+ installed before reporting any FRR crashes to either FRR developers or
+ Debian package maintainers.
+
+Package: frr-doc
+Section: net
+Architecture: all
+Depends: ${misc:Depends}
+Suggests: frr
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (documentation)
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
+
+Package: frr-pythontools
+Section: net
+Architecture: all
+Depends: ${misc:Depends}, frr (= ${binary:Version}), python (>= 2.7), python-ipaddr
+Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon (Python Tools)
+ This package includes info files for frr, a free software which manages
+ TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3,
+ IS-IS, RIPv1, RIPv2, RIPng, PIM and LDP as well as the IPv6 versions of these.
diff --git a/debian/copyright b/debianpkg/copyright
index 7b873abd31..7b873abd31 100644
--- a/debian/copyright
+++ b/debianpkg/copyright
diff --git a/debian/frr-doc.docs b/debianpkg/frr-doc.docs
index a0776fd68a..a0776fd68a 100644
--- a/debian/frr-doc.docs
+++ b/debianpkg/frr-doc.docs
diff --git a/debian/frr-doc.info b/debianpkg/frr-doc.info
index c4f181cdb0..c4f181cdb0 100644
--- a/debian/frr-doc.info
+++ b/debianpkg/frr-doc.info
diff --git a/debianpkg/frr-doc.install b/debianpkg/frr-doc.install
new file mode 100644
index 0000000000..e5910fec8f
--- /dev/null
+++ b/debianpkg/frr-doc.install
@@ -0,0 +1,2 @@
+usr/share/info
+doc/*.png usr/share/info
diff --git a/debian/frr-doc.lintian-overrides b/debianpkg/frr-doc.lintian-overrides
index 1fe64ffd53..1fe64ffd53 100644
--- a/debian/frr-doc.lintian-overrides
+++ b/debianpkg/frr-doc.lintian-overrides
diff --git a/debianpkg/frr-pythontools.install b/debianpkg/frr-pythontools.install
new file mode 100644
index 0000000000..aee093cf69
--- /dev/null
+++ b/debianpkg/frr-pythontools.install
@@ -0,0 +1 @@
+tools/frr-reload.py usr/lib/frr/
diff --git a/debian/frr.conf b/debianpkg/frr.conf
index dee3cd849a..dee3cd849a 100644
--- a/debian/frr.conf
+++ b/debianpkg/frr.conf
diff --git a/debian/frr.dirs b/debianpkg/frr.dirs
index 56699b2daa..56699b2daa 100644
--- a/debian/frr.dirs
+++ b/debianpkg/frr.dirs
diff --git a/debian/frr.docs b/debianpkg/frr.docs
index f72aae1967..f72aae1967 100644
--- a/debian/frr.docs
+++ b/debianpkg/frr.docs
diff --git a/debian/frr.install b/debianpkg/frr.install
index 8fc5fa5fa6..2d86009dba 100644
--- a/debian/frr.install
+++ b/debianpkg/frr.install
@@ -2,7 +2,6 @@ etc/frr/
usr/bin/vtysh
usr/include/frr/
usr/lib/
-tools/frr-reload.py usr/lib/frr/
tools/frr usr/lib/frr
usr/share/doc/frr/
usr/share/man/man1/vtysh.1
diff --git a/debian/frr.lintian-overrides b/debianpkg/frr.lintian-overrides
index e21bd9256d..e352ad6cf4 100644
--- a/debian/frr.lintian-overrides
+++ b/debianpkg/frr.lintian-overrides
@@ -1,3 +1,4 @@
frr: non-dev-pkg-with-shlib-symlink usr/lib/libfrrospfapiclient.so.0.0.0 usr/lib/libfrrospfapiclient.so
frr: non-dev-pkg-with-shlib-symlink usr/lib/libfrr.so.0.0.0 usr/lib/libfrr.so
-frr: package-name-doesnt-match-sonames libfrrospf0 libfrrospfapiclient0 libfrr0
+frr: non-dev-pkg-with-shlib-symlink usr/lib/libfrrfpm_pb.so.0.0.0 usr/lib/libfrrfpm_pb.so
+frr: package-name-doesnt-match-sonames libfrr0 libfrrfpm-pb0 libfrrospfapiclient0
diff --git a/debian/frr.logrotate b/debianpkg/frr.logrotate
index 2b4acd89c7..2b4acd89c7 100644
--- a/debian/frr.logrotate
+++ b/debianpkg/frr.logrotate
diff --git a/debian/frr.manpages b/debianpkg/frr.manpages
index 17a128b7e3..17a128b7e3 100644
--- a/debian/frr.manpages
+++ b/debianpkg/frr.manpages
diff --git a/debian/frr.pam b/debianpkg/frr.pam
index 2b106d43bc..2b106d43bc 100644
--- a/debian/frr.pam
+++ b/debianpkg/frr.pam
diff --git a/debianpkg/frr.postinst b/debianpkg/frr.postinst
new file mode 100644
index 0000000000..cbc45f03eb
--- /dev/null
+++ b/debianpkg/frr.postinst
@@ -0,0 +1,36 @@
+#!/bin/bash -e
+
+######################
+PASSWDFILE=/etc/passwd
+GROUPFILE=/etc/group
+
+frruid=`egrep "^frr:" $PASSWDFILE | awk -F ":" '{ print $3 }'`
+frrgid=`egrep "^frr:" $GROUPFILE | awk -F ":" '{ print $3 }'`
+frrvtygid=`egrep "^frrvty:" $GROUPFILE | awk -F ":" '{ print $3 }'`
+
+[ -n ${frruid} ] || (echo "No uid for frr in ${PASSWDFILE}" && /bin/false)
+[ -n ${frrgid} ] || (echo "No gid for frr in ${GROUPFILE}" && /bin/false)
+[ -n ${frrVTYgid} ] || (echo "No gid for frrvty in ${GROUPFILE}" && /bin/false)
+
+chown -R ${frruid}:${frrgid} /etc/frr
+touch /etc/frr/vtysh.conf
+chgrp ${frrvtygid} /etc/frr/vtysh*
+chmod 644 /etc/frr/*
+
+ENVIRONMENTFILE=/etc/environment
+if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then
+ echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE}
+fi
+##################################################
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
+
+# This is most likely due to the answer "no" to the "really stop the server"
+# question in the prerm script.
+if [ "$1" = "abort-upgrade" ]; then
+ exit 0
+fi
+
+#DEBHELPER#
+
diff --git a/debian/frr.postrm b/debianpkg/frr.postrm
index 26576fd136..26576fd136 100644
--- a/debian/frr.postrm
+++ b/debianpkg/frr.postrm
diff --git a/debian/frr.preinst b/debianpkg/frr.preinst
index 29162e3b56..29162e3b56 100644
--- a/debian/frr.preinst
+++ b/debianpkg/frr.preinst
diff --git a/debian/frr.prerm b/debianpkg/frr.prerm
index e0df24e10f..4b71202810 100644
--- a/debian/frr.prerm
+++ b/debianpkg/frr.prerm
@@ -1,7 +1,5 @@
#!/bin/bash -e
-. /usr/share/debconf/confmodule
-
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}
diff --git a/debianpkg/rules b/debianpkg/rules
new file mode 100755
index 0000000000..04d28762aa
--- /dev/null
+++ b/debianpkg/rules
@@ -0,0 +1,218 @@
+#!/usr/bin/make -f
+
+# FRRouting Configuration options
+######################################
+#
+# WANT_xxxx --> Set to 1 for enable, 0 for disable
+# The following are the defaults. They can be overridden by setting a
+# env variable to a different value
+#
+# export WANT_LDP=1
+# export WANT_PIM=1
+# export WANT_OSPFAPI=1
+# export WANT_TCP_ZEBRA=0
+# export WANT_BGP_VNC=0
+# export WANT_CUMULUS_MODE=0
+# export WANT_MULTIPATH=1
+#
+# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
+# Please be aware that 0 is NOT disabled, but treated as unlimited
+# export MULTIPATH=256
+#
+# Set the following to the value required (or leave undefined for the default below)
+# WANT_FRR_USER is used for the username and groupname of the FRR user account
+# export WANT_FRR_USER=frr
+# export WANT_FRR_VTY_GROUP=frrvty
+#
+####################################
+
+export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DH_OPTIONS=-v
+
+ifeq ($(WANT_SNMP), 1)
+ USE_SNMP=--enable-snmp
+ $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
+else
+ $(warning "DEBIAN: SNMP disabled, see README.Debian")
+endif
+
+ifneq ($(WANT_LDP), 0)
+ USE_LDP=--enable-ldpd
+else
+ USE_LDP=--disable-ldpd
+endif
+
+ifneq ($(WANT_PIM), 0)
+ USE_PIM=--enable-pimd
+else
+ USE_PIM=--disable-pimd
+endif
+
+ifneq ($(WANT_OSPFAPI), 0)
+ USE_OSPFAPI=--enable-ospfapi=yes
+else
+ USE_OSPFAPI=--enable-ospfapi=no
+endif
+
+ifeq ($(WANT_TCP_ZEBRA),1)
+ USE_TCP_ZEBRA=--enable-tcp-zebra
+endif
+
+ifneq ($(WANT_BGP_VNC), 0)
+ USE_BGP_VNC=--enable-bgp-vnc=yes
+else
+ USE_BGP_VNC=--enable-bgp-vnc=no
+endif
+
+ifndef WANT_FRR_USER
+ USE_FRR_USER=--enable-user=frr
+ USE_FRR_GROUP=--enable-group=frr
+else
+ USE_FRR_USER=$(WANT_FRR_USER)
+ USE_FRR_GROUP=$(WANT_FRR_USER)
+endif
+
+ifndef WANT_FRR_VTY_GROUP
+ USE_FRR_VTY_GROUP=--enable-vty-group=frrvty
+else
+ USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
+endif
+
+ifneq ($(WANT_MULTIPATH), 0)
+ ifdef MULTIPATH
+ USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
+ else
+ USE_MULTIPATH=--enable-multipath=256
+ endif
+else
+ USE_MULTIPATH=--disable-multipath
+endif
+
+ifeq ($(WANT_CUMULUS_NODE), 1)
+ USE_CUMULUS=--enable-cumulus=yes
+else
+ USE_CUMULUS=--enable-cumulus=no
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
+ifdef DEBIAN_JOBS
+MAKEFLAGS += -j$(DEBIAN_JOBS)
+endif
+
+%:
+ dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing
+
+override_dh_auto_configure:
+ # Frr needs /proc to check some BSD vs Linux specific stuff.
+ # Else it fails with an obscure error message pointing out that
+ # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
+ @if ! [ -d /proc/1 ]; then \
+ echo "./configure needs a mounted /proc"; \
+ exit 1; \
+ fi
+
+ if ! [ -e config.status ]; then \
+ dh_auto_configure -- \
+ --enable-exampledir=/usr/share/doc/frr/examples/ \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ $(USE_SNMP) \
+ $(USE_OSPFAPI) \
+ $(USE_MULTIPATH) \
+ $(USE_LDP) \
+ $(USE_TCP_ZEBRA) \
+ --enable-fpm \
+ $(USE_FRR_USER) $(USE_FRR_GROUP) \
+ $(USE_FRR_VTY_GROUP) \
+ --enable-configfile-mask=0640 \
+ --enable-logfile-mask=0640 \
+ --enable-werror \
+ --with-libpam \
+ --enable-systemd=yes \
+ --enable-poll=yes \
+ $(USE_CUMULUS) \
+ $(USE_PIM) \
+ --enable-dependency-tracking \
+ $(USE_BGP_VNC) \
+ $(shell dpkg-buildflags --export=configure); \
+ fi
+
+override_dh_auto_build:
+ #dh_auto_build
+ $(MAKE)
+ dh_auto_build -- -C doc draft-zebra-00.txt
+
+
+ # doc/ is a bit crazy
+ifeq ($(GENERATE_PDF), 1)
+ dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
+endif
+ rm -vf doc/frr.info
+ dh_auto_build -- -C doc frr.info
+ rm -vf doc/frr.info.html*
+
+override_dh_auto_test:
+
+override_dh_auto_install:
+ dh_auto_install
+
+ # installed in frr-pythontools
+ rm debian/tmp/usr/lib/frr/frr-reload.py
+
+ # cleaning up the info dir
+ rm -f debian/tmp/usr/share/info/dir*
+
+ # install config files
+ mkdir -p debian/tmp/etc/frr/
+ perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
+
+ # installing the Frr specific SNMP MIB
+ifeq ($(WANT_SNMP), 1)
+ install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
+else
+ mkdir -p debian/tmp/usr/share/snmp/mibs/
+endif
+
+ # cleaning .la files
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
+ sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la
+
+override_dh_systemd_start:
+ dh_systemd_start frr.service
+
+override_dh_systemd_enable:
+ dh_systemd_enable frr.service
+
+# backports
+SRCPKG = frr
+KNOWN_BACKPORTS = debian8 debian9 ubuntu12.04 ubuntu14.04 ubuntu16.04
+DEBIAN_VERSION := $(shell dh_testdir && \
+ dpkg-parsechangelog -c1 < debian/changelog | \
+ sed -rn 's/^Version: ?//p')
+ORIG_VERSION := $(DEBIAN_VERSION)
+-include debian/backports/rules
+
+ifneq ($(TARBALLDIR),)
+ifeq ($(wildcard frr-$(ORIG_VERSION).tar.gz),frr-$(ORIG_VERSION).tar.gz)
+
+$(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: \
+ frr-$(ORIG_VERSION).tar.gz
+ cp $< $@
+
+else # wildcard frr-$(ORIG_VERSION).tar.gz
+
+# better error message on missing .orig.tar.gz
+$(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz:
+ @ echo "\`$(TARBALLDIR)/$(SRCPKG)-$(ORIG_VERSION).tar.gz'" not \
+ found and not generated by debian/rules. Provided you have the \
+ necessary packages installed, you can generate it yourself via \
+ "\"./bootstrap.sh && ./configure && make dist\"".
+ exit 1
+
+endif # wildcard frr-$(ORIG_VERSION).tar.gz
+endif # TARBALLDIR nonempty
diff --git a/debian/source/format b/debianpkg/source/format
index af745b310b..af745b310b 100644
--- a/debian/source/format
+++ b/debianpkg/source/format
diff --git a/debian/tests/control b/debianpkg/tests/control
index 53fd537e2e..53fd537e2e 100644
--- a/debian/tests/control
+++ b/debianpkg/tests/control
diff --git a/debian/tests/daemons b/debianpkg/tests/daemons
index ac35ecd950..ac35ecd950 100644
--- a/debian/tests/daemons
+++ b/debianpkg/tests/daemons
diff --git a/debian/watchfrr.rc b/debianpkg/watchfrr.rc
index 4110b86399..4110b86399 100644
--- a/debian/watchfrr.rc
+++ b/debianpkg/watchfrr.rc
diff --git a/doc/Building_FRR_on_Debian9.md b/doc/Building_FRR_on_Debian9.md
new file mode 100644
index 0000000000..1536c25932
--- /dev/null
+++ b/doc/Building_FRR_on_Debian9.md
@@ -0,0 +1,121 @@
+Building FRR on Debian 9 from Git Source
+========================================
+
+Install required packages
+-------------------------
+
+Add packages:
+
+ sudo apt-get install git autoconf automake libtool make \
+ libreadline-dev texinfo libjson-c-dev pkg-config bison flex \
+ python-pip libc-ares-dev python3-dev python-pytest
+
+Get FRR, compile it and install it (from Git)
+---------------------------------------------
+
+**This assumes you want to build and install FRR from source and not using
+any packages**
+
+### Add frr groups and user
+
+ sudo addgroup --system --gid 92 frr
+ sudo addgroup --system --gid 85 frrvty
+ sudo adduser --system --ingroup frr --home /var/run/frr/ \
+ --gecos "FRR suite" --shell /bin/false frr
+ sudo usermod -a -G frrvty frr
+
+### Download Source, configure and compile it
+(You may prefer different options on configure statement. These are just
+an example.)
+
+ git clone https://github.com/frrouting/frr.git frr
+ cd frr
+ git checkout stable/3.0
+ ./bootstrap.sh
+ ./configure \
+ --enable-exampledir=/usr/share/doc/frr/examples/ \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ --enable-vtysh \
+ --enable-isisd \
+ --enable-pimd \
+ --enable-watchfrr \
+ --enable-ospfclient=yes \
+ --enable-ospfapi=yes \
+ --enable-multipath=64 \
+ --enable-user=frr \
+ --enable-group=frr \
+ --enable-vty-group=frrvty \
+ --enable-configfile-mask=0640 \
+ --enable-logfile-mask=0640 \
+ --enable-rtadv \
+ --enable-fpm \
+ --enable-ldpd \
+ --with-pkg-git-version \
+ --with-pkg-extra-version=-MyOwnFRRVersion
+ make
+ make check
+ sudo make install
+
+### Create empty FRR configuration files
+
+ sudo install -m 755 -o frr -g frr -d /var/log/frr
+ sudo install -m 775 -o frr -g frrvty -d /etc/frr
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
+ sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
+ sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
+
+### Enable IP & IPv6 forwarding
+
+Edit `/etc/sysctl.conf` and uncomment the following values (ignore the
+other settings)
+
+ # Uncomment the next line to enable packet forwarding for IPv4
+ net.ipv4.ip_forward=1
+
+ # Uncomment the next line to enable packet forwarding for IPv6
+ # Enabling this option disables Stateless Address Autoconfiguration
+ # based on Router Advertisements for this host
+ net.ipv6.conf.all.forwarding=1
+
+**Reboot** or use `sysctl -p` to apply the same config to the running system
+
+### Troubleshooting
+
+**Local state directory**
+
+The local state directory must exist and have the correct permissions applied
+for the frrouting daemons to start. In the above ./configure example the
+local state directory is set to /var/run/frr (--localstatedir=/var/run/frr)
+Debian considers /var/run/frr to be temporary and this is removed after a
+reboot.
+
+When using a different local state directory you need to create the new
+directory and change the ownership to the frr user, for example:
+
+ mkdir /var/opt/frr
+ chown frr /var/opt/frr
+
+**Shared library error**
+
+If you try and start any of the frrouting daemons you may see the below error
+due to the frrouting shared library directory not being found:
+
+ ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory
+
+The fix is to add the following line to /etc/ld.so.conf which will continue to
+reference the library directory after the system reboots. To load the library
+directory path immediately run the ldconfig command after adding the line to
+the file eg:
+
+ echo include /usr/local/lib >> /etc/ld.so.conf
+ ldconfig
diff --git a/doc/install.texi b/doc/install.texi
index 1930af95e6..19d9614420 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -101,6 +101,10 @@ needs libexecinfo, while on glibc support for this is part of libc itself.
Turn on some options for compiling FRR within a development environment in
mind. Specifically turn on -g3 -O0 for compiling options and add inclusion
of grammar sandbox.
+@item --enable-fuzzing
+Turn on some compile options to allow you to run fuzzing tools
+against the system. This tools is intended as a developer
+only tool and should not be used for normal operations
@end table
You may specify any combination of the above options to the configure
diff --git a/isisd/isisd.c b/isisd/isisd.c
index d4e5a4e29b..a6a2202728 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -1521,7 +1521,7 @@ DEFUN_NOSH (router_isis,
DEFUN (no_router_isis,
no_router_isis_cmd,
"no router isis WORD",
- "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
+ "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag\n")
{
int idx_word = 3;
return isis_area_destroy(vty, argv[idx_word]->arg);
diff --git a/ldpd/l2vpn.c b/ldpd/l2vpn.c
index f9f577d564..3335be08a8 100644
--- a/ldpd/l2vpn.c
+++ b/ldpd/l2vpn.c
@@ -239,13 +239,13 @@ l2vpn_pw_init(struct l2vpn_pw *pw)
l2vpn_pw_reset(pw);
+ pw2zpw(pw, &zpw);
+ lde_imsg_compose_parent(IMSG_KPW_ADD, 0, &zpw, sizeof(zpw));
+
l2vpn_pw_fec(pw, &fec);
lde_kernel_insert(&fec, AF_INET, (union ldpd_addr*)&pw->lsr_id, 0, 0,
0, (void *)pw);
lde_kernel_update(&fec);
-
- pw2zpw(pw, &zpw);
- lde_imsg_compose_parent(IMSG_KPW_ADD, 0, &zpw, sizeof(zpw));
}
void
diff --git a/ldpd/ldp_vty_cmds.c b/ldpd/ldp_vty_cmds.c
index aa2e06dfb9..6c86582960 100644
--- a/ldpd/ldp_vty_cmds.c
+++ b/ldpd/ldp_vty_cmds.c
@@ -25,7 +25,9 @@
#include "ldpd/ldpd.h"
#include "ldpd/ldp_vty.h"
+#ifndef VTYSH_EXTRACT_PL
#include "ldpd/ldp_vty_cmds_clippy.c"
+#endif
DEFUN_NOSH(ldp_mpls_ldp,
ldp_mpls_ldp_cmd,
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fafdd73bf3..2ee05fa935 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,6 +17,7 @@ if BGPD
TESTS_BGPD = \
bgpd/test_aspath \
bgpd/test_capability \
+ bgpd/test_packet \
bgpd/test_ecommunity \
bgpd/test_mp_attr \
bgpd/test_mpath
@@ -132,6 +133,7 @@ lib_cli_test_commands_SOURCES = lib/cli/test_commands_defun.c \
helpers/c/prng.c
bgpd_test_aspath_SOURCES = bgpd/test_aspath.c
bgpd_test_capability_SOURCES = bgpd/test_capability.c
+bgpd_test_packet_SOURCES = bgpd/test_packet.c
bgpd_test_ecommunity_SOURCES = bgpd/test_ecommunity.c
bgpd_test_mp_attr_SOURCES = bgpd/test_mp_attr.c
bgpd_test_mpath_SOURCES = bgpd/test_mpath.c
@@ -167,6 +169,7 @@ lib_cli_test_cli_LDADD = $(ALL_TESTS_LDADD)
lib_cli_test_commands_LDADD = $(ALL_TESTS_LDADD)
bgpd_test_aspath_LDADD = $(BGP_TEST_LDADD)
bgpd_test_capability_LDADD = $(BGP_TEST_LDADD)
+bgpd_test_packet_LDADD = $(BGP_TEST_LDADD)
bgpd_test_ecommunity_LDADD = $(BGP_TEST_LDADD)
bgpd_test_mp_attr_LDADD = $(BGP_TEST_LDADD)
bgpd_test_mpath_LDADD = $(BGP_TEST_LDADD)
diff --git a/tests/bgpd/test_packet.c b/tests/bgpd/test_packet.c
new file mode 100644
index 0000000000..298dd1e185
--- /dev/null
+++ b/tests/bgpd/test_packet.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2017 Cumulus Networks Inc.
+ * Donald Sharp
+ *
+ * This file is part of FRR
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <zebra.h>
+
+#include "qobj.h"
+#include "vty.h"
+#include "stream.h"
+#include "privs.h"
+#include "memory.h"
+#include "queue.h"
+#include "filter.h"
+
+#include "bgpd/bgpd.h"
+#include "bgpd/bgp_open.h"
+#include "bgpd/bgp_debug.h"
+#include "bgpd/bgp_packet.h"
+#include "bgpd/bgp_aspath.h"
+
+/* need these to link in libbgp */
+struct zebra_privs_t *bgpd_privs = NULL;
+struct thread_master *master = NULL;
+
+static struct bgp *bgp;
+static as_t asn = 100;
+
+extern int bgp_read_packet(struct peer *peer);
+
+/*
+ * This file is intended to be used as input for some sort of
+ * fuzzer. Specifically I had afl in mind when I wrote
+ * this code.
+ */
+int main(int argc, char *argv[])
+{
+ struct peer *peer;
+ int i, j;
+ struct thread t;
+
+ qobj_init();
+ bgp_attr_init();
+ master = thread_master_create(NULL);
+ bgp_master_init(master);
+ vrf_init(NULL, NULL, NULL, NULL);
+ bgp_option_set(BGP_OPT_NO_LISTEN);
+
+ if (bgp_get(&bgp, &asn, NULL, BGP_INSTANCE_TYPE_DEFAULT))
+ return -1;
+
+ peer = peer_create_accept(bgp);
+ peer->host = (char *)"foo";
+
+ for (i = AFI_IP; i < AFI_MAX; i++)
+ for (j = SAFI_UNICAST; j < SAFI_MAX; j++) {
+ peer->afc[i][j] = 1;
+ peer->afc_adv[i][j] = 1;
+ }
+
+ SET_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV);
+ peer->status = Established;
+
+ peer->fd = open(argv[1], O_RDONLY|O_NONBLOCK);
+ t.arg = peer;
+ peer->t_read = &t;
+
+ printf("bgp_read_packet returns: %d\n", bgp_read(&t));
+}
diff --git a/tools/frr.service b/tools/frr.service
index 51dbbe2f32..4301ec9dc7 100644
--- a/tools/frr.service
+++ b/tools/frr.service
@@ -1,6 +1,6 @@
[Unit]
-Description=Cumulus Linux FRR
-After=syslog.target networking.service
+Description=FRRouting
+After=networking.service
OnFailure=heartbeat-failed@%n.service
[Service]
diff --git a/zebra/main.c b/zebra/main.c
index cf677a7753..36c931c4ee 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -201,6 +201,9 @@ int main(int argc, char **argv)
char *lblmgr_path = NULL;
struct sockaddr_storage dummy;
socklen_t dummylen;
+#if defined(HANDLE_ZAPI_FUZZING)
+ char *fuzzing = NULL;
+#endif
frr_preinit(&zebra_di, argc, argv);
@@ -209,6 +212,9 @@ int main(int argc, char **argv)
#ifdef HAVE_NETLINK
"s:"
#endif
+#if defined(HANDLE_ZAPI_FUZZING)
+ "c:"
+#endif
,
longopts,
" -b, --batch Runs in batch mode\n"
@@ -221,6 +227,9 @@ int main(int argc, char **argv)
#ifdef HAVE_NETLINK
" -s, --nl-bufsize Set netlink receive buffer size\n"
#endif /* HAVE_NETLINK */
+#if defined(HANDLE_ZAPI_FUZZING)
+ " -c <file> Bypass normal startup use this file for tetsting of zapi"
+#endif
);
while (1) {
@@ -271,6 +280,11 @@ int main(int argc, char **argv)
nl_rcvbufsize = atoi(optarg);
break;
#endif /* HAVE_NETLINK */
+#if defined(HANDLE_ZAPI_FUZZING)
+ case 'c':
+ fuzzing = optarg;
+ break;
+#endif
default:
frr_help_exit(1);
break;
@@ -308,6 +322,13 @@ int main(int argc, char **argv)
* routing socket. */
zebra_ns_init();
+#if defined(HANDLE_ZAPI_FUZZING)
+ if (fuzzing) {
+ zserv_read_file(fuzzing);
+ exit(0);
+ }
+#endif
+
/* Process the configuration file. Among other configuration
* directives we can meet those installing static routes. Such
* requests will not be executed immediately, but queued in
diff --git a/zebra/rt.h b/zebra/rt.h
index f5f0fa195b..3ce15e9640 100644
--- a/zebra/rt.h
+++ b/zebra/rt.h
@@ -30,6 +30,17 @@
#include "zebra/zebra_ns.h"
#include "zebra/zebra_mpls.h"
+/*
+ * Philosophy Note:
+ *
+ * Flags being SET/UNSET do not belong in the South Bound
+ * Interface. This Setting belongs at the calling level
+ * because we can and will have multiple different interfaces
+ * and we will have potentially multiple different
+ * modules/filters to call. As such Setting/Unsetting
+ * success failure should be handled by the caller.
+ */
+
extern int kernel_route_rib(struct prefix *, struct prefix *,
struct route_entry *, struct route_entry *);
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index 75207a2dde..e588794947 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -201,9 +201,6 @@ static int kernel_rtm_ipv4(int cmd, struct prefix *p, struct route_entry *re)
zlog_debug(
"%s: %s: successfully did NH %s",
__func__, prefix_buf, gate_buf);
- if (cmd == RTM_ADD)
- SET_FLAG(nexthop->flags,
- NEXTHOP_FLAG_FIB);
break;
/* The only valid case for this error is kernel's
@@ -315,11 +312,7 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re)
if ((cmd == RTM_ADD
&& NEXTHOP_IS_ACTIVE(nexthop->flags))
- || (cmd == RTM_DELETE
-#if 0
- && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
-#endif
- )) {
+ || (cmd == RTM_DELETE)) {
if (nexthop->type == NEXTHOP_TYPE_IPV6
|| nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
sin_gate.sin6_addr = nexthop->gate.ipv6;
@@ -331,9 +324,6 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re)
if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE)
bh_type = nexthop->bh_type;
-
- if (cmd == RTM_ADD)
- SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
}
/* Under kame set interface index to link local address. */
@@ -371,16 +361,7 @@ static int kernel_rtm_ipv6(int cmd, struct prefix *p, struct route_entry *re)
(union sockunion *)mask,
gate ? (union sockunion *)&sin_gate : NULL,
smplsp, ifindex, bh_type, re->metric);
-
-#if 0
- if (error)
- {
- zlog_info ("kernel_rtm_ipv6(): nexthop %d add error=%d.",
- nexthop_num, error);
- }
-#else
(void)error;
-#endif
nexthop_num++;
}
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 3765849adf..320176ba3a 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -846,8 +846,10 @@ static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt)
if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
ret = kernel_del_lsp(lsp);
- if (!ret)
+ if (!ret) {
+ UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
clear_nhlfe_installed(lsp);
+ }
}
}
@@ -901,23 +903,45 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data)
if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
/* Not already installed */
if (newbest) {
+
+ UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
ret = kernel_add_lsp(lsp);
+
+ if (!ret)
+ SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+ else
+ clear_nhlfe_installed(lsp);
+
zvrf->lsp_installs++;
}
} else {
/* Installed, may need an update and/or delete. */
if (!newbest) {
+
ret = kernel_del_lsp(lsp);
+
+ if (!ret) {
+ UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+ clear_nhlfe_installed(lsp);
+ }
+
zvrf->lsp_removals++;
} else if (CHECK_FLAG(lsp->flags, LSP_FLAG_CHANGED)) {
+
+ UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
+ UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+
ret = kernel_upd_lsp(lsp);
+
+ if (!ret)
+ SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+ else
+ clear_nhlfe_installed(lsp);
+
zvrf->lsp_installs++;
}
}
- if (!ret)
- clear_nhlfe_installed(lsp);
-
return WQ_SUCCESS;
}
diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c
index 887c685498..0abc4959fa 100644
--- a/zebra/zebra_mpls_netlink.c
+++ b/zebra/zebra_mpls_netlink.c
@@ -36,10 +36,7 @@ int kernel_add_lsp(zebra_lsp_t *lsp)
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
- if (!ret)
- SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
return ret;
}
@@ -64,8 +61,6 @@ int kernel_upd_lsp(zebra_lsp_t *lsp)
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
-
/* Any NHLFE that was installed but is not selected now needs to
* have its flags updated.
*/
@@ -82,8 +77,6 @@ int kernel_upd_lsp(zebra_lsp_t *lsp)
}
ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
- if (!ret)
- SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
return ret;
}
@@ -93,15 +86,17 @@ int kernel_upd_lsp(zebra_lsp_t *lsp)
*/
int kernel_del_lsp(zebra_lsp_t *lsp)
{
+ int ret;
+
if (!lsp) // unexpected
return -1;
- if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
- netlink_mpls_multipath(RTM_DELROUTE, lsp);
- UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
- }
+ if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED))
+ return -1;
- return 0;
+ ret = netlink_mpls_multipath(RTM_DELROUTE, lsp);
+
+ return ret;
}
int mpls_kernel_init(void)
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index 33f0d49d4d..44f89f0b3b 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -299,10 +299,7 @@ int kernel_add_lsp(zebra_lsp_t *lsp)
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
ret = kernel_lsp_cmd(RTM_ADD, lsp);
- if (!ret)
- SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
return ret;
}
@@ -314,11 +311,7 @@ int kernel_upd_lsp(zebra_lsp_t *lsp)
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
- UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
ret = kernel_lsp_cmd(RTM_CHANGE, lsp);
- if (!ret)
- SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
return ret;
}
@@ -334,8 +327,6 @@ int kernel_del_lsp(zebra_lsp_t *lsp)
return -1;
ret = kernel_lsp_cmd(RTM_DELETE, lsp);
- if (!ret)
- UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
return ret;
}
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index b5c2bc6dae..5e0baf807d 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1060,7 +1060,7 @@ int rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
if (info->safi != SAFI_UNICAST) {
for (ALL_NEXTHOPS(re->nexthop, nexthop))
- SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
+ UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
return ret;
}
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 73f0717124..43895378cd 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -43,7 +43,9 @@
#include "zebra/zebra_static.h"
#include "lib/json.h"
#include "zebra/zebra_vxlan.h"
+#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_vty_clippy.c"
+#endif
#include "zebra/zserv.h"
extern int allow_delete;
@@ -311,7 +313,7 @@ DEFUN (show_ip_rpf,
{
int uj = use_json(argc, argv);
return do_show_ip_route(vty, VRF_DEFAULT_NAME, AFI_IP, SAFI_MULTICAST,
- false, uj, 0, NULL, false, -1, 0);
+ false, uj, 0, NULL, false, 0, 0);
}
DEFUN (show_ip_rpf_addr,
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 9d9a7cd783..2389944e84 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -2562,6 +2562,26 @@ static inline void zserv_handle_commands(struct zserv *client,
}
}
+#if defined(HANDLE_ZAPI_FUZZING)
+static void zserv_write_incoming(struct stream *orig, uint16_t command)
+{
+ char fname[MAXPATHLEN];
+ struct stream *copy;
+ int fd = -1;
+
+ copy = stream_dup(orig);
+ stream_set_getp(copy, 0);
+
+ zserv_privs.change(ZPRIVS_RAISE);
+ snprintf(fname, MAXPATHLEN, "%s/%u", DAEMON_VTY_DIR, command);
+ fd = open(fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
+ stream_flush(copy, fd);
+ close(fd);
+ zserv_privs.change(ZPRIVS_LOWER);
+ stream_free(copy);
+}
+#endif
+
/* Handler of zebra service request. */
static int zebra_client_read(struct thread *thread)
{
@@ -2572,7 +2592,11 @@ static int zebra_client_read(struct thread *thread)
uint8_t marker, version;
vrf_id_t vrf_id;
struct zebra_vrf *zvrf;
+#if defined(HANDLE_ZAPI_FUZZING)
+ int packets = 1;
+#else
int packets = zebrad.packets_to_process;
+#endif
/* Get thread data. Reset reading thread because I'm running. */
sock = THREAD_FD(thread);
@@ -2662,6 +2686,9 @@ static int zebra_client_read(struct thread *thread)
}
}
+#if defined(HANDLE_ZAPI_FUZZING)
+ zserv_write_incoming(client->ibuf, command);
+#endif
length -= ZEBRA_HEADER_SIZE;
/* Debug packet information. */
@@ -3209,6 +3236,26 @@ static struct cmd_node forwarding_node = {FORWARDING_NODE,
"", /* This node has no interface. */
1};
+#if defined(HANDLE_ZAPI_FUZZING)
+void zserv_read_file(char *input)
+{
+ int fd;
+ struct zserv *client = NULL;
+ struct thread t;
+
+ zebra_client_create(-1);
+ client = zebrad.client_list->head->data;
+ t.arg = client;
+
+ fd = open(input, O_RDONLY|O_NONBLOCK);
+ t.u.fd = fd;
+
+ zebra_client_read(&t);
+
+ close(fd);
+}
+#endif
+
/* Initialisation of zebra and installation of commands. */
void zebra_init(void)
{
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 279b56ec3c..60e055088a 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -193,4 +193,8 @@ extern int zebra_server_send_message(struct zserv *client);
extern struct zserv *zebra_find_client(u_char proto);
+#if defined(HANDLE_ZAPI_FUZZING)
+extern void zserv_read_file(char *input);
+#endif
+
#endif /* _ZEBRA_ZEBRA_H */