1.Add the log information about the NewIP route exception branch
2.Code specification check and rectify
Signed-off-by: liangbotong <liangbotong@huawei.com>
1. bt_io_file_write function call copy_from_user branch failure need to release skb.
2. The branch that bt_io_file_read fails to call copy_to_user needs to release skb, because skb has been unchained from ring buf.
3. The bt_cmd_peek_packet function only obtains the skb data length. After put_user fails, the skb does not need to be released.
4. The bt_cmd_create_virnet function bt_get_unused_id may return an invalid id, and add the if judgment that the id is less than 0.
5. The branch of bt_cmd_create_virnet function copy_to_user that fails needs to release bt_table_remove_device.
6. bt_table_add_device and bt_table_remove_device functions to tbl->num variable ++ and -- operation to increase the validity judgment, avoid flipping.
7. __bt_ring_create function if (unlikely(size < 0)) branch has memory leaks, modified to determine the validity of the input parameter, and then apply for memory.
8. Both bt_ring_is_empty and bt_ring_is_full return true for invalid branches.
9. bt_virnet_produce_data adds a memory barrier before and after calling bt_ring_produce, and bt_ring_produce already has a memory barrier. Delete the redundant memory barrier.
10. The vnet->tx_queue variable is a redundant operation and has no practical effect. Delete all codes corresponding to the variable to improve the efficiency of receiving and sending packets on the btdev virtual device.
bt_virnet_create deletes init_waitqueue_head(&vnet->tx_queue);
bt_io_file_poll deletes poll_wait(filp, &vnet->tx_queue, wait);
11. Change the global variable name to g_xxx
12. atomic operation process xx_open_limit variable value changes add annotation
13. debug rectification, the normal path is closed by default (shell can be opened), and the abnormal path is opened by default. At the same time, key information such as btdev interface name printing and data length are added to the interface open, delete, and packet sending functions.
Signed-off-by: yangyanjun <yangyanjun@huawei.com>
1. The header comment contains the copyright license, feature description, author, and creation date.
2. The NewIP rto is changed to 20.
Signed-off-by: liangbotong <liangbotong@huawei.com>
1. The header comment contains the copyright license, feature description, author, and creation date
2. Rectification of code specification problems
Signed-off-by: liangbotong <liangbotong@huawei.com>
1. The header comment contains the copyright license, feature description, author, and creation date
2. Rectification of deep nesting of code blocks of functions
3. Rectification of code specification problems
4. Rectify resource leakage
5. Rectifying reliability risks
Signed-off-by: liangbotong <liangbotong@huawei.com>
Fix the issue that a network port can add a route or address when it is not running.
The btdev Makefile adds a conditional compilation.
Signed-off-by: liangbotong <liangbotong@huawei.com>
Fix ofo last_skb cover new_skb Processing.
Fix the issue of NewIP socket SELinux object role not being marked.
Signed-off-by: shiyunfei <shiyunfei3@huawei.com>