net: Fix minor coding problems
Fix minor problems when reading codes: - icmpv6_autoconfig: Call net_unlock before return - pkt_sendmsg: Return error for types other than SOCK_RAW Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
e0de25f82c
commit
5eb08a4b33
@ -363,6 +363,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
|
|||||||
ret = netdev_ipv6_add(dev, lladdr, net_ipv6_mask2pref(g_ipv6_llnetmask));
|
ret = netdev_ipv6_add(dev, lladdr, net_ipv6_mask2pref(g_ipv6_llnetmask));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
net_unlock();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||||||
|
|
||||||
/* Only SOCK_RAW is supported */
|
/* Only SOCK_RAW is supported */
|
||||||
|
|
||||||
if (psock->s_type == SOCK_RAW)
|
if (psock->s_type != SOCK_RAW)
|
||||||
{
|
{
|
||||||
/* EDESTADDRREQ. Signifies that the socket is not connection-mode and
|
/* EDESTADDRREQ. Signifies that the socket is not connection-mode and
|
||||||
* no peer address is set.
|
* no peer address is set.
|
||||||
|
Loading…
Reference in New Issue
Block a user