Use macros in setsockopt handling of IP_PKTINFO

Changes setsockopt handling of IP_PKTINFO to use the provided macros.
This commit is contained in:
Nate Karstens 2023-05-10 09:58:30 -05:00
parent 147809861a
commit 4dd7e9f816

View File

@ -3541,9 +3541,9 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
case IP_PKTINFO:
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_UDP);
if (*(const int *)optval) {
sock->conn->flags |= NETCONN_FLAG_PKTINFO;
netconn_set_flags(sock->conn, NETCONN_FLAG_PKTINFO);
} else {
sock->conn->flags &= ~NETCONN_FLAG_PKTINFO;
netconn_clear_flags(sock->conn, NETCONN_FLAG_PKTINFO);
}
break;
#endif /* LWIP_NETBUF_RECVINFO */