Dear List, as I stated earlier last November, there are some simple issues, which prevent RIPng (aka IPv6 RIP) from working. Despite my rather basic knowledge of C I endeavoured to try and fix it.
So far, two things are fixed by my patch: the UDP port is set to 521 (instead of 520 for IPv4 RIP) and the version number set to 1. At least the protocol dissector of wireshark now accepts the packets as correct RIPng messages (instead of "unknown protocol"). Anyway, my virtualized test setup does not yet exchange routes. This may as well be due to an error in my setup. Feedback is very appreciated ... Goesta -- #!/usr/bin/perl foreach $c (split(/ /,"47 6f 65 73 74 61 20 53 6d 65 6b 61 6c 0d 0a")) { print pack("C", hex($c));}
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 543aa30..031162b 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -146,7 +146,11 @@ rip_tx( sock *s ) DBG( "Preparing packet to send: " ); packet->heading.command = RIPCMD_RESPONSE; +#ifndef IPV6 packet->heading.version = RIP_V2; +#else + packet->heading.version = RIP_NG; +#endif packet->heading.unused = 0; i = !!P_CF->authtype; @@ -977,7 +981,11 @@ rip_init_config(struct rip_proto_config *c) init_list(&c->iface_list); c->c.preference = DEF_PREF_RIP; c->infinity = 16; +#ifndef IPV6 c->port = 520; +#else + c->port = 521; +#endif c->period = 30; c->garbage_time = 120+180; c->timeout_time = 120; diff --git a/proto/rip/rip.h b/proto/rip/rip.h index 5a6e36d..f27903a 100644 --- a/proto/rip/rip.h +++ b/proto/rip/rip.h @@ -39,6 +39,7 @@ struct rip_packet_heading { /* 4 bytes */ u8 version; #define RIP_V1 1 #define RIP_V2 2 +#define RIP_NG 1 /* this is verion 1 of RIPng */ u16 unused; };
signature.asc
Description: OpenPGP digital signature