X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetlink.c;h=3f479bef8f690eefa19c4a9320fa221d48e48270;hb=55c955bd8aecc90273ffa93114c1c38f4f9b78ec;hp=aea1f2977466aa8ceb2996f6caf994294173b151;hpb=34582733d9aad82bba60f4bf986b62d58412502a;p=sliver-openvswitch.git diff --git a/lib/netlink.c b/lib/netlink.c index aea1f2977..3f479bef8 100644 --- a/lib/netlink.c +++ b/lib/netlink.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -174,7 +174,7 @@ nl_msg_put(struct ofpbuf *msg, const void *data, size_t size) void * nl_msg_put_uninit(struct ofpbuf *msg, size_t size) { - size_t pad = NLMSG_ALIGN(size) - size; + size_t pad = PAD_SIZE(size, NLMSG_ALIGNTO); char *p = ofpbuf_put_uninit(msg, size + pad); if (pad) { memset(p + size, 0, pad); @@ -197,7 +197,7 @@ nl_msg_push(struct ofpbuf *msg, const void *data, size_t size) void * nl_msg_push_uninit(struct ofpbuf *msg, size_t size) { - size_t pad = NLMSG_ALIGN(size) - size; + size_t pad = PAD_SIZE(size, NLMSG_ALIGNTO); char *p = ofpbuf_push_uninit(msg, size + pad); if (pad) { memset(p + size, 0, pad); @@ -643,7 +643,7 @@ min_attr_len(enum nl_attr_type type) case NL_A_STRING: return 1; case NL_A_FLAG: return 0; case NL_A_NESTED: return 0; - case N_NL_ATTR_TYPES: default: NOT_REACHED(); + case N_NL_ATTR_TYPES: default: OVS_NOT_REACHED(); } } @@ -661,7 +661,7 @@ max_attr_len(enum nl_attr_type type) case NL_A_STRING: return SIZE_MAX; case NL_A_FLAG: return SIZE_MAX; case NL_A_NESTED: return SIZE_MAX; - case N_NL_ATTR_TYPES: default: NOT_REACHED(); + case N_NL_ATTR_TYPES: default: OVS_NOT_REACHED(); } }