When parsing "blackhole" route, also parse IP mask.
authorVincent Bernat <bernat@luffy.cx>
Fri, 26 Feb 2010 08:06:46 +0000 (08:06 +0000)
committerAlexandre Cassen <acassen@freebox.fr>
Thu, 6 May 2010 13:08:51 +0000 (15:08 +0200)
Without this patch, the mask is always considered to be 0 but,
fortunately, the kernel does not want to add this route.

keepalived/vrrp/vrrp_iproute.c

index d4a57ad..130f4f0 100644 (file)
@@ -192,6 +192,7 @@ alloc_route(list rt_list, vector strvec)
                if (!strcmp(str, "blackhole")) {
                        new->blackhole = 1;
                        inet_ston(VECTOR_SLOT(strvec, ++i), &new->dst);
+                       new->dmask = inet_stom(VECTOR_SLOT(strvec, i));
                } else if (!strcmp(str, "via") || !strcmp(str, "gw")) {
                        inet_ston(VECTOR_SLOT(strvec, ++i), &new->gw);
                } else if (!strcmp(str, "or")) {