summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2017-08-22 14:59:22 +0200
committerGitHub <noreply@github.com>2017-08-22 14:59:22 +0200
commit57a553fd9c1eab1adc15ca31af29cbbd67db4dfc (patch)
tree930495a4c9478b53319f2cac8f5d0c64f5e45148
parentcacec09618046f4c1cb8b5faff483d13ddc0bb84 (diff)
parentca9e3d23f60f2823b701cef9b341e13657af0482 (diff)
Merge pull request #1012 from donaldsharp/eigrp_send_version
eigrpd: Setup eigrp to send FRR version
-rw-r--r--eigrpd/eigrp_hello.c20
-rw-r--r--eigrpd/eigrp_main.c2
-rw-r--r--eigrpd/eigrp_packet.h1
3 files changed, 19 insertions, 4 deletions
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c
index d56767fafc..ef10ebf54c 100644
--- a/eigrpd/eigrp_hello.c
+++ b/eigrpd/eigrp_hello.c
@@ -405,6 +405,20 @@ void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph,
inet_ntoa(nbr->src));
}
+u_int32_t FRR_MAJOR;
+u_int32_t FRR_MINOR;
+
+void eigrp_sw_version_initialize(void)
+{
+ char ver_string[] = VERSION;
+ char *dash = strstr(ver_string, "-");
+
+ if (dash)
+ dash[0] = '\0';
+
+ sscanf(ver_string, "%d.%d", &FRR_MAJOR, &FRR_MINOR);
+}
+
/**
* @fn eigrp_sw_version_encode
*
@@ -425,10 +439,8 @@ static u_int16_t eigrp_sw_version_encode(struct stream *s)
stream_putw(s, EIGRP_TLV_SW_VERSION);
stream_putw(s, length);
- // encode the version of quagga we're running
- // DVS: need to figure out a cleaner way to do this
- stream_putc(s, 0); //!< major os version
- stream_putc(s, 99); //!< minor os version
+ stream_putc(s, FRR_MAJOR); //!< major os version
+ stream_putc(s, FRR_MINOR); //!< minor os version
/* and the core eigrp version */
stream_putc(s, EIGRP_MAJOR_VERSION);
diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c
index 4c99821d3c..705e04b34d 100644
--- a/eigrpd/eigrp_main.c
+++ b/eigrpd/eigrp_main.c
@@ -159,6 +159,8 @@ int main(int argc, char **argv, char **envp)
}
}
+ eigrp_sw_version_initialize();
+
/* EIGRP master init. */
eigrp_master_init();
eigrp_om->master = frr_init();
diff --git a/eigrpd/eigrp_packet.h b/eigrpd/eigrp_packet.h
index 03fe412f1f..e72048ecc3 100644
--- a/eigrpd/eigrp_packet.h
+++ b/eigrpd/eigrp_packet.h
@@ -71,6 +71,7 @@ extern int eigrp_unack_multicast_packet_retrans(struct thread *);
* untill there is reason to have their own header, these externs are found in
* eigrp_hello.c
*/
+extern void eigrp_sw_version_initialize(void);
extern void eigrp_hello_send(struct eigrp_interface *, u_char,
struct in_addr *);
extern void eigrp_hello_send_ack(struct eigrp_neighbor *);