packets: Define RSO flags.
authorJustin Pettit <jpettit@ovn.org>
Wed, 6 Jul 2016 23:27:57 +0000 (16:27 -0700)
committerJustin Pettit <jpettit@ovn.org>
Wed, 20 Jul 2016 04:54:54 +0000 (21:54 -0700)
Use #define's as opposed to magic numbers.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
lib/packets.h
ovn/controller/pinctrl.c

index 5835b4e..0d7cfc8 100644 (file)
@@ -840,6 +840,10 @@ struct ovs_nd_msg {
 };
 BUILD_ASSERT_DECL(ND_MSG_LEN == sizeof(struct ovs_nd_msg));
 
+#define ND_RSO_ROUTER    0x80000000
+#define ND_RSO_SOLICITED 0x40000000
+#define ND_RSO_OVERRIDE  0x20000000
+
 /*
  * Use the same struct for MLD and MLD2, naming members as the defined fields in
  * in the corresponding version of the protocol, though they are reserved in the
index 6342719..62f4748 100644 (file)
@@ -969,11 +969,14 @@ pinctrl_handle_na(const struct flow *ip_flow,
     memcpy(ipv6_dst, &ip_flow->ipv6_src, sizeof ipv6_src);
     memcpy(ipv6_src, &ip_flow->nd_target, sizeof ipv6_dst);
 
-    /* Frame the NA packet with RSO=011. */
+    /* xxx These flags are not exactly correct.  Look at section 7.2.4
+     * xxx of RFC 4861.  For example, we need to set ND_RSO_ROUTER for
+     * xxx router's interfaces and ND_RSO_SOLICITED only if it was
+     * xxx requested. */
     compose_na(&packet,
                ip_flow->dl_dst, ip_flow->dl_src,
                ipv6_src, ipv6_dst,
-               htonl(0x60000000));
+               htonl(ND_RSO_SOLICITED | ND_RSO_OVERRIDE));
 
     /* Reload previous packet metadata. */
     uint64_t ofpacts_stub[4096 / 8];