Commit 2a780782 authored by Philipp Reisner's avatar Philipp Reisner

Fixing integer encoding in tag lists from kernel to userspace (reg in 8.3.2) [bugz 253]

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 4033e7f1
...@@ -2113,12 +2113,12 @@ tl_add_int(unsigned short *tl, enum drbd_tags tag, const void *val) ...@@ -2113,12 +2113,12 @@ tl_add_int(unsigned short *tl, enum drbd_tags tag, const void *val)
switch(tag_type(tag)) { switch(tag_type(tag)) {
case TT_INTEGER: case TT_INTEGER:
put_unaligned(sizeof(int), tl++); put_unaligned(sizeof(int), tl++);
put_unaligned(*(int *)val, (int *)tl++); put_unaligned(*(int *)val, (int *)tl);
tl = (unsigned short*)((char*)tl+sizeof(int)); tl = (unsigned short*)((char*)tl+sizeof(int));
break; break;
case TT_INT64: case TT_INT64:
put_unaligned(sizeof(u64), tl++); put_unaligned(sizeof(u64), tl++);
put_unaligned(*(u64 *)val, (u64 *)tl++); put_unaligned(*(u64 *)val, (u64 *)tl);
tl = (unsigned short*)((char*)tl+sizeof(u64)); tl = (unsigned short*)((char*)tl+sizeof(u64));
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment