Bug #10375
uts: NULL pointer issues in ip module
Start date:
2019-02-11
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Description
With NULL pointer, errors are reported while building ip module:
../../common/inet/sctp/sctp.c: In function 'sctp_find_next_tq': ../../common/inet/sctp/sctp.c:1791:19: error: comparison between pointer and integer [-Werror] TQ_NOSLEEP) != NULL) { ^~ ../../common/inet/sctp/sctp.c:1806:63: error: comparison between pointer and integer [-Werror] if (taskq_dispatch(tq, sctp_process_recvq, sctp, TQ_NOSLEEP) != NULL) { ^~ ../../common/inet/ip/ip_attr.c:1393:33: error: comparison between pointer and integer [-Werror] } else if (idl_txl->txl_cookie != NULL && ^~ ../../common/inet/ip/ip_ire.c: In function 'ire_init_v4': ../../common/inet/ip/ip_ire.c:546:12: error: comparison between pointer and integer [-Werror] if (error != NULL) ^~ ../../common/inet/ip/ip6_ire.c:129:12: error: comparison between pointer and integer [-Werror] if (error != NULL) ^~ ../../common/sys/null.h:32:14: error: passing argument 2 of 'ire_ftable_lookup_v4' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/inet/ip/ip.c:15107:35: note: in expansion of macro 'NULL' ire = ire_ftable_lookup_v4(addr, NULL, NULL, IRE_LOCAL | IRE_LOOPBACK, ^~~~ In file included from ../../common/inet/ip/ip.c:90:0: ../../common/inet/ip_ire.h:177:15: note: expected 'ipaddr_t {aka unsigned int}' but argument is of type 'void *' extern ire_t *ire_ftable_lookup_v4(ipaddr_t, ipaddr_t, ipaddr_t, int, ^~~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/sys/t_lock.h:38, from ../../common/sys/thread.h:36, from ../../common/sys/poll.h:101, from ../../common/sys/stream.h:42, from ../../common/inet/ip/ip.c:31: ../../common/sys/null.h:32:14: error: passing argument 3 of 'ire_ftable_lookup_v4' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/inet/ip/ip.c:15107:41: note: in expansion of macro 'NULL' ire = ire_ftable_lookup_v4(addr, NULL, NULL, IRE_LOCAL | IRE_LOOPBACK, ^~~~ In file included from ../../common/inet/ip/ip.c:90:0: ../../common/inet/ip_ire.h:177:15: note: expected 'ipaddr_t {aka unsigned int}' but argument is of type 'void *' extern ire_t *ire_ftable_lookup_v4(ipaddr_t, ipaddr_t, ipaddr_t, int, ^~~~~~~~~~~~~~~~~~~~ ../../common/inet/ip/ip_netinfo.c:1095:10: error: return makes integer from pointer without a cast [-Werror=int-conversion] return (NULL); ^ ../../common/inet/ip/ip6.c:2119:25: note: in expansion of macro 'NULL' nce = ire_to_nce(ire, NULL, firsthop); ^~~~ In file included from ../../common/inet/ip/ip6.c:84:0: ../../common/inet/ip_ire.h:302:15: note: expected 'ipaddr_t {aka unsigned int}' but argument is of type 'void *' extern nce_t *ire_to_nce(ire_t *, ipaddr_t, const in6_addr_t *); ^~~~~~~~~~ cc1: all warnings being treated as errors
History
Updated by Electric Monk 10 months ago
- % Done changed from 90 to 100
- Status changed from In Progress to Closed
git commit 63d2ef3c00e76c7c786265bc214c8746730ab635
commit 63d2ef3c00e76c7c786265bc214c8746730ab635 Author: Toomas Soome <tsoome@me.com> Date: 2019-02-14T19:33:33.000Z 10375 uts: NULL pointer issues in ip module Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Rob Johnston <rob.johnston@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>