Fixed fragmentation stuff
FossilOrigin-Name: 35cd283b9ae5dcb5c5ca9dca4f020c42329b21b5b53dc6d09a46aa5f91f56532
This commit is contained in:
parent
9d3e24df52
commit
dd1d3f4dbc
@ -29,8 +29,10 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
|||||||
|
|
||||||
mtu = conn->mtu;
|
mtu = conn->mtu;
|
||||||
|
|
||||||
|
|
||||||
while (packetlen>mtu){
|
while (packetlen>mtu){
|
||||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
|
||||||
|
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_F,1);
|
||||||
cw_set_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
cw_set_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||||
|
|
||||||
cw_dbg_pkt(DBG_PKT_OUT,conn,ptr,mtu,(struct sockaddr*)&conn->addr);
|
cw_dbg_pkt(DBG_PKT_OUT,conn,ptr,mtu,(struct sockaddr*)&conn->addr);
|
||||||
@ -43,14 +45,14 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
|||||||
fragoffset+=(mtu-hlen)/8;
|
fragoffset+=(mtu-hlen)/8;
|
||||||
|
|
||||||
packetlen-=mtu-hlen;
|
packetlen-=mtu-hlen;
|
||||||
|
memcpy(ptr,rawmsg,hlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (fragoffset)
|
if (fragoffset)
|
||||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F | CAPWAP_FLAG_HDR_L,1);
|
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_F | CAPWAP_FLAG_HDR_L,1);
|
||||||
else
|
else
|
||||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,0);
|
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_F,0);
|
||||||
|
|
||||||
cw_set_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
cw_set_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user