Skip to content

位于Packet 类的TCPHeader的headerLength 属于计算错误了吧 #10

@Rgoogle

Description

@Rgoogle

其中的源码
this.headerLength = (this.dataOffsetAndReserved & 0xF0) >> 2;
这个dataOffsetAnd... 是一个字节 前4位标识tcp 报文头的长度 后4位是6个标志的前4个标志
与0xF0 就是取出前4位
然后这个>> 右移2 就相当于除4 不应该是左移吗?
我觉得这里有问题,应该是左移 而不是右移,你能解释一下吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions