From f3a7e813d96b6bb8b0621abec2829a6316064725 Mon Sep 17 00:00:00 2001 From: liangbotong Date: Tue, 23 May 2023 11:12:58 +0800 Subject: [PATCH] NewIP code rectification 1. The header comment contains the copyright license, feature description, author, and creation date 2. Rectification of code specification problems Signed-off-by: liangbotong --- newip/examples/check_nip_enable.c | 14 +++-- newip/examples/get_af_ninet.c | 12 ++++- newip/examples/newip_route.h | 7 +++ newip/examples/nip.h | 7 +++ newip/examples/nip_addr.c | 7 ++- newip/examples/nip_addr_cfg_demo.c | 9 +++- newip/examples/nip_lib.c | 7 ++- newip/examples/nip_lib.h | 8 +++ newip/examples/nip_route.c | 7 ++- newip/examples/nip_route_cfg_demo.c | 12 +++-- newip/examples/nip_tcp_client_demo.c | 18 +++++-- newip/examples/nip_tcp_server_demo.c | 6 +++ newip/examples/nip_uapi.h | 7 +++ newip/examples/nip_udp_client_demo.c | 17 +++++-- newip/examples/nip_udp_server_demo.c | 6 +++ newip/src/common/nip_addr.c | 7 +++ newip/src/common/nip_addr.h | 7 +++ newip/src/common/nip_checksum.c | 7 +++ newip/src/common/nip_checksum.h | 7 +++ newip/src/common/nip_hdr.h | 8 +++ newip/src/common/nip_hdr_decap.c | 7 +++ newip/src/common/nip_hdr_encap.c | 7 +++ newip/src/linux-5.10/drivers/net/bt/btdev.c | 51 +++++++++++-------- newip/src/linux-5.10/drivers/net/bt/btdev.h | 10 ++-- .../linux-5.10/net/newip/nip_hooks_register.c | 9 +++- .../linux-5.10/net/newip/nip_hooks_register.h | 7 ++- .../linux-5.10/net/newip/tcp_nip_parameter.c | 6 ++- .../linux-5.10/net/newip/tcp_nip_parameter.h | 6 ++- .../linux-5.10/include/uapi/linux/nip.h | 2 +- newip/third_party/linux-5.10/net/newip/icmp.c | 12 ++--- .../linux-5.10/net/newip/ninet_hashtables.c | 4 +- .../linux-5.10/net/newip/nip_fib.c | 6 ++- .../linux-5.10/net/newip/nip_output.c | 1 + .../linux-5.10/net/newip/nip_sockglue.c | 16 +++--- .../third_party/linux-5.10/net/newip/nndisc.c | 24 ++++----- .../third_party/linux-5.10/net/newip/route.c | 8 +-- .../linux-5.10/net/newip/tcp_nip.c | 33 ++++++++---- .../linux-5.10/net/newip/tcp_nip_input.c | 9 +++- .../linux-5.10/net/newip/tcp_nip_output.c | 14 +++-- .../linux-5.10/net/newip/tcp_nip_timer.c | 3 +- newip/third_party/linux-5.10/net/newip/udp.c | 10 ++-- 41 files changed, 319 insertions(+), 106 deletions(-) diff --git a/newip/examples/check_nip_enable.c b/newip/examples/check_nip_enable.c index a319a8a..8e649f7 100644 --- a/newip/examples/check_nip_enable.c +++ b/newip/examples/check_nip_enable.c @@ -1,12 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: check NewIP enable. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include #include #include -#include #define NIP_DISABLE_PATH ("/sys/module/newip/parameters/disable") #define NIP_DISABLE_LENTH (5) @@ -30,11 +35,14 @@ void _check_nip_enable(void) return; } - fclose(fn); + if (fclose(fn) == EOF) { + printf("fclose failed\n"); + return; + } g_nip_enable = atoi(tmp) ? 0 : 1; } -int check_nip_enable(void) +bool check_nip_enable(void) { if (g_nip_enable == NIP_ENABLE_INVALID) { _check_nip_enable(); diff --git a/newip/examples/get_af_ninet.c b/newip/examples/get_af_ninet.c index da6febb..a3f8449 100644 --- a/newip/examples/get_af_ninet.c +++ b/newip/examples/get_af_ninet.c @@ -1,12 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: get af ninet. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include #include #include -#include #define AF_NINET_PATH ("/sys/module/newip/parameters/af_ninet") #define AF_NINET_LENTH (5) @@ -29,7 +34,10 @@ void _get_af_ninet(void) return; } - fclose(fn); + if (fclose(fn) == EOF) { + printf("fclose failed\n"); + return; + } g_af_ninet = atoi(tmp); } diff --git a/newip/examples/newip_route.h b/newip/examples/newip_route.h index 2337c1e..4dd8851 100644 --- a/newip/examples/newip_route.h +++ b/newip/examples/newip_route.h @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Definitions for the structure + * associated with NewIP route. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #ifndef _NEWIP_ROUTE_H #define _NEWIP_ROUTE_H diff --git a/newip/examples/nip.h b/newip/examples/nip.h index 531d41a..aacfc9a 100644 --- a/newip/examples/nip.h +++ b/newip/examples/nip.h @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Definitions for the structure + * associated with NewIP address. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #ifndef _NIP_H #define _NIP_H diff --git a/newip/examples/nip_addr.c b/newip/examples/nip_addr.c index fe6fd65..9fb3fee 100644 --- a/newip/examples/nip_addr.c +++ b/newip/examples/nip_addr.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of configuring NewIP address. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include @@ -8,7 +14,6 @@ #include #include #include -#include #include "nip_uapi.h" #include "nip_lib.h" diff --git a/newip/examples/nip_addr_cfg_demo.c b/newip/examples/nip_addr_cfg_demo.c index 50398b8..3f0f889 100644 --- a/newip/examples/nip_addr_cfg_demo.c +++ b/newip/examples/nip_addr_cfg_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of configuring NewIP address. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include #include @@ -8,7 +14,6 @@ #include #include #include -#include #include "nip_uapi.h" #include "nip_lib.h" @@ -29,7 +34,7 @@ int nip_add_addr(int ifindex, const unsigned char *addr, unsigned char addr_len) return -1; memset(&ifrn, 0, sizeof(ifrn)); - ifrn.ifrn_addr.bitlen = addr_len * 8; // Byte length is converted to bit length + ifrn.ifrn_addr.bitlen = addr_len * BITS_PER_BYTE; // Byte length is converted to bit length memcpy(ifrn.ifrn_addr.nip_addr_field8, addr, addr_len); ifrn.ifrn_ifindex = ifindex; diff --git a/newip/examples/nip_lib.c b/newip/examples/nip_lib.c index 53aea77..aa62efc 100644 --- a/newip/examples/nip_lib.c +++ b/newip/examples/nip_lib.c @@ -1,13 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provide NewIP universal library. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include #include #include #include #include -#include #include /* struct ifreq depend */ #include "nip_uapi.h" diff --git a/newip/examples/nip_lib.h b/newip/examples/nip_lib.h index c30556e..2cf018e 100644 --- a/newip/examples/nip_lib.h +++ b/newip/examples/nip_lib.h @@ -1,6 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provide NewIP universal library. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #ifndef _NIP_LIB_H #define _NIP_LIB_H @@ -27,6 +33,8 @@ #define SELECT_TIME 600 #define TCP_SERVER_PORT 5556 /* TCP Server Port */ #define UDP_SERVER_PORT 9090 /* UDP Server Port */ +#define TIMEOUT_SEC 2 +#define BITS_PER_BYTE 8 #define ARRAY_LEN 255 diff --git a/newip/examples/nip_route.c b/newip/examples/nip_route.c index ee7c8ac..d916252 100644 --- a/newip/examples/nip_route.c +++ b/newip/examples/nip_route.c @@ -1,13 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of configuring NewIP route. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include #include #include #include -#include #include #include diff --git a/newip/examples/nip_route_cfg_demo.c b/newip/examples/nip_route_cfg_demo.c index f650919..a331164 100644 --- a/newip/examples/nip_route_cfg_demo.c +++ b/newip/examples/nip_route_cfg_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of configuring NewIP route. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include @@ -34,11 +40,11 @@ int nip_route_add(int ifindex, const unsigned char *dst_addr, uint8_t dst_addr_l memset(&rt, 0, sizeof(rt)); rt.rtmsg_ifindex = ifindex; rt.rtmsg_flags = RTF_UP; - rt.rtmsg_dst.bitlen = dst_addr_len * 8; + rt.rtmsg_dst.bitlen = dst_addr_len * BITS_PER_BYTE; memcpy(rt.rtmsg_dst.nip_addr_field8, dst_addr, dst_addr_len); if (gateway_addr) { - rt.rtmsg_gateway.bitlen = gateway_addr_len * 8; + rt.rtmsg_gateway.bitlen = gateway_addr_len * BITS_PER_BYTE; memcpy(rt.rtmsg_gateway.nip_addr_field8, gateway_addr, gateway_addr_len); rt.rtmsg_flags |= RTF_GATEWAY; } @@ -71,7 +77,7 @@ int main(int argc, char **argv) printf("client cfg route, dst-addr=0x%02x%02x\n", server_addr[INDEX_0], server_addr[INDEX_1]); dst_addr = server_addr; - dst_addr_len = 2; + dst_addr_len = INDEX_2; } else { printf("invalid route cfg input\n"); return -1; diff --git a/newip/examples/nip_tcp_client_demo.c b/newip/examples/nip_tcp_client_demo.c index 4a602a9..61cb164 100644 --- a/newip/examples/nip_tcp_client_demo.c +++ b/newip/examples/nip_tcp_client_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of NewIP tcp client. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include @@ -8,9 +14,7 @@ #include #include #include -#include #include -#include #include "nip_uapi.h" #include "nip_lib.h" @@ -24,10 +28,14 @@ int _send(int cfd, int pkt_num) { char buf[BUFLEN] = {0}; struct timeval sys_time; + int ret; gettimeofday(&sys_time, NULL); - sprintf(buf, "%ld %6ld NIP_TCP # %6d", sys_time.tv_sec, sys_time.tv_usec, pkt_num); - + ret = sprintf(buf, "%ld %6ld NIP_TCP # %6d", sys_time.tv_sec, sys_time.tv_usec, pkt_num); + if (ret < 0) { + printf("sprintf failed\n"); + return -1; + } if (send(cfd, buf, PKTLEN, 0) < 0) { perror("sendto"); return -1; @@ -45,7 +53,7 @@ int _recv(int cfd, int pkt_num, int *success) FD_ZERO(&readfds); FD_SET(cfd, &readfds); - tv.tv_sec = 2; + tv.tv_sec = TIMEOUT_SEC; tv.tv_usec = 0; if (select(cfd + 1, &readfds, NULL, NULL, &tv) < 0) { perror("select"); diff --git a/newip/examples/nip_tcp_server_demo.c b/newip/examples/nip_tcp_server_demo.c index 156f796..bb70b99 100644 --- a/newip/examples/nip_tcp_server_demo.c +++ b/newip/examples/nip_tcp_server_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of NewIP tcp server. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include diff --git a/newip/examples/nip_uapi.h b/newip/examples/nip_uapi.h index c8740b0..e2c49cd 100644 --- a/newip/examples/nip_uapi.h +++ b/newip/examples/nip_uapi.h @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Definitions for the structure + * associated with NewIP. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #ifndef _NIP_UAPI_H #define _NIP_UAPI_H diff --git a/newip/examples/nip_udp_client_demo.c b/newip/examples/nip_udp_client_demo.c index 8f6f728..8048200 100644 --- a/newip/examples/nip_udp_client_demo.c +++ b/newip/examples/nip_udp_client_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of NewIP udp client. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include @@ -8,7 +14,6 @@ #include #include #include -#include #define __USE_GNU #include @@ -23,10 +28,14 @@ int _sendto(int cfd, struct sockaddr_nin *si_server, int pkt_num) char buf[BUFLEN] = {0}; struct timeval sys_time; socklen_t slen = sizeof(struct sockaddr_nin); + int ret; gettimeofday(&sys_time, NULL); - sprintf(buf, "%ld %6ld NIP_UDP # %6d", sys_time.tv_sec, sys_time.tv_usec, pkt_num); - + ret = sprintf(buf, "%ld %6ld NIP_UDP # %6d", sys_time.tv_sec, sys_time.tv_usec, pkt_num); + if (ret < 0) { + printf("sprintf failed"); + return -1; + } if (sendto(cfd, buf, BUFLEN, 0, (struct sockaddr *)si_server, slen) < 0) { printf("client sendto fail, pkt_num=%d", pkt_num); return -1; @@ -45,7 +54,7 @@ int _recvfrom(int cfd, struct sockaddr_nin *si_server, int pkt_num, int *success FD_ZERO(&readfds); FD_SET(cfd, &readfds); - tv.tv_sec = 2; + tv.tv_sec = TIMEOUT_SEC; tv.tv_usec = 0; if (select(cfd + 1, &readfds, NULL, NULL, &tv) < 0) { printf("client select fail, pkt_num=%d", pkt_num); diff --git a/newip/examples/nip_udp_server_demo.c b/newip/examples/nip_udp_server_demo.c index c4265dd..77e538b 100644 --- a/newip/examples/nip_udp_server_demo.c +++ b/newip/examples/nip_udp_server_demo.c @@ -1,6 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Demo example of NewIP udp server. + * + * Author: Yang Yanjun + * + * Data: 2022-09-06 */ #include #include diff --git a/newip/src/common/nip_addr.c b/newip/src/common/nip_addr.c index f108a2b..32bc360 100644 --- a/newip/src/common/nip_addr.c +++ b/newip/src/common/nip_addr.c @@ -1,6 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provide operations and conversions + * related to NewIP address. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include "nip_addr.h" diff --git a/newip/src/common/nip_addr.h b/newip/src/common/nip_addr.h index abb49ca..5ae1425 100644 --- a/newip/src/common/nip_addr.h +++ b/newip/src/common/nip_addr.h @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provide operations and conversions + * related to NewIP address. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #ifndef _UAPI_NEWIP_ADDR_H #define _UAPI_NEWIP_ADDR_H diff --git a/newip/src/common/nip_checksum.c b/newip/src/common/nip_checksum.c index a85c1f6..cae92e6 100644 --- a/newip/src/common/nip_checksum.c +++ b/newip/src/common/nip_checksum.c @@ -1,6 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provides some functionalities for + * checksum calculation in the NewIP protocol. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include "nip_hdr.h" #include "nip_checksum.h" diff --git a/newip/src/common/nip_checksum.h b/newip/src/common/nip_checksum.h index 3ca09a3..40fc15c 100644 --- a/newip/src/common/nip_checksum.h +++ b/newip/src/common/nip_checksum.h @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Provides some functionalities for + * checksum calculation in the NewIP protocol. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #ifndef _NIP_CHECKSUM_H #define _NIP_CHECKSUM_H diff --git a/newip/src/common/nip_hdr.h b/newip/src/common/nip_hdr.h index d92c9b2..70b1eab 100644 --- a/newip/src/common/nip_hdr.h +++ b/newip/src/common/nip_hdr.h @@ -1,6 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: Constructs and functions are provided + * to handle encapsulation and parsing of the NewIP + * network layer protocol header. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #ifndef _NEWIP_HDR_H #define _NEWIP_HDR_H diff --git a/newip/src/common/nip_hdr_decap.c b/newip/src/common/nip_hdr_decap.c index d49a834..21444c8 100644 --- a/newip/src/common/nip_hdr_decap.c +++ b/newip/src/common/nip_hdr_decap.c @@ -1,6 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: This file implements the function + * of decapsulating the NewIP protocol header. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include "nip_hdr.h" diff --git a/newip/src/common/nip_hdr_encap.c b/newip/src/common/nip_hdr_encap.c index 7ad87d4..9e2cef1 100644 --- a/newip/src/common/nip_hdr_encap.c +++ b/newip/src/common/nip_hdr_encap.c @@ -1,6 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2022 Huawei Device Co., Ltd. + * + * Description: This file implements the function + * of encapsulating the NewIP protocol header. + * + * Author: Yang Yanjun + * + * Data: 2022-07-18 */ #include "nip_hdr.h" diff --git a/newip/src/linux-5.10/drivers/net/bt/btdev.c b/newip/src/linux-5.10/drivers/net/bt/btdev.c index 4eaff9b..446d207 100644 --- a/newip/src/linux-5.10/drivers/net/bt/btdev.c +++ b/newip/src/linux-5.10/drivers/net/bt/btdev.c @@ -727,26 +727,26 @@ static void __bt_table_delete_all(struct bt_drv *drv) drv->devices_table->num = 0; } -static int bt_table_delete_all(struct bt_drv *bt_drv) +static int bt_table_delete_all(struct bt_drv *drv) { - if (unlikely(!bt_drv->devices_table)) + if (unlikely(!drv->devices_table)) return -EINVAL; - mutex_lock(&bt_drv->bitmap_lock); - mutex_lock(&bt_drv->devices_table->tbl_lock); + mutex_lock(&drv->bitmap_lock); + mutex_lock(&drv->devices_table->tbl_lock); - __bt_table_delete_all(bt_drv); + __bt_table_delete_all(drv); - mutex_unlock(&bt_drv->devices_table->tbl_lock); - mutex_unlock(&bt_drv->bitmap_lock); + mutex_unlock(&drv->devices_table->tbl_lock); + mutex_unlock(&drv->bitmap_lock); return OK; } -static void bt_table_destroy(struct bt_drv *bt_drv) +static void bt_table_destroy(struct bt_drv *drv) { - __bt_table_delete_all(bt_drv); - kfree(bt_drv->devices_table); - bt_drv->devices_table = NULL; + __bt_table_delete_all(drv); + kfree(drv->devices_table); + drv->devices_table = NULL; } static struct bt_ring *__bt_ring_create(int size) @@ -875,19 +875,25 @@ static void bt_dev_class_destroy(struct class *cls) class_destroy(cls); } +static void bt_cdev_device_destroy(struct bt_cdev *dev) +{ + device_destroy(dev->bt_class, dev->cdev->dev); +} + static int bt_cdev_device_create(struct bt_cdev *dev, struct class *cls, u32 id) { struct device *device = NULL; dev_t devno = MKDEV(BT_DEV_MAJOR, id); + int ret; if (unlikely(!cls)) { pr_err("not a valid cls"); return -EINVAL; } - pr_devel("bt cdev_device_create: id=%d", id); + pr_devel("bt cdev device create: id=%d", id); dev->bt_class = cls; @@ -896,15 +902,16 @@ static int bt_cdev_device_create(struct bt_cdev *dev, pr_err("create device failed"); return -EIO; } - snprintf(dev->dev_filename, sizeof(dev->dev_filename), "%s%u", BT_DEV_PATH_PREFIX, id); + ret = snprintf(dev->dev_filename, sizeof(dev->dev_filename), + "%s%u", BT_DEV_PATH_PREFIX, id); + if (ret < 0) { + pr_devel("bt cdev device create: snprintf failed\n"); + bt_cdev_device_destroy(dev); + return -EFAULT; + } return OK; } -static void bt_cdev_device_destroy(struct bt_cdev *dev) -{ - device_destroy(dev->bt_class, dev->cdev->dev); -} - static struct bt_cdev *bt_cdev_create(const struct file_operations *ops, u32 id) { @@ -943,9 +950,9 @@ static struct bt_cdev *bt_cdev_create(const struct file_operations *ops, return dev; cdev_device_create_failed: +cdev_add_failed: cdev_del(chrdev); -cdev_add_failed: cdev_alloc_failed: kfree(dev); @@ -1085,7 +1092,11 @@ static struct net_device *bt_net_device_create(u32 id) pr_err("bt net device create: invalid id"); return NULL; } - snprintf(ifa_name, sizeof(ifa_name), "%s%d", BT_VIRNET_NAME_PREFIX, id); + err = snprintf(ifa_name, sizeof(ifa_name), "%s%d", BT_VIRNET_NAME_PREFIX, id); + if (err < 0) { + pr_err("bt net device create: snprintf failed"); + return NULL; + } ndev = alloc_netdev(0, ifa_name, NET_NAME_UNKNOWN, ether_setup); if (unlikely(!ndev)) { pr_err("alloc_netdev failed"); diff --git a/newip/src/linux-5.10/drivers/net/bt/btdev.h b/newip/src/linux-5.10/drivers/net/bt/btdev.h index 07a7c2e..2122b1b 100644 --- a/newip/src/linux-5.10/drivers/net/bt/btdev.h +++ b/newip/src/linux-5.10/drivers/net/bt/btdev.h @@ -225,12 +225,12 @@ static inline const char *bt_virnet_get_state_rep(const struct bt_virnet *vn) return bt_virnet_state_rep[vn->state]; } -static inline int bt_get_total_device(const struct bt_drv *bt_drv) +static inline int bt_get_total_device(const struct bt_drv *drv) { - if (unlikely(!bt_drv->devices_table)) + if (unlikely(!drv->devices_table)) return -EINVAL; - return bt_drv->devices_table->num; + return drv->devices_table->num; } static inline int bt_virnet_get_ring_packets(const struct bt_virnet *vn) @@ -251,9 +251,9 @@ static inline int bt_virnet_get_ring_packets(const struct bt_virnet *vn) static struct bt_table *bt_table_init(void); static int bt_table_add_device(struct bt_table *tbl, struct bt_virnet *vn); static void bt_table_remove_device(struct bt_table *tbl, struct bt_virnet *vn); -static int bt_table_delete_all(struct bt_drv *bt_drv); +static int bt_table_delete_all(struct bt_drv *drv); static struct bt_virnet *bt_table_find(struct bt_table *tbl, const char *ifa_name); -static void bt_table_destroy(struct bt_drv *bt_drv); +static void bt_table_destroy(struct bt_drv *drv); static void bt_delete_io_files(struct bt_drv *bt_mng); static struct bt_io_file **bt_create_io_files(void); diff --git a/newip/src/linux-5.10/net/newip/nip_hooks_register.c b/newip/src/linux-5.10/net/newip/nip_hooks_register.c index 8cc6dd5..46b9bc0 100644 --- a/newip/src/linux-5.10/net/newip/nip_hooks_register.c +++ b/newip/src/linux-5.10/net/newip/nip_hooks_register.c @@ -2,7 +2,12 @@ /* * Copyright (c) 2022 Huawei Device Co., Ltd. * - * Definitions for the NewIP Hooks Register module. + * Description: Definitions for the NewIP Hooks + * Register module. + * + * Author: Yang Yanjun + * + * Data: 2022-09-20 */ #ifdef CONFIG_NEWIP_HOOKS #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__ @@ -19,7 +24,7 @@ void vendor_ninet_ehashfn(void *data, const struct sock *sk, u32 *ret) } void vendor_ninet_gifconf(void *data, struct net_device *dev, - char __user *buf, int len, int size, int *ret) + char __user *buf, int len, int size, int *ret) { if (*ret >= 0) { int done = ninet_gifconf(dev, buf + *ret, len - *ret, size); diff --git a/newip/src/linux-5.10/net/newip/nip_hooks_register.h b/newip/src/linux-5.10/net/newip/nip_hooks_register.h index f5109ce..7ec04d1 100644 --- a/newip/src/linux-5.10/net/newip/nip_hooks_register.h +++ b/newip/src/linux-5.10/net/newip/nip_hooks_register.h @@ -2,7 +2,12 @@ /* * Copyright (c) 2022 Huawei Device Co., Ltd. * - * Definitions for the NewIP Hooks Register module. + * Description: Definitions for the NewIP Hooks + * Register module. + * + * Author: Yang Yanjun + * + * Data: 2022-09-20 */ #ifndef _NIP_HOOKS_REGISTER_H #define _NIP_HOOKS_REGISTER_H diff --git a/newip/src/linux-5.10/net/newip/tcp_nip_parameter.c b/newip/src/linux-5.10/net/newip/tcp_nip_parameter.c index 9b24e26..8c21542 100644 --- a/newip/src/linux-5.10/net/newip/tcp_nip_parameter.c +++ b/newip/src/linux-5.10/net/newip/tcp_nip_parameter.c @@ -7,7 +7,11 @@ * operating system. NewIP INET is implemented using the BSD Socket * interface as the means of communication with the user level. * - * Definitions for the NewIP parameter module. + * Description: Definitions for the NewIP parameter module. + * + * Author: Yang Yanjun + * + * Data: 2022-07-25 */ #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__ diff --git a/newip/src/linux-5.10/net/newip/tcp_nip_parameter.h b/newip/src/linux-5.10/net/newip/tcp_nip_parameter.h index a9cea6c..30eedc2 100644 --- a/newip/src/linux-5.10/net/newip/tcp_nip_parameter.h +++ b/newip/src/linux-5.10/net/newip/tcp_nip_parameter.h @@ -7,7 +7,11 @@ * operating system. NewIP INET is implemented using the BSD Socket * interface as the means of communication with the user level. * - * Definitions for the NewIP parameter module. + * Description: Definitions for the NewIP parameter module. + * + * Author: Yang Yanjun + * + * Data: 2022-07-25 */ #ifndef _TCP_NIP_PARAMETER_H #define _TCP_NIP_PARAMETER_H diff --git a/newip/third_party/linux-5.10/include/uapi/linux/nip.h b/newip/third_party/linux-5.10/include/uapi/linux/nip.h index 8b9acd6..9bf7dd8 100644 --- a/newip/third_party/linux-5.10/include/uapi/linux/nip.h +++ b/newip/third_party/linux-5.10/include/uapi/linux/nip.h @@ -13,8 +13,8 @@ #include #include #include -#include "nip_addr.h" #include +#include "nip_addr.h" struct nip_ifreq { struct nip_addr ifrn_addr; diff --git a/newip/third_party/linux-5.10/net/newip/icmp.c b/newip/third_party/linux-5.10/net/newip/icmp.c index 1f796a6..8202c37 100644 --- a/newip/third_party/linux-5.10/net/newip/icmp.c +++ b/newip/third_party/linux-5.10/net/newip/icmp.c @@ -21,6 +21,12 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__ +#include +#include +#include +#include +#include +#include #include #include #include @@ -32,12 +38,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include "nip_hdr.h" #include "tcp_nip_parameter.h" diff --git a/newip/third_party/linux-5.10/net/newip/ninet_hashtables.c b/newip/third_party/linux-5.10/net/newip/ninet_hashtables.c index 19071ff..563be27 100644 --- a/newip/third_party/linux-5.10/net/newip/ninet_hashtables.c +++ b/newip/third_party/linux-5.10/net/newip/ninet_hashtables.c @@ -41,6 +41,8 @@ #include #include "tcp_nip_parameter.h" +#define TCP_SEQ_SCALE_SHIFT 6 + static siphash_key_t net_secret __read_mostly; static __always_inline void net_secret_init(void) @@ -60,7 +62,7 @@ static u32 seq_scale(u32 seq) * overlaps less than one time per MSL (2 minutes). * Choosing a clock of 64 ns period is OK. (period of 274 s) */ - return seq + (ktime_get_real_ns() >> 6); + return seq + (ktime_get_real_ns() >> TCP_SEQ_SCALE_SHIFT); } #endif diff --git a/newip/third_party/linux-5.10/net/newip/nip_fib.c b/newip/third_party/linux-5.10/net/newip/nip_fib.c index 442da30..d5f71f6 100644 --- a/newip/third_party/linux-5.10/net/newip/nip_fib.c +++ b/newip/third_party/linux-5.10/net/newip/nip_fib.c @@ -287,7 +287,7 @@ out_fib_table_hash: return -ENOMEM; } -static void nip_fib_net_exit(struct net *net) +static void __net_exit nip_fib_net_exit(struct net *net) { nip_fib_free_table(net->newip.nip_fib_main_tbl); nip_fib_free_table(net->newip.nip_fib_local_tbl); @@ -323,6 +323,10 @@ out_kmem_cache_create: goto out; } +/* When adding the __exit tag to a function, it is important to + * ensure that the function is only called during the exit phase + * to avoid unnecessary warnings and errors. + */ void nip_fib_gc_cleanup(void) { unregister_pernet_subsys(&nip_fib_net_ops); diff --git a/newip/third_party/linux-5.10/net/newip/nip_output.c b/newip/third_party/linux-5.10/net/newip/nip_output.c index 8b2bc16..e609196 100644 --- a/newip/third_party/linux-5.10/net/newip/nip_output.c +++ b/newip/third_party/linux-5.10/net/newip/nip_output.c @@ -434,6 +434,7 @@ out: return err; out_err_release: + rcu_read_unlock(); dst_release(dst); dst = NULL; sk->sk_err_soft = -err; diff --git a/newip/third_party/linux-5.10/net/newip/nip_sockglue.c b/newip/third_party/linux-5.10/net/newip/nip_sockglue.c index 89d1291..390c85b 100644 --- a/newip/third_party/linux-5.10/net/newip/nip_sockglue.c +++ b/newip/third_party/linux-5.10/net/newip/nip_sockglue.c @@ -18,17 +18,17 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__ +#include +#include +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include -#include #include "tcp_nip_parameter.h" #define NIP_OPTNAME_MAX 255 @@ -44,8 +44,9 @@ static bool nip_setsockopt_needs_rtnl(int optname) switch (optname) { case IP_MSFILTER: return true; + default: + return false; } - return false; } static bool nip_getsockopt_needs_rtnl(int optname) @@ -53,8 +54,9 @@ static bool nip_getsockopt_needs_rtnl(int optname) switch (optname) { case IP_MSFILTER: return true; + default: + return false; } - return false; } static int do_nip_setsockopt(struct sock *sk, int level, int optname, diff --git a/newip/third_party/linux-5.10/net/newip/nndisc.c b/newip/third_party/linux-5.10/net/newip/nndisc.c index 6b65e0f..6541510 100644 --- a/newip/third_party/linux-5.10/net/newip/nndisc.c +++ b/newip/third_party/linux-5.10/net/newip/nndisc.c @@ -23,6 +23,18 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": [%s:%d] " fmt, __func__, __LINE__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -35,19 +47,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include "nip_hdr.h" diff --git a/newip/third_party/linux-5.10/net/newip/route.c b/newip/third_party/linux-5.10/net/newip/route.c index 8c7232f..c10b32a 100644 --- a/newip/third_party/linux-5.10/net/newip/route.c +++ b/newip/third_party/linux-5.10/net/newip/route.c @@ -16,7 +16,7 @@ * Alan Cox : Added BSD route gw semantics * Alan Cox : Super /proc >4K * Alan Cox : MTU in route table - * Alan Cox : MSS actually. Also added the window + * Alan Cox : MSS actually. Also added the window * clamper. * Sam Lantinga : Fixed route matching in rt_del() * Alan Cox : Routing cache support. @@ -36,7 +36,7 @@ * Olaf Erb : irtt wasn't being copied right. * Bjorn Ekwall : Kerneld route support. * Alan Cox : Multicast fixed (I hope) - * Pavel Krauz : Limited broadcast fixed + * Pavel Krauz : Limited broadcast fixed * Mike McLagan : Routing by source * Alexey Kuznetsov : End of old history. Split to fib.c and * route.c and rewritten from scratch. @@ -49,8 +49,8 @@ * Robert Olsson : Added rt_cache statistics * Arnaldo C. Melo : Convert proc stuff to seq_file * Eric Dumazet : hashed spinlocks and rt_check_expire() fixes. - * Ilia Sotnikov : Ignore TOS on PMTUD and Redirect - * Ilia Sotnikov : Removed TOS from hash calculations + * Ilia Sotnikov : Ignore TOS on PMTUD and Redirect + * Ilia Sotnikov : Removed TOS from hash calculations * * Based on net/ipv6/route.c * Authors: diff --git a/newip/third_party/linux-5.10/net/newip/tcp_nip.c b/newip/third_party/linux-5.10/net/newip/tcp_nip.c index 110cb3f..9a43f1e 100644 --- a/newip/third_party/linux-5.10/net/newip/tcp_nip.c +++ b/newip/third_party/linux-5.10/net/newip/tcp_nip.c @@ -41,7 +41,7 @@ * escape still * Alan Cox : Fixed another acking RST frame bug. * Should stop LAN workplace lockups. - * Alan Cox : Some tidyups using the new skb list + * Alan Cox : Some tidyups using the new skb list * facilities * Alan Cox : sk->keepopen now seems to work * Alan Cox : Pulls options out correctly on accepts @@ -195,7 +195,7 @@ * tcp_do_sendmsg to avoid burstiness. * Eric Schenk : Fix fast close down bug with * shutdown() followed by close(). - * Andi Kleen : Make poll agree with SIGIO + * Andi Kleen : Make poll agree with SIGIO * Salvatore Sanfilippo : Support SO_LINGER with linger == 1 and * lingertime == 0 (RFC 793 ABORT Call) * Hirokazu Takahashi : Use copy_from_user() instead of @@ -215,7 +215,7 @@ * the TCP layer, missed a check for an * ACK bit. * Andi Kleen : Implemented fast path mtu discovery. - * Fixed many serious bugs in the + * Fixed many serious bugs in the * request_sock handling and moved * most of it into the af independent code. * Added tail drop and some other bugfixes. @@ -321,7 +321,7 @@ * Andi Kleen: Process packets with PSH set in the * fast path. * J Hadi Salim: ECN support - * Andrei Gurtov, + * Andrei Gurtov, * Pasi Sarolahti, * Panu Kuhlberg: Experimental audit of TCP (re)transmission * engine. Lots of bugs are found. @@ -402,6 +402,12 @@ #include "nip_checksum.h" #include "tcp_nip_parameter.h" +#define TCP_HEADER_LENGTH(th) ((th)->doff << 2) +#define TCP_ACK_NUM_MULTIPLIER 20 +#define TCP_WINDOW_RAISE_THRESHOLD 2 +#define TCP_BACKLOG_HEADROOM (64 * 1024) +#define BYTES_PER_TCP_HEADER 4 + static const struct inet_connection_sock_af_ops newip_specific; static void tcp_nip_push(struct sock *sk, int flags, int mss_now, @@ -740,7 +746,7 @@ static void tcp_nip_send_reset(struct sock *sk, struct sk_buff *skb) seq = ntohl(th->ack_seq); else ack_seq = ntohl(th->seq) + th->syn + th->fin + skb->len - - (th->doff << 2); + TCP_HEADER_LENGTH(th); tcp_nip_actual_send_reset(sk, skb, seq, ack_seq, 0, 1, priority); } @@ -1202,7 +1208,7 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now, struct tcp_sock *tp = tcp_sk(sk); u32 new_size_goal, size_goal; - if (!large_allowed) + if (!large_allowed || !mss_now) return mss_now; /* Note : tcp_tso_autosize() will eventually split this later */ @@ -1382,7 +1388,8 @@ void tcp_nip_cleanup_rbuf(struct sock *sk, int copied) if (inet_csk_ack_scheduled(sk)) { const struct inet_connection_sock *icsk = inet_csk(sk); - if (tp->rcv_nxt - tp->rcv_wup > (get_ack_num() * 20 * icsk->icsk_ack.rcv_mss) || + if (tp->rcv_nxt - tp->rcv_wup > (get_ack_num() * + TCP_ACK_NUM_MULTIPLIER * icsk->icsk_ack.rcv_mss) || /* If this read emptied read buffer, we send ACK, if * connection is not bidirectional, user drained * receive buffer and there was a small segment @@ -1406,7 +1413,7 @@ void tcp_nip_cleanup_rbuf(struct sock *sk, int copied) __u32 rcv_window_now = tcp_receive_window(tp); /* Optimize, __nip_tcp_select_window() is not cheap. */ - if (2 * rcv_window_now <= tp->window_clamp) { + if (TCP_WINDOW_RAISE_THRESHOLD * rcv_window_now <= tp->window_clamp) { __u32 new_window = __nip_tcp_select_window(sk); /* Send ACK now, if this read freed lots of space @@ -1414,7 +1421,7 @@ void tcp_nip_cleanup_rbuf(struct sock *sk, int copied) * We can advertise it now, if it is not less than current one. * "Lots" means "at least twice" here. */ - if (new_window && new_window >= 2 * rcv_window_now) + if (new_window && new_window >= TCP_WINDOW_RAISE_THRESHOLD * rcv_window_now) time_to_ack = true; } } @@ -1675,7 +1682,7 @@ static bool tcp_nip_add_backlog(struct sock *sk, struct sk_buff *skb) * to reduce memory overhead, so add a little headroom here. * Few sockets backlog are possibly concurrently non empty. */ - limit += 64 * 1024; + limit += TCP_BACKLOG_HEADROOM; /* In case all data was pulled from skb frags (in __pskb_pull_tail()), * we can fix skb->truesize to its real value to avoid future drops. @@ -1829,7 +1836,7 @@ static void tcp_nip_early_demux(struct sk_buff *skb) return; th = tcp_hdr(skb); - if (th->doff < sizeof(struct tcphdr) / 4) + if (th->doff < sizeof(struct tcphdr) / BYTES_PER_TCP_HEADER) return; sk = __ninet_lookup_established(dev_net(skb->dev), &tcp_hashinfo, @@ -2060,6 +2067,10 @@ out_nip_tcp_protocol: goto out; } +/* When adding the __exit tag to a function, it is important to + * ensure that the function is only called during the exit phase + * to avoid unnecessary warnings and errors. + */ void tcp_nip_exit(void) { ninet_unregister_protosw(&tcp_nip_protosw); diff --git a/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c b/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c index 0b68dfa..3dad3bc 100644 --- a/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c +++ b/newip/third_party/linux-5.10/net/newip/tcp_nip_input.c @@ -48,7 +48,7 @@ * Andi Kleen: Process packets with PSH set in the * fast path. * J Hadi Salim: ECN support - * Andrei Gurtov, + * Andrei Gurtov, * Pasi Sarolahti, * Panu Kuhlberg: Experimental audit of TCP (re)transmission * engine. Lots of bugs are found. @@ -506,6 +506,11 @@ static void tcp_nip_data_queue(struct sock *sk, struct sk_buff *skb) u32 cur_win = tcp_receive_window(tp); u32 seq_max = tp->rcv_nxt + cur_win; + if (mss <= 0) { + nip_dbg("invalid parameter, mss=%u", mss); + __kfree_skb(skb); + return; + } /* Newip Urg_ptr is disabled. Urg_ptr is used to carry the number of discarded packets */ tp->snd_up = (TCP_SKB_CB(skb)->seq - tcp_sk(sk)->rcv_nxt) / mss; tp->snd_up = tp->snd_up > PKT_DISCARD_MAX ? 0 : tp->snd_up; @@ -1044,7 +1049,7 @@ void tcp_nip_openreq_init_rwin(struct request_sock *req, req->rsk_window_clamp = window_clamp ? : dst_metric(dst, RTAX_WINDOW); /* limit the window selection if the user enforce a smaller rx buffer */ - if (sk_listener->sk_userlocks & SOCK_RCVBUF_LOCK && + if ((sk_listener->sk_userlocks & SOCK_RCVBUF_LOCK) && (req->rsk_window_clamp > full_space || req->rsk_window_clamp == 0)) req->rsk_window_clamp = full_space; diff --git a/newip/third_party/linux-5.10/net/newip/tcp_nip_output.c b/newip/third_party/linux-5.10/net/newip/tcp_nip_output.c index 2a8fca1..c3389cc 100644 --- a/newip/third_party/linux-5.10/net/newip/tcp_nip_output.c +++ b/newip/third_party/linux-5.10/net/newip/tcp_nip_output.c @@ -26,7 +26,7 @@ * Cacophonix Gaul : draft-minshall-nagle-01 * J Hadi Salim : ECN support * - * Based on net/ipv4/tcp_minisocks.c + * Based on net/ipv4/tcp_minisocks.c * Authors: Ross Biro * Fred N. van Kempen, * Mark Evans, @@ -64,6 +64,7 @@ #define OPTION_MD5 BIT(2) #define OPTION_WSCALE BIT(3) #define OPTION_FAST_OPEN_COOKIE BIT(8) +#define TCP_NIP_SND_NUM_MAX (~0U) /* Store the options contained in TCP when sending TCP packets */ struct tcp_nip_out_options { @@ -385,7 +386,7 @@ static __u16 tcp_nip_advertise_mss(struct sock *sk) int nip_mss; unsigned int metric = dst_metric_advmss(dst); - if (metric < mss) { + if (metric < (unsigned int)mss) { mss = metric; tp->advmss = mss; } @@ -1079,11 +1080,18 @@ static bool tcp_nip_write_xmit(struct sock *sk, unsigned int mss_now, int nonagl struct tcp_sock *tp = tcp_sk(sk); struct tcp_nip_common *ntp = &tcp_nip_sk(sk)->common; struct sk_buff *skb; - u32 snd_num = get_nip_tcp_snd_win_enable() ? (ntp->nip_ssthresh / mss_now) : 0xFFFFFFFF; + u32 snd_num; u32 last_nip_ssthresh = ntp->nip_ssthresh; static const char * const str[] = {"can`t send pkt because no window", "have window to send pkt"}; + if (!mss_now) { + nip_dbg("invalid parameter, mss_now=%u", mss_now); + return false; + } + snd_num = get_nip_tcp_snd_win_enable() ? (ntp->nip_ssthresh / mss_now) : + TCP_NIP_SND_NUM_MAX; + tcp_nip_keepalive_enable(sk); ntp->idle_ka_probes_out = 0; diff --git a/newip/third_party/linux-5.10/net/newip/tcp_nip_timer.c b/newip/third_party/linux-5.10/net/newip/tcp_nip_timer.c index 7e37cda..6be0ecf 100644 --- a/newip/third_party/linux-5.10/net/newip/tcp_nip_timer.c +++ b/newip/third_party/linux-5.10/net/newip/tcp_nip_timer.c @@ -26,6 +26,7 @@ #include #include "tcp_nip_parameter.h" +#define TCP_ORPHAN_RETRIES 8 /** * tcp_nip_orphan_retries() - Returns maximal number of retries on an orphaned socket * @sk: Pointer to the current socket. @@ -44,7 +45,7 @@ static int tcp_nip_orphan_retries(struct sock *sk, bool alive) * RTO of 200msec. */ if (retries == 0 && alive) - retries = 8; + retries = TCP_ORPHAN_RETRIES; return retries; } diff --git a/newip/third_party/linux-5.10/net/newip/udp.c b/newip/third_party/linux-5.10/net/newip/udp.c index 641e6ed..899f65f 100644 --- a/newip/third_party/linux-5.10/net/newip/udp.c +++ b/newip/third_party/linux-5.10/net/newip/udp.c @@ -9,11 +9,11 @@ * * Fixes: * Alan Cox : verify_area() calls - * Alan Cox : stopped close while in use off icmp + * Alan Cox : stopped close while in use off icmp * messages. Not a fix but a botch that * for udp at least is 'valid'. * Alan Cox : Fixed icmp handling properly - * Alan Cox : Correct error for oversized datagrams + * Alan Cox : Correct error for oversized datagrams * Alan Cox : Tidied select() semantics. * Alan Cox : udp_err() fixed properly, also now * select and read wake correctly on errors @@ -25,7 +25,7 @@ * Alan Cox : Switched to new sk_buff handlers. No more backlog! * Alan Cox : Using generic datagram code. Even smaller and the PEEK * bug no longer crashes it. - * Fred Van Kempen : Net2e support for sk->broadcast. + * Fred Van Kempen : Net2e support for sk->broadcast. * Alan Cox : Uses skb_free_datagram * Alan Cox : Added get/set sockopt support. * Alan Cox : Broadcasting without option set returns EACCES. @@ -37,7 +37,7 @@ * Alan Cox : Smarter af_inet used properly. * Alan Cox : Use new kernel side addressing. * Alan Cox : Incorrect return on truncated datagram receive. - * Arnt Gulbrandsen : New udp_send and stuff + * Arnt Gulbrandsen : New udp_send and stuff * Alan Cox : Cache last socket * Alan Cox : Route cache * Jon Peatfield : Minor efficiency fix to sendto(). @@ -66,7 +66,7 @@ * Derek Atkins : Add Encapulation Support * James Chapman : Add L2TP encapsulation type. * - * Based on net/ipv6/udp.c + * Based on net/ipv6/udp.c * Authors: * Pedro Roque * -- Gitee