[ovs-dev] [netlink v4 09/52] netlink-socket: Slightly improve logging of Generic Netlink messages.

Ben Pfaff blp at nicira.com
Tue Jan 18 22:08:23 UTC 2011


On Tue, Jan 18, 2011 at 12:53:53AM -0800, Justin Pettit wrote:
> On Jan 11, 2011, at 9:49 PM, Ben Pfaff wrote:
> 
> > static char *
> > -nlmsg_to_string(const struct ofpbuf *buffer)
> > +nlmsg_to_string(const struct ofpbuf *buffer, int protocol)
> > {
> >     struct ds ds = DS_EMPTY_INITIALIZER;
> >     const struct nlmsghdr *h = ofpbuf_at(buffer, 0, NLMSG_HDRLEN);
> > @@ -791,6 +795,13 @@ nlmsg_to_string(const struct ofpbuf *buffer)
> >             } else {
> >                 ds_put_cstr(&ds, " done(truncated)");
> >             }
> > +        } else if (protocol == NETLINK_GENERIC) {
> > +            struct genlmsghdr *genl = ofpbuf_at(buffer, NLMSG_HDRLEN,
> > +                                                GENL_HDRLEN);
> 
> I believe you can use nl_msg_genlmsghdr() from "lib/netlink.c"
> function to do this same thing.

Thanks, fixed.

> Otherwise, looks good.

Thank you for the review.




More information about the dev mailing list