summaryrefslogtreecommitdiffstats
path: root/include/linux/rtnetlink.h
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-06-28 12:54:43 -0700
committerDavid S. Miller <davem@davemloft.net>2005-06-28 12:54:43 -0700
commitb3563c4fbff906991a1b4ef4609f99cca2a0de6a (patch)
treee5c0e4cb4a0a48ebeeb8b1515128c115c5aa528c /include/linux/rtnetlink.h
parent4095ebf1e641b0f37ee1cd04c903bb85cf4ed25b (diff)
downloadop-kernel-dev-b3563c4fbff906991a1b4ef4609f99cca2a0de6a.zip
op-kernel-dev-b3563c4fbff906991a1b4ef4609f99cca2a0de6a.tar.gz
[NETLINK]: Clear padding in netlink messages
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r--include/linux/rtnetlink.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index d021888..dc26e82 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -898,7 +898,9 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
memcpy(skb_put(skb, attrlen), data, attrlen); })
#define RTA_PUT_NOHDR(skb, attrlen, data) \
- RTA_APPEND(skb, RTA_ALIGN(attrlen), data)
+({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \
+ memset(skb->tail - (RTA_ALIGN(attrlen) - attrlen), 0, \
+ RTA_ALIGN(attrlen) - attrlen); })
#define RTA_PUT_U8(skb, attrtype, value) \
({ u8 _tmp = (value); \
@@ -978,6 +980,7 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
rta->rta_type = attrtype;
rta->rta_len = size;
+ memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
return rta;
}
OpenPOWER on IntegriCloud