diff mbox

[ovs-dev,ovn-ipv6,19/26] packets: Define RSO flags.

Message ID 1468306616-125783-20-git-send-email-jpettit@ovn.org
State Changes Requested
Headers show

Commit Message

Justin Pettit July 12, 2016, 6:56 a.m. UTC
Use #define's as opposed to magic numbers.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
---
 lib/packets.h            | 4 ++++
 ovn/controller/pinctrl.c | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

Comments

Ben Pfaff July 13, 2016, 7:55 p.m. UTC | #1
On Mon, Jul 11, 2016 at 11:56:49PM -0700, Justin Pettit wrote:
> Use #define's as opposed to magic numbers.
> 
> Signed-off-by: Justin Pettit <jpettit@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/lib/packets.h b/lib/packets.h
index 28b742d..617f058 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -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
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 37d3f41..fdf21c7 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -964,11 +964,14 @@  pinctrl_handle_na(const struct flow *ip_flow,
     struct dp_packet packet;
     dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
 
-    /* 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_nd_adv(&packet,
                    ip_flow->dl_dst, ip_flow->dl_src,
                    &ip_flow->nd_target, &ip_flow->ipv6_src,
-                   htonl(0x60000000));
+                   htonl(ND_RSO_SOLICITED | ND_RSO_OVERRIDE));
 
     /* Reload previous packet metadata. */
     uint64_t ofpacts_stub[4096 / 8];