Skip to content

Commit

Permalink
10375 uts: NULL pointer issues in ip module
Browse files Browse the repository at this point in the history
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Rob Johnston <rob.johnston@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome committed Feb 14, 2019
1 parent ba00d94 commit 63d2ef3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion usr/src/uts/common/inet/ip/ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -15104,7 +15104,7 @@ ip_get_zoneid_v4(ipaddr_t addr, mblk_t *mp, ip_recv_attr_t *ira,

if (lookup_zoneid != ALL_ZONES)
ire_flags |= MATCH_IRE_ZONEONLY;
ire = ire_ftable_lookup_v4(addr, NULL, NULL, IRE_LOCAL | IRE_LOOPBACK,
ire = ire_ftable_lookup_v4(addr, 0, 0, IRE_LOCAL | IRE_LOOPBACK,
NULL, lookup_zoneid, NULL, ire_flags, 0, ipst, NULL);
if (ire != NULL) {
zoneid = IP_REAL_ZONEID(ire->ire_zoneid, ipst);
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/inet/ip/ip6.c
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,7 @@ ip_set_destination_v6(in6_addr_t *src_addrp, const in6_addr_t *dst_addr,
}
if (!(ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE))) {
/* Get an nce to cache. */
nce = ire_to_nce(ire, NULL, firsthop);
nce = ire_to_nce(ire, 0, firsthop);
if (nce == NULL) {
/* Allocation failure? */
ixa->ixa_ire_generation = IRE_GENERATION_VERIFY;
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/inet/ip/ip6_ire.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ire_init_v6(ire_t *ire, const in6_addr_t *v6addr, const in6_addr_t *v6mask,

error = ire_init_common(ire, type, ill, zoneid, flags, IPV6_VERSION,
gc, ipst);
if (error != NULL)
if (error != 0)
return (error);

/* Determine which function pointers to use */
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/inet/ip/ip_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ ixa_check_drain_insert(conn_t *connp, ip_xmit_attr_t *ixa)

if (idd->idd_tx_fctl_df(idd->idd_tx_fctl_dh, cookie) == 0) {
DTRACE_PROBE1(ill__tx__not__blocked, uintptr_t, cookie);
} else if (idl_txl->txl_cookie != NULL &&
} else if (idl_txl->txl_cookie != (uintptr_t)NULL &&
idl_txl->txl_cookie != ixa->ixa_cookie) {
DTRACE_PROBE2(ill__tx__cookie__collision, uintptr_t, cookie,
uintptr_t, idl_txl->txl_cookie);
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/inet/ip/ip_ire.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ ire_init_v4(ire_t *ire, uchar_t *addr, uchar_t *mask, uchar_t *gateway,

error = ire_init_common(ire, type, ill, zoneid, flags, IPV4_VERSION,
gc, ipst);
if (error != NULL)
if (error != 0)
return (error);

/* Determine which function pointers to use */
Expand Down
6 changes: 3 additions & 3 deletions usr/src/uts/common/inet/ip/ip_netinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,18 +1092,18 @@ ip_routeto_impl(struct sockaddr *address, struct sockaddr *nexthop,
*/
if (ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
ire_refrele(ire);
return (NULL);
return ((uintptr_t)NULL);
}

nexthop_ire = ire_nexthop(ire);
if (nexthop_ire == NULL) {
ire_refrele(ire);
return (0);
return ((uintptr_t)NULL);
}
if (nexthop_ire->ire_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
ire_refrele(nexthop_ire);
ire_refrele(ire);
return (0);
return ((uintptr_t)NULL);
}

ASSERT(nexthop_ire->ire_ill != NULL);
Expand Down
5 changes: 3 additions & 2 deletions usr/src/uts/common/inet/sctp/sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ sctp_find_next_tq(sctp_t *sctp)
for (try = 0; try < sctps->sctps_recvq_tq_list_cur_sz; try++) {
tq = sctps->sctps_recvq_tq_list[next_tq];
if (taskq_dispatch(tq, sctp_process_recvq, sctp,
TQ_NOSLEEP) != NULL) {
TQ_NOSLEEP) != (uintptr_t)NULL) {
sctp->sctp_recvq_tq = tq;
return (B_TRUE);
}
Expand All @@ -1803,7 +1803,8 @@ sctp_find_next_tq(sctp_t *sctp)
*/
sctp_inc_taskq(sctps);
tq = sctps->sctps_recvq_tq_list[sctps->sctps_recvq_tq_list_cur_sz - 1];
if (taskq_dispatch(tq, sctp_process_recvq, sctp, TQ_NOSLEEP) != NULL) {
if (taskq_dispatch(tq, sctp_process_recvq, sctp, TQ_NOSLEEP) !=
(uintptr_t)NULL) {
sctp->sctp_recvq_tq = tq;
return (B_TRUE);
}
Expand Down

0 comments on commit 63d2ef3

Please sign in to comment.