Fix printing of IP addresses in ofp_print_action().
authorBen Pfaff <blp@nicira.com>
Thu, 20 Nov 2008 18:07:22 +0000 (10:07 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 20 Nov 2008 18:07:22 +0000 (10:07 -0800)
IP_ARGS takes a pointer, not a raw IP address.

Thanks to kk yap for reporting the problem.

lib/ofp-print.c

index c3c1c711fff100b18e3d70bbb28a28aab6795609..c145b3d165067d2cb86b89c9f1d3c5e2f6c7eadb 100644 (file)
@@ -398,13 +398,13 @@ ofp_print_action(struct ds *string, const struct ofp_action_header *ah,
 
     case OFPAT_SET_NW_SRC: {
         struct ofp_action_nw_addr *na = (struct ofp_action_nw_addr *)ah;
-        ds_put_format(string, "mod_nw_src:"IP_FMT, IP_ARGS(na->nw_addr));
+        ds_put_format(string, "mod_nw_src:"IP_FMT, IP_ARGS(&na->nw_addr));
         break;
     }
 
     case OFPAT_SET_NW_DST: {
         struct ofp_action_nw_addr *na = (struct ofp_action_nw_addr *)ah;
-        ds_put_format(string, "mod_nw_dst:"IP_FMT, IP_ARGS(na->nw_addr));
+        ds_put_format(string, "mod_nw_dst:"IP_FMT, IP_ARGS(&na->nw_addr));
         break;
     }