diff --git a/net/arp/arp_arpin.c b/net/arp/arp_arpin.c index fd8163a2e0..008413730e 100644 --- a/net/arp/arp_arpin.c +++ b/net/arp/arp_arpin.c @@ -125,8 +125,10 @@ void arp_arpin(FAR struct net_driver_s *dev) arp->ah_opcode = HTONS(ARP_REPLY); memcpy(arp->ah_dhwaddr, arp->ah_shwaddr, ETHER_ADDR_LEN); - memcpy(arp->ah_shwaddr, dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN); - memcpy(eth->src, dev->d_mac.ether.ether_addr_octet, ETHER_ADDR_LEN); + memcpy(arp->ah_shwaddr, dev->d_mac.ether.ether_addr_octet, + ETHER_ADDR_LEN); + memcpy(eth->src, dev->d_mac.ether.ether_addr_octet, + ETHER_ADDR_LEN); memcpy(eth->dest, arp->ah_dhwaddr, ETHER_ADDR_LEN); arp->ah_dipaddr[0] = arp->ah_sipaddr[0]; diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index ab5b6415f9..c7a586262c 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -86,7 +86,8 @@ static const uint16_t g_broadcast_ipaddr[2] = * Well-known ethernet multicast address: * * ADDRESS TYPE USAGE - * 01-00-0c-cc-cc-cc 0x0802 CDP (Cisco Discovery Protocol), VTP (Virtual Trunking Protocol) + * 01-00-0c-cc-cc-cc 0x0802 CDP (Cisco Discovery Protocol), + * VTP (Virtual Trunking Protocol) * 01-00-0c-cc-cc-cd 0x0802 Cisco Shared Spanning Tree Protocol Address * 01-80-c2-00-00-00 0x0802 Spanning Tree Protocol (for bridges) IEEE 802.1D * 01-80-c2-00-00-02 0x0809 Ethernet OAM Protocol IEEE 802.3ah diff --git a/net/bluetooth/bluetooth_recvfrom.c b/net/bluetooth/bluetooth_recvfrom.c index 90b79b5269..9de4764652 100644 --- a/net/bluetooth/bluetooth_recvfrom.c +++ b/net/bluetooth/bluetooth_recvfrom.c @@ -240,6 +240,7 @@ static uint16_t bluetooth_recvfrom_eventhandler(FAR struct net_driver_s *dev, } /* Make sure that this is the driver to which the socket is bound. */ + #warning Missing logic pstate = (FAR struct bluetooth_recvfrom_s *)pvpriv; diff --git a/net/bluetooth/bluetooth_sendto.c b/net/bluetooth/bluetooth_sendto.c index d87b62b59b..bdfa90a8e7 100644 --- a/net/bluetooth/bluetooth_sendto.c +++ b/net/bluetooth/bluetooth_sendto.c @@ -119,6 +119,7 @@ static uint16_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev, } /* Make sure that this is the driver to which the socket is connected. */ + #warning Missing logic pstate = (FAR struct bluetooth_sendto_s *)pvpriv; @@ -203,6 +204,7 @@ static uint16_t bluetooth_sendto_eventhandler(FAR struct net_driver_s *dev, return flags; errout: + /* Don't allow any further call backs. */ pstate->is_cb->flags = 0; diff --git a/net/devif/ipv6_input.c b/net/devif/ipv6_input.c index 0c1f310311..95d75ccfc3 100644 --- a/net/devif/ipv6_input.c +++ b/net/devif/ipv6_input.c @@ -466,6 +466,7 @@ int ipv6_input(FAR struct net_driver_s *dev) { #ifdef NET_TCP_HAVE_STACK case IP_PROTO_TCP: /* TCP input */ + /* Forward the IPv6 TCP packet */ tcp_ipv6_input(dev, iphdrlen); @@ -502,6 +503,7 @@ int ipv6_input(FAR struct net_driver_s *dev) #ifdef NET_UDP_HAVE_STACK case IP_PROTO_UDP: /* UDP input */ + /* Forward the IPv6 UDP packet */ udp_ipv6_input(dev, iphdrlen); @@ -512,6 +514,7 @@ int ipv6_input(FAR struct net_driver_s *dev) #ifdef NET_ICMPv6_HAVE_STACK case IP_PROTO_ICMP6: /* ICMP6 input */ + /* Forward the ICMPv6 packet */ icmpv6_input(dev, iphdrlen); diff --git a/net/icmp/icmp_recvfrom.c b/net/icmp/icmp_recvfrom.c index c7c1f0ca51..36af8712f8 100644 --- a/net/icmp/icmp_recvfrom.c +++ b/net/icmp/icmp_recvfrom.c @@ -76,7 +76,7 @@ struct icmp_recvfrom_s FAR uint8_t *recv_buf; /* Location to return the response */ uint16_t recv_buflen; /* Size of the response */ int16_t recv_result; /* >=0: receive size on success; - * <0:negated errno on fail */ + * <0: negated errno on fail */ }; /**************************************************************************** diff --git a/net/icmp/icmp_sendto.c b/net/icmp/icmp_sendto.c index e5e94b8177..ea6ca0c832 100644 --- a/net/icmp/icmp_sendto.c +++ b/net/icmp/icmp_sendto.c @@ -300,11 +300,12 @@ static uint16_t sendto_eventhandler(FAR struct net_driver_s *dev, * device. */ - if (!net_ipv4addr_maskcmp(pstate->snd_toaddr, dev->d_ipaddr, dev->d_netmask)) + if (!net_ipv4addr_maskcmp(pstate->snd_toaddr, dev->d_ipaddr, + dev->d_netmask)) { - /* Destination address was not on the local network served by this - * device. If a timeout occurs, then the most likely reason is - * that the destination address is not reachable. + /* Destination address was not on the local network served by + * this device. If a timeout occurs, then the most likely + * reason is that the destination address is not reachable. */ nerr("ERROR: Not reachable\n"); diff --git a/net/icmpv6/icmpv6_recvfrom.c b/net/icmpv6/icmpv6_recvfrom.c index 5bf5d56f36..0a51e42f76 100644 --- a/net/icmpv6/icmpv6_recvfrom.c +++ b/net/icmpv6/icmpv6_recvfrom.c @@ -79,7 +79,7 @@ struct icmpv6_recvfrom_s FAR uint8_t *recv_buf; /* Location to return the response */ uint16_t recv_buflen; /* Size of the response */ int16_t recv_result; /* >=0: receive size on success; - * <0:negated errno on fail */ + * <0: negated errno on fail */ }; /**************************************************************************** diff --git a/net/ieee802154/ieee802154_recvfrom.c b/net/ieee802154/ieee802154_recvfrom.c index 8d3367c33f..bdb50a5c59 100644 --- a/net/ieee802154/ieee802154_recvfrom.c +++ b/net/ieee802154/ieee802154_recvfrom.c @@ -190,7 +190,8 @@ static ssize_t ieee802154_recvfrom_rxqueue(FAR struct radio_driver_s *radio, { iaddr = (FAR struct sockaddr_ieee802154_s *)pstate->ir_from; iaddr->sa_family = AF_IEEE802154; - memcpy(&iaddr->sa_addr, &container->ic_src, sizeof(struct ieee802154_saddr_s)); + memcpy(&iaddr->sa_addr, &container->ic_src, + sizeof(struct ieee802154_saddr_s)); } /* Free both the IOB and the container */ @@ -237,6 +238,7 @@ static uint16_t ieee802154_recvfrom_eventhandler(FAR struct net_driver_s *dev, } /* Make sure that this is the driver to which the socket is bound. */ + #warning Missing logic pstate = (FAR struct ieee802154_recvfrom_s *)pvpriv; diff --git a/net/ieee802154/ieee802154_sendto.c b/net/ieee802154/ieee802154_sendto.c index e57d52e759..7556f234a0 100644 --- a/net/ieee802154/ieee802154_sendto.c +++ b/net/ieee802154/ieee802154_sendto.c @@ -308,6 +308,7 @@ static uint16_t ieee802154_sendto_eventhandler(FAR struct net_driver_s *dev, } /* Make sure that this is the driver to which the socket is connected. */ + #warning Missing logic pstate = (FAR struct ieee802154_sendto_s *)pvpriv; @@ -391,6 +392,7 @@ static uint16_t ieee802154_sendto_eventhandler(FAR struct net_driver_s *dev, return flags; errout: + /* Don't allow any further call backs. */ pstate->is_cb->flags = 0; diff --git a/net/inet/inet_close.c b/net/inet/inet_close.c index 59a72f3194..f9af245418 100644 --- a/net/inet/inet_close.c +++ b/net/inet/inet_close.c @@ -157,7 +157,7 @@ static uint16_t tcp_close_eventhandler(FAR struct net_driver_s *dev, pstate->cl_result = OK; } - goto end_wait; + goto end_wait; } #ifdef CONFIG_NET_TCP_WRITE_BUFFERS diff --git a/net/inet/inet_recvfrom.c b/net/inet/inet_recvfrom.c index 0d379d5eca..7d4f5becc7 100644 --- a/net/inet/inet_recvfrom.c +++ b/net/inet/inet_recvfrom.c @@ -853,7 +853,8 @@ static uint16_t inet_tcp_eventhandler(FAR struct net_driver_s *dev, ****************************************************************************/ #ifdef NET_UDP_HAVE_STACK -static inline void inet_udp_sender(struct net_driver_s *dev, struct inet_recvfrom_s *pstate) +static inline void inet_udp_sender(FAR struct net_driver_s *dev, + FAR struct inet_recvfrom_s *pstate) { /* Get the family from the packet type, IP address from the IP header, and * the port number from the UDP header. diff --git a/net/ipforward/ipv4_forward.c b/net/ipforward/ipv4_forward.c index 37db9938e8..8c4f2724d2 100644 --- a/net/ipforward/ipv4_forward.c +++ b/net/ipforward/ipv4_forward.c @@ -163,6 +163,7 @@ static int ipv4_decr_ttl(FAR struct ipv4_hdr_s *ipv4) { #ifdef CONFIG_NET_ICMP /* Return an ICMP error packet back to the sender. */ + # warning Missing logic #endif @@ -488,6 +489,7 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) */ /* Correct dev->d_buf by adding back the L1 header length */ + #endif nwarn("WARNING: Packet forwarding to same device not supportedN\n"); diff --git a/net/ipforward/ipv6_forward.c b/net/ipforward/ipv6_forward.c index 83c5e83a74..0622e5fbce 100644 --- a/net/ipforward/ipv6_forward.c +++ b/net/ipforward/ipv6_forward.c @@ -159,6 +159,7 @@ static int ipv6_decr_ttl(FAR struct ipv6_hdr_s *ipv6) { #ifdef CONFIG_NET_ICMPv6 /* Return an ICMPv6 error packet back to the sender. */ + # warning Missing logic #endif @@ -635,6 +636,7 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6) */ /* Correct dev->d_buf by adding back the L1 header length */ + #endif /* Nothing other 6LoWPAN forwarding is currently handled and that diff --git a/net/local/local_recvfrom.c b/net/local/local_recvfrom.c index 1697182e7f..6f4444a400 100644 --- a/net/local/local_recvfrom.c +++ b/net/local/local_recvfrom.c @@ -369,12 +369,14 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, return readlen; errout_with_infd: + /* Close the read-only file descriptor */ file_close(&conn->lc_infile); conn->lc_infile.f_inode = NULL; errout_with_halfduplex: + /* Release our reference to the half duplex FIFO */ (void)local_release_halfduplex(conn); diff --git a/net/local/local_sendto.c b/net/local/local_sendto.c index 4ee0914ec2..63c2ea7d48 100644 --- a/net/local/local_sendto.c +++ b/net/local/local_sendto.c @@ -168,6 +168,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf, conn->lc_outfile.f_inode = NULL; errout_with_halfduplex: + /* Release our reference to the half duplex FIFO */ (void)local_release_halfduplex(conn); diff --git a/net/local/local_sockif.c b/net/local/local_sockif.c index 04e6d0ab85..bf5508be3a 100644 --- a/net/local/local_sockif.c +++ b/net/local/local_sockif.c @@ -553,6 +553,7 @@ static int local_connect(FAR struct socket *psock, case SOCK_DGRAM: { /* Perform the datagram connection logic */ + #warning Missing logic return -ENOSYS; @@ -697,6 +698,7 @@ static ssize_t local_send(FAR struct socket *psock, FAR const void *buf, case SOCK_DGRAM: { /* Local UDP packet send */ + #warning Missing logic ret = -ENOSYS; diff --git a/net/mld/mld_send.c b/net/mld/mld_send.c index 12a210b362..54cba6a1c2 100644 --- a/net/mld/mld_send.c +++ b/net/mld/mld_send.c @@ -171,6 +171,7 @@ void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group, mlderr("Bad msgtype: %02x \n", msgtype); DEBUGPANIC(); } + return; } diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 6b1c4a7b9f..b79e0fd5e0 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -224,7 +224,8 @@ static int ioctl_add_ipv6route(FAR struct rtentry *rtentry) net_ipv6addr_copy(router, in6addr_any.s6_addr16); } - return net_addroute_ipv6(target->sin6_addr.s6_addr16, netmask->sin6_addr.s6_addr16, router); + return net_addroute_ipv6(target->sin6_addr.s6_addr16, + netmask->sin6_addr.s6_addr16, router); } #endif /* HAVE_WRITABLE_IPv6ROUTE */ @@ -1553,18 +1554,21 @@ ssize_t net_ioctl_arglen(int cmd) return sizeof(struct iwreq); } # endif + # ifdef CONFIG_WIRELESS_IEEE802154 if (_MAC802154IOCVALID(cmd)) { return sizeof(struct ieee802154_netmac_s); } # endif + # ifdef CONFIG_WIRELESS_PKTRADIO if (WL_ISPKTRADIOCMD(cmd)) { return sizeof(struct pktradio_ifreq_s); } # endif + # ifdef CONFIG_WIRELESS_BLUETOOTH if (WL_IBLUETOOTHCMD(cmd)) { @@ -1572,6 +1576,7 @@ ssize_t net_ioctl_arglen(int cmd) } # endif #endif + return -ENOTTY; } } diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index 54321cb5a5..ec1d227783 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -425,9 +425,12 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) #if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_DRIVERS_IEEE80211) ninfo("Registered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n", - dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1], - dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3], - dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5], + dev->d_mac.ether.ether_addr_octet[0], + dev->d_mac.ether.ether_addr_octet[1], + dev->d_mac.ether.ether_addr_octet[2], + dev->d_mac.ether.ether_addr_octet[3], + dev->d_mac.ether.ether_addr_octet[4], + dev->d_mac.ether.ether_addr_octet[5], dev->d_ifname); #else ninfo("Registered dev: %s\n", dev->d_ifname); @@ -437,4 +440,3 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) return -EINVAL; } - diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c index 1fa5048e29..286d3517f2 100644 --- a/net/netlink/netlink_sockif.c +++ b/net/netlink/netlink_sockif.c @@ -550,6 +550,7 @@ static int netlink_close(FAR struct socket *psock) if (conn->crefs <= 1) { /* Yes... inform user-space daemon of socket close. */ + #warning Missing logic /* Free the connection structure */ diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c index 301b637210..0f5d630d35 100644 --- a/net/procfs/net_procfs.c +++ b/net/procfs/net_procfs.c @@ -299,6 +299,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer, switch (priv->entry) { case NETPROCFS_SUBDIR_DEV: + /* Show device-specific statistics */ nreturned = netprocfs_read_devstats(priv, buffer, buflen); @@ -306,6 +307,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer, #ifdef CONFIG_NET_STATISTICS case NETPROCFS_SUBDIR_STAT: + /* Show the network layer statistics */ nreturned = netprocfs_read_netstats(priv, buffer, buflen); @@ -313,6 +315,7 @@ static ssize_t netprocfs_read(FAR struct file *filep, FAR char *buffer, #ifdef CONFIG_NET_MLD case NETPROCFS_SUBDIR_MLD: + /* Show the MLD statistics */ nreturned = netprocfs_read_mldstats(priv, buffer, buflen); @@ -362,7 +365,8 @@ static int netprocfs_dup(FAR const struct file *oldp, FAR struct file *newp) /* Allocate a new container to hold the task and attribute selection */ - newpriv = (FAR struct netprocfs_file_s *)kmm_zalloc(sizeof(struct netprocfs_file_s)); + newpriv = (FAR struct netprocfs_file_s *) + kmm_zalloc(sizeof(struct netprocfs_file_s)); if (!newpriv) { ferr("ERROR: Failed to allocate file attributes\n"); diff --git a/net/procfs/net_procfs_route.c b/net/procfs/net_procfs_route.c index d45a18c1d8..7da4c6c2ef 100644 --- a/net/procfs/net_procfs_route.c +++ b/net/procfs/net_procfs_route.c @@ -638,6 +638,7 @@ static int route_opendir(FAR const char *relpath, return -ENOTDIR; } #endif + #ifdef CONFIG_NET_IPv6 if (strcmp(relpath, g_route_ipv6_path) == 0) { diff --git a/net/sixlowpan/sixlowpan_hc06.c b/net/sixlowpan/sixlowpan_hc06.c index e9c260f40a..843e95ec42 100644 --- a/net/sixlowpan/sixlowpan_hc06.c +++ b/net/sixlowpan/sixlowpan_hc06.c @@ -241,8 +241,9 @@ static FAR struct sixlowpan_addrcontext_s * net_ipv6addr_prefixcmp(&g_hc06_addrcontexts[i].prefix, ipaddr, 64)) { ninfo("Context found for ipaddr=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x Context: %d\n", - ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), ntohs(ipaddr[3]), - ntohs(ipaddr[4]), ntohs(ipaddr[5]), ntohs(ipaddr[6]), ntohs(ipaddr[7]), + ntohs(ipaddr[0]), ntohs(ipaddr[1]), ntohs(ipaddr[2]), + ntohs(ipaddr[3]), ntohs(ipaddr[4]), ntohs(ipaddr[5]), + ntohs(ipaddr[6]), ntohs(ipaddr[7]), g_hc06_addrcontexts[i].number); return &g_hc06_addrcontexts[i]; @@ -1406,6 +1407,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio, switch (*g_hc06ptr & SIXLOWPAN_NHC_UDP_CS_P_11) { case SIXLOWPAN_NHC_UDP_CS_P_00: + /* 1 byte for NHC, 4 byte for ports, 2 bytes chksum */ memcpy(&udp->srcport, g_hc06ptr + 1, 2); @@ -1418,6 +1420,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio, break; case SIXLOWPAN_NHC_UDP_CS_P_01: + /* 1 byte for NHC + source 16bit inline, dest = 0xF0 + 8 bit * inline */ @@ -1435,6 +1438,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio, break; case SIXLOWPAN_NHC_UDP_CS_P_10: + /* 1 byte for NHC + source = 0xF0 + 8bit inline, dest = 16 bit * inline */ @@ -1452,6 +1456,7 @@ void sixlowpan_uncompresshdr_hc06(FAR struct radio_driver_s *radio, break; case SIXLOWPAN_NHC_UDP_CS_P_11: + /* 1 byte for NHC, 1 byte for ports */ udp->srcport = diff --git a/net/sixlowpan/sixlowpan_input.c b/net/sixlowpan/sixlowpan_input.c index 099cdb1c70..59c2ab8d9f 100644 --- a/net/sixlowpan/sixlowpan_input.c +++ b/net/sixlowpan/sixlowpan_input.c @@ -342,7 +342,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio, if (fragsize > CONFIG_NET_6LOWPAN_PKTSIZE) { - nwarn("WARNING: Reassembled packet size exeeds CONFIG_NET_6LOWPAN_PKTSIZE\n"); + nwarn("WARNING: Reassembled packet size exceeds " + "CONFIG_NET_6LOWPAN_PKTSIZE\n"); return -ENOSPC; } @@ -448,7 +449,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio, hc1 = fptr + g_frame_hdrlen; #ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06 - if ((hc1[SIXLOWPAN_HC1_DISPATCH] & SIXLOWPAN_DISPATCH_IPHC_MASK) == SIXLOWPAN_DISPATCH_IPHC) + if ((hc1[SIXLOWPAN_HC1_DISPATCH] & SIXLOWPAN_DISPATCH_IPHC_MASK) == + SIXLOWPAN_DISPATCH_IPHC) { ninfo("IPHC Dispatch\n"); sixlowpan_uncompresshdr_hc06(radio, metadata, fragsize, iob, fptr, bptr); diff --git a/net/sixlowpan/sixlowpan_send.c b/net/sixlowpan/sixlowpan_send.c index 94bf97aeb4..16ec94466a 100644 --- a/net/sixlowpan/sixlowpan_send.c +++ b/net/sixlowpan/sixlowpan_send.c @@ -220,6 +220,7 @@ static uint16_t send_eventhandler(FAR struct net_driver_s *dev, return flags; end_wait: + /* Do not allow any further callbacks */ sinfo->s_cb->flags = 0; diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index c4c988d497..129b0d034e 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -603,6 +603,7 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev, return flags; end_wait: + /* Do not allow any further callbacks */ sinfo->s_cb->flags = 0; diff --git a/net/sixlowpan/sixlowpan_utils.c b/net/sixlowpan/sixlowpan_utils.c index 42538bf72e..d7ffadeab4 100644 --- a/net/sixlowpan/sixlowpan_utils.c +++ b/net/sixlowpan/sixlowpan_utils.c @@ -704,7 +704,7 @@ int sixlowpan_extract_srcaddr(FAR struct radio_driver_s *radio, { srcaddr->nv_addrlen = NET_6LOWPAN_EADDRSIZE; memcpy(srcaddr->nv_addr, ind->src.eaddr, NET_6LOWPAN_EADDRSIZE); - } + } return OK; } diff --git a/net/socket/getpeername.c b/net/socket/getpeername.c index 2ec97f2284..0988032080 100644 --- a/net/socket/getpeername.c +++ b/net/socket/getpeername.c @@ -91,7 +91,8 @@ * ****************************************************************************/ -int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, FAR socklen_t *addrlen) +int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, + FAR socklen_t *addrlen) { /* Verify that the psock corresponds to valid, allocated socket */ diff --git a/net/socket/getsockname.c b/net/socket/getsockname.c index 2647edf54f..d2672781fe 100644 --- a/net/socket/getsockname.c +++ b/net/socket/getsockname.c @@ -91,7 +91,8 @@ * ****************************************************************************/ -int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, FAR socklen_t *addrlen) +int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, + FAR socklen_t *addrlen) { /* Verify that the psock corresponds to valid, allocated socket */ diff --git a/net/socket/net_vfcntl.c b/net/socket/net_vfcntl.c index 341bee2522..bf61c65e13 100644 --- a/net/socket/net_vfcntl.c +++ b/net/socket/net_vfcntl.c @@ -204,45 +204,51 @@ int psock_vfcntl(FAR struct socket *psock, int cmd, va_list ap) break; case F_GETOWN: - /* If fd refers to a socket, get the process or process group ID specified - * to receive SIGURG signals when out-of-band data is available. Positive values - * indicate a process ID; negative values, other than -1, indicate a process group - * ID. If fd does not refer to a socket, the results are unspecified. + /* If fd refers to a socket, get the process or process group ID + * specified to receive SIGURG signals when out-of-band data is + * available. Positive values indicate a process ID; negative + * values, other than -1, indicate a process group ID. If fd does + * not refer to a socket, the results are unspecified. */ case F_SETOWN: - /* If fd refers to a socket, set the process or process group ID specified - * to receive SIGURG signals when out-of-band data is available, using the value - * of the third argument, arg, taken as type int. Positive values indicate a - * process ID; negative values, other than -1, indicate a process group ID. If - * fd does not refer to a socket, the results are unspecified. + /* If fd refers to a socket, set the process or process group ID + * specified to receive SIGURG signals when out-of-band data is + * available, using the value of the third argument, arg, taken as + * type int. Positive values indicate a process ID; negative values, + * other than -1, indicate a process group ID. If fd does not refer + * to a socket, the results are unspecified. */ case F_GETLK: - /* Get the first lock which blocks the lock description pointed to by the third - * argument, arg, taken as a pointer to type struct flock, defined in . - * The information retrieved shall overwrite the information passed to fcntl() in - * the structure flock. If no lock is found that would prevent this lock from being - * created, then the structure shall be left unchanged except for the lock type - * which shall be set to F_UNLCK. + /* Get the first lock which blocks the lock description pointed to + * by the third argument, arg, taken as a pointer to type struct + * flock, defined in . The information retrieved shall + * overwrite the information passed to fcntl() in the structure + * flock. If no lock is found that would prevent this lock from + * being created, then the structure shall be left unchanged except + * for the lock type which shall be set to F_UNLCK. */ case F_SETLK: - /* Set or clear a file segment lock according to the lock description pointed to - * by the third argument, arg, taken as a pointer to type struct flock, defined in - * . F_SETLK can establish shared (or read) locks (F_RDLCK) or exclusive - * (or write) locks (F_WRLCK), as well as to remove either type of lock (F_UNLCK). - * F_RDLCK, F_WRLCK, and F_UNLCK are defined in . If a shared or exclusive - * lock cannot be set, fcntl() shall return immediately with a return value of -1. + /* Set or clear a file segment lock according to the lock + * description pointed to by the third argument, arg, taken as a + * pointer to type struct flock, defined in . F_SETLK can + * establish shared (or read) locks (F_RDLCK) or exclusive (or + * write) locks (F_WRLCK), as well as to remove either type of + * lock (F_UNLCK). F_RDLCK, F_WRLCK, and F_UNLCK are defined in + * . If a shared or exclusive lock cannot be set, fcntl() + * shall return immediately with a return value of -1. */ case F_SETLKW: - /* This command shall be equivalent to F_SETLK except that if a shared or exclusive - * lock is blocked by other locks, the thread shall wait until the request can be - * satisfied. If a signal that is to be caught is received while fcntl() is waiting - * for a region, fcntl() shall be interrupted. Upon return from the signal handler, - * fcntl() shall return -1 with errno set to [EINTR], and the lock operation shall - * not be done. + /* This command shall be equivalent to F_SETLK except that if a + * shared or exclusive lock is blocked by other locks, the thread + * shall wait until the request can be satisfied. If a signal that + * is to be caught is received while fcntl() is waiting for a + * region, fcntl() shall be interrupted. Upon return from the signal + * handler, fcntl() shall return -1 with errno set to [EINTR], and + * the lock operation shall not be done. */ ret = -ENOSYS; /* F_GETOWN, F_SETOWN, F_GETLK, F_SETLK, F_SETLKW */ diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 7443e9b779..0b9ce982fb 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -287,6 +287,7 @@ static void tcp_input(FAR struct net_driver_s *dev, uint8_t domain, break; } + i += dev->d_buf[hdrlen + 1 + i]; } } @@ -703,6 +704,7 @@ found: break; } + i += dev->d_buf[hdrlen + 1 + i]; } } diff --git a/net/tcp/tcp_timer.c b/net/tcp/tcp_timer.c index b38a3877e1..f9c901e494 100644 --- a/net/tcp/tcp_timer.c +++ b/net/tcp/tcp_timer.c @@ -310,6 +310,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, switch (conn->tcpstateflags & TCP_STATE_MASK) { case TCP_SYN_RCVD: + /* In the SYN_RCVD state, we should retransmit our * SYNACK. */ @@ -318,12 +319,14 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, goto done; case TCP_SYN_SENT: + /* In the SYN_SENT state, we retransmit out SYN. */ tcp_ack(dev, conn, TCP_SYN); goto done; case TCP_ESTABLISHED: + /* In the ESTABLISHED state, we call upon the application * to do the actual retransmit after which we jump into * the code for sending out the packet. @@ -336,6 +339,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, case TCP_FIN_WAIT_1: case TCP_CLOSING: case TCP_LAST_ACK: + /* In all these states we should retransmit a FINACK. */ tcp_send(dev, conn, TCP_FIN | TCP_ACK, hdrlen); @@ -467,6 +471,7 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, } } #endif + /* There was no need for a retransmission and there was no * need to probe the remote peer. We poll the application for * new outgoing data. diff --git a/net/tcp/tcp_txdrain.c b/net/tcp/tcp_txdrain.c index 781f3707e6..552c631283 100644 --- a/net/tcp/tcp_txdrain.c +++ b/net/tcp/tcp_txdrain.c @@ -159,20 +159,20 @@ int tcp_txdrain(FAR struct socket *psock, ret = tcp_disconnect_notifier_setup(txdrain_worker, conn, &waitsem); - /* Zero is a special value that means that no connection has been - * established. Otherwise it is a special 'key' that can be used - * to teardown the notification later - */ + /* Zero is a special value that means that no connection has been + * established. Otherwise it is a special 'key' that can be used + * to teardown the notification later + */ - if (ret > 0) - { - /* Save the disconnect key */ + if (ret > 0) + { + /* Save the disconnect key */ - int disconn_key = ret; + int disconn_key = ret; - /* There is pending write data and the socket is connected.. - * wait for it to drain or be be disconnected. - */ + /* There is pending write data and the socket is connected.. + * wait for it to drain or be be disconnected. + */ do { diff --git a/net/udp/udp_callback.c b/net/udp/udp_callback.c index 2f11037dc8..e6b38b9598 100644 --- a/net/udp/udp_callback.c +++ b/net/udp/udp_callback.c @@ -76,7 +76,8 @@ ****************************************************************************/ #ifdef CONFIG_NET_UDP_READAHEAD -static uint16_t udp_datahandler(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn, +static uint16_t udp_datahandler(FAR struct net_driver_s *dev, + FAR struct udp_conn_s *conn, FAR uint8_t *buffer, uint16_t buflen) { FAR struct iob_s *iob; @@ -87,12 +88,14 @@ static uint16_t udp_datahandler(FAR struct net_driver_s *dev, FAR struct udp_con 0 }; #endif + #ifdef CONFIG_NET_IPv4 FAR struct sockaddr_in src_addr4 = { 0 }; #endif + FAR void *src_addr; uint8_t src_addr_size; diff --git a/net/udp/udp_psock_sendto_unbuffered.c b/net/udp/udp_psock_sendto_unbuffered.c index 2b280fb2a2..218dbe0607 100644 --- a/net/udp/udp_psock_sendto_unbuffered.c +++ b/net/udp/udp_psock_sendto_unbuffered.c @@ -561,6 +561,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, ret = state.st_sndlen; errout_with_lock: + /* Release the semaphore */ nxsem_destroy(&state.st_sem); diff --git a/net/usrsock/usrsock_accept.c b/net/usrsock/usrsock_accept.c index 70ac45b41f..6a2261859a 100644 --- a/net/usrsock/usrsock_accept.c +++ b/net/usrsock/usrsock_accept.c @@ -160,6 +160,7 @@ static int do_accept_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_accept_s req = { }; + struct iovec bufs[1]; if (addrlen > UINT16_MAX) @@ -233,6 +234,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, struct usrsock_data_reqstate_s state = { }; + FAR struct usrsock_conn_s *newconn; struct iovec inbufs[2]; socklen_t inaddrlen = 0; diff --git a/net/usrsock/usrsock_bind.c b/net/usrsock/usrsock_bind.c index 67f5944b2a..829c81edfd 100644 --- a/net/usrsock/usrsock_bind.c +++ b/net/usrsock/usrsock_bind.c @@ -112,6 +112,7 @@ static int do_bind_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_bind_s req = { }; + struct iovec bufs[2]; /* Prepare request for daemon to read. */ @@ -170,6 +171,7 @@ int usrsock_bind(FAR struct socket *psock, struct usrsock_reqstate_s state = { }; + ssize_t ret; DEBUGASSERT(conn); diff --git a/net/usrsock/usrsock_close.c b/net/usrsock/usrsock_close.c index e0486930d9..a672eee964 100644 --- a/net/usrsock/usrsock_close.c +++ b/net/usrsock/usrsock_close.c @@ -111,6 +111,7 @@ static int do_close_request(FAR struct usrsock_conn_s *conn) struct usrsock_request_close_s req = { }; + struct iovec bufs[1]; /* Prepare request for daemon to read. */ @@ -140,6 +141,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn) struct usrsock_reqstate_s state = { }; + int ret; net_lock(); diff --git a/net/usrsock/usrsock_connect.c b/net/usrsock/usrsock_connect.c index 344c476f0c..7d0fccb52b 100644 --- a/net/usrsock/usrsock_connect.c +++ b/net/usrsock/usrsock_connect.c @@ -112,6 +112,7 @@ static int do_connect_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_connect_s req = { }; + struct iovec bufs[2]; if (addrlen > UINT16_MAX) @@ -162,6 +163,7 @@ int usrsock_connect(FAR struct socket *psock, struct usrsock_reqstate_s state = { }; + int ret; DEBUGASSERT(conn); diff --git a/net/usrsock/usrsock_getpeername.c b/net/usrsock/usrsock_getpeername.c index e058a8ea64..52f44425a7 100644 --- a/net/usrsock/usrsock_getpeername.c +++ b/net/usrsock/usrsock_getpeername.c @@ -123,6 +123,7 @@ static int do_getpeername_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_getpeername_s req = { }; + struct iovec bufs[1]; if (addrlen > UINT16_MAX) @@ -175,6 +176,7 @@ int usrsock_getpeername(FAR struct socket *psock, struct usrsock_data_reqstate_s state = { }; + struct iovec inbufs[1]; ssize_t ret; socklen_t outaddrlen = 0; diff --git a/net/usrsock/usrsock_getsockname.c b/net/usrsock/usrsock_getsockname.c index f4e218e571..6e4c295961 100644 --- a/net/usrsock/usrsock_getsockname.c +++ b/net/usrsock/usrsock_getsockname.c @@ -123,6 +123,7 @@ static int do_getsockname_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_getsockname_s req = { }; + struct iovec bufs[1]; if (addrlen > UINT16_MAX) @@ -175,6 +176,7 @@ int usrsock_getsockname(FAR struct socket *psock, struct usrsock_data_reqstate_s state = { }; + struct iovec inbufs[1]; ssize_t ret; socklen_t outaddrlen = 0; diff --git a/net/usrsock/usrsock_getsockopt.c b/net/usrsock/usrsock_getsockopt.c index 52c10d7a2c..c2c531f134 100644 --- a/net/usrsock/usrsock_getsockopt.c +++ b/net/usrsock/usrsock_getsockopt.c @@ -122,6 +122,7 @@ static int do_getsockopt_request(FAR struct usrsock_conn_s *conn, int level, struct usrsock_request_getsockopt_s req = { }; + struct iovec bufs[1]; if (level < INT16_MIN || level > INT16_MAX) @@ -189,6 +190,7 @@ int usrsock_getsockopt(FAR struct usrsock_conn_s *conn, int level, int option, struct usrsock_data_reqstate_s state = { }; + struct iovec inbufs[1]; ssize_t ret; diff --git a/net/usrsock/usrsock_ioctl.c b/net/usrsock/usrsock_ioctl.c index a95a34245c..b86680262e 100644 --- a/net/usrsock/usrsock_ioctl.c +++ b/net/usrsock/usrsock_ioctl.c @@ -122,6 +122,7 @@ static int do_ioctl_request(FAR struct usrsock_conn_s *conn, int cmd, struct usrsock_request_ioctl_s req = { }; + struct iovec bufs[2]; if (arglen > UINT16_MAX) @@ -168,6 +169,7 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg, struct usrsock_data_reqstate_s state = { }; + struct iovec inbufs[1]; int ret; diff --git a/net/usrsock/usrsock_listen.c b/net/usrsock/usrsock_listen.c index d4e5017629..296c9dfebe 100644 --- a/net/usrsock/usrsock_listen.c +++ b/net/usrsock/usrsock_listen.c @@ -105,6 +105,7 @@ static int do_listen_request(FAR struct usrsock_conn_s *conn, int backlog) struct usrsock_request_listen_s req = { }; + struct iovec bufs[1]; if (backlog > UINT16_MAX) @@ -160,6 +161,7 @@ int usrsock_listen(FAR struct socket *psock, int backlog) struct usrsock_reqstate_s state = { }; + int ret; DEBUGASSERT(conn); diff --git a/net/usrsock/usrsock_recvfrom.c b/net/usrsock/usrsock_recvfrom.c index a3db76f9b0..af2ea6fea8 100644 --- a/net/usrsock/usrsock_recvfrom.c +++ b/net/usrsock/usrsock_recvfrom.c @@ -166,6 +166,7 @@ static int do_recvfrom_request(FAR struct usrsock_conn_s *conn, size_t buflen, struct usrsock_request_recvfrom_s req = { }; + struct iovec bufs[1]; if (addrlen > UINT16_MAX) @@ -221,6 +222,7 @@ ssize_t usrsock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, struct usrsock_data_reqstate_s state = { }; + struct iovec inbufs[2]; socklen_t addrlen = 0; socklen_t outaddrlen = 0; diff --git a/net/usrsock/usrsock_sendto.c b/net/usrsock/usrsock_sendto.c index 75d1b63c51..53f8f51fd1 100644 --- a/net/usrsock/usrsock_sendto.c +++ b/net/usrsock/usrsock_sendto.c @@ -156,6 +156,7 @@ static int do_sendto_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_sendto_s req = { }; + struct iovec bufs[3]; if (addrlen > UINT16_MAX) @@ -216,6 +217,7 @@ ssize_t usrsock_sendto(FAR struct socket *psock, FAR const void *buf, struct usrsock_reqstate_s state = { }; + ssize_t ret; #ifdef CONFIG_NET_SOCKOPTS struct timespec abstime; diff --git a/net/usrsock/usrsock_setsockopt.c b/net/usrsock/usrsock_setsockopt.c index fe31a16f4a..e81bd8fb0c 100644 --- a/net/usrsock/usrsock_setsockopt.c +++ b/net/usrsock/usrsock_setsockopt.c @@ -114,6 +114,7 @@ static int do_setsockopt_request(FAR struct usrsock_conn_s *conn, struct usrsock_request_setsockopt_s req = { }; + struct iovec bufs[2]; if (level < INT16_MIN || level > INT16_MAX) @@ -180,6 +181,7 @@ int usrsock_setsockopt(FAR struct usrsock_conn_s *conn, int level, int option, struct usrsock_reqstate_s state = { }; + ssize_t ret; DEBUGASSERT(conn); diff --git a/net/usrsock/usrsock_socket.c b/net/usrsock/usrsock_socket.c index e0c4159e29..2262bc6107 100644 --- a/net/usrsock/usrsock_socket.c +++ b/net/usrsock/usrsock_socket.c @@ -121,6 +121,7 @@ static int do_socket_request(FAR struct usrsock_conn_s *conn, int domain, struct usrsock_request_socket_s req = { }; + struct iovec bufs[1]; /* Prepare request for daemon to read. */ @@ -200,6 +201,7 @@ int usrsock_socket(int domain, int type, int protocol, struct usrsock_reqstate_s state = { }; + FAR struct usrsock_conn_s *conn; int err; int ret; diff --git a/net/usrsock/usrsock_sockif.c b/net/usrsock/usrsock_sockif.c index a58441c199..4a83e88197 100644 --- a/net/usrsock/usrsock_sockif.c +++ b/net/usrsock/usrsock_sockif.c @@ -142,6 +142,7 @@ static int usrsock_sockif_setup(FAR struct socket *psock, int protocol) return -ENETDOWN; } #endif + #ifndef CONFIG_NET_USRSOCK_TCP if (type == SOCK_STREAM) {