kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.09k stars 270 forks source link

A bug in construction of ipv6 fragments extension header #560

Closed galosss closed 3 years ago

galosss commented 3 years ago

in IP6FragmentHeader , the implemented setter of m_flag is using the mask ~0xfffe, as follows:

@m_flag.setter
def m_flag(self, v):
    self.frag_off_resv_m = (self.frag_off_resv_m & ~0xfffe) | v

while the mask should be 0xfffe , without negating ~. it fails the construction of the packet as a result.

thanks!

obormot commented 3 years ago

good catch!