summaryrefslogtreecommitdiffstats
path: root/proxy/src/mechglue
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-03-21 19:11:10 -0400
committerSimo Sorce <simo@redhat.com>2012-03-22 02:33:52 -0400
commit403119d7f4d4070bfd8f7fb796729127666e2e11 (patch)
tree9f272395031e3a5bfd03fab65da2a2dde439b276 /proxy/src/mechglue
parent9714cbbf07093e7b6661d8fb93c0b00172d3d677 (diff)
downloadgss-proxy-403119d7f4d4070bfd8f7fb796729127666e2e11.tar.gz
gss-proxy-403119d7f4d4070bfd8f7fb796729127666e2e11.tar.xz
gss-proxy-403119d7f4d4070bfd8f7fb796729127666e2e11.zip
gp_socket: properly handle fagment bit
Diffstat (limited to 'proxy/src/mechglue')
-rw-r--r--proxy/src/mechglue/gpm_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proxy/src/mechglue/gpm_common.c b/proxy/src/mechglue/gpm_common.c
index 5c20778..22b3449 100644
--- a/proxy/src/mechglue/gpm_common.c
+++ b/proxy/src/mechglue/gpm_common.c
@@ -30,6 +30,8 @@
#include <time.h>
#include <pthread.h>
+#define FRAGMENT_BIT (1 << 31)
+
struct gpm_ctx {
pthread_mutex_t lock;
int fd;
@@ -168,7 +170,8 @@ static int gpm_send_buffer(struct gpm_ctx *gpmctx,
gpm_grab_sock(gpmctx);
- size = htonl(length);
+ size = length | FRAGMENT_BIT;
+ size = htonl(size);
retry = false;
do {
@@ -258,6 +261,7 @@ static int gpm_recv_buffer(struct gpm_ctx *gpmctx,
} while (retry);
*length = ntohl(size);
+ *length &= ~FRAGMENT_BIT;
if (*length > MAX_RPC_SIZE) {
ret = EMSGSIZE;