]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: clear host bits of ND RA prefix option
authorDenis Ovsienko <infrastation@yandex.ru>
Sun, 8 Jan 2012 13:46:34 +0000 (17:46 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 26 Jan 2012 07:42:51 +0000 (11:42 +0400)
RFC4861 4.6.2. Prefix Information

Prefix         An IP address or a prefix of an IP address.  The
               Prefix Length field contains the number of valid
               leading bits in the prefix.  The bits in the prefix
               after the prefix length are reserved and MUST be
               initialized to zero by the sender and ignored by
               the receiver.

* rtadv.c
  * ipv6_nd_prefix(): add missing call to apply_mask_ipv6()
  * no_ipv6_nd_prefix(): idem

zebra/rtadv.c

index 01f88336ba268e4f608f8b0a88c58de7828763b1..c6771bbce5220362e37c6ef71945aea17549a9b9 100644 (file)
@@ -1202,6 +1202,7 @@ DEFUN (ipv6_nd_prefix,
       vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
+  apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */
   rp.AdvOnLinkFlag = 1;
   rp.AdvAutonomousFlag = 1;
   rp.AdvRouterAddressFlag = 0;
@@ -1429,6 +1430,7 @@ DEFUN (no_ipv6_nd_prefix,
       vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
       return CMD_WARNING;
     }
+  apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */
 
   ret = rtadv_prefix_reset (zebra_if, &rp);
   if (!ret)