{"action":"opened","issue":{"url":"https://api.github.com/repos/NetSys/NetBricks/issues/49","repository_url":"https://api.github.com/repos/NetSys/NetBricks","labels_url":"https://api.github.com/repos/NetSys/NetBricks/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/NetSys/NetBricks/issues/49/comments","events_url":"https://api.github.com/repos/NetSys/NetBricks/issues/49/events","html_url":"https://github.com/NetSys/NetBricks/issues/49","id":230931022,"number":49,"title":"a bug in ip.rs ?","user":{"login":"jackyangNJ","id":4023707,"avatar_url":"https://avatars1.githubusercontent.com/u/4023707?v=3","gravatar_id":"","url":"https://api.github.com/users/jackyangNJ","html_url":"https://github.com/jackyangNJ","followers_url":"https://api.github.com/users/jackyangNJ/followers","following_url":"https://api.github.com/users/jackyangNJ/following{/other_user}","gists_url":"https://api.github.com/users/jackyangNJ/gists{/gist_id}","starred_url":"https://api.github.com/users/jackyangNJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackyangNJ/subscriptions","organizations_url":"https://api.github.com/users/jackyangNJ/orgs","repos_url":"https://api.github.com/users/jackyangNJ/repos","events_url":"https://api.github.com/users/jackyangNJ/events{/privacy}","received_events_url":"https://api.github.com/users/jackyangNJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-24T06:14:38Z","updated_at":"2017-05-24T06:14:38Z","closed_at":null,"body":"Hello,\r\n I was testing the module aclfw, however, I found it cannot work correctly when I wanted to filter a specified source port.\r\nI looked up into the code of ip.rs used by aclfw.\r\n![code snap from ip rs](https://cloud.githubusercontent.com/assets/4023707/26389008/443dccbc-408a-11e7-8c57-47aacdd437d2.png)\r\n`let port_as_u8 = self_as_u8.offset(self.length() as isize);`, the offset value maybe wrong. `self.length()` is the whole length of ip packet, not the ip header length.\r\nSo `let dst_port = BigEndian::read_u16(&port_slice[..16]);` gets the wrong value.\r\nAlso, `port_slice[..16]` may not be right.\r\n\r\nThanks!"}}
{"actor":{"display_login":"jackyangNJ"}}