Address another warnings reported by Patrick Laimbock when compiling

in userspace. While there, improve consistency.

MFC after: 1 week
This commit is contained in:
Michael Tuexen 2014-09-07 17:07:19 +00:00
parent 36d45b79de
commit 23602b60fb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271228
2 changed files with 15 additions and 29 deletions

View File

@ -2772,18 +2772,16 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
struct sctp_paramhdr tmp_param, *ph;
uint16_t plen, ptype;
struct sctp_ifa *sctp_ifa;
union sctp_sockstore store;
#ifdef INET6
struct sctp_ipv6addr_param addr6_store;
struct sockaddr_in6 sin6;
#endif
#ifdef INET
struct sctp_ipv4addr_param addr4_store;
struct sockaddr_in sin;
#endif
struct sockaddr *sa;
uint32_t vrf_id;
SCTPDBG(SCTP_DEBUG_ASCONF2, "processing init-ack addresses\n");
@ -2796,21 +2794,6 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
if ((offset + sizeof(struct sctp_paramhdr)) > length) {
return;
}
/* init the addresses */
#ifdef INET6
bzero(&sin6, sizeof(sin6));
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(sin6);
sin6.sin6_port = stcb->rport;
#endif
#ifdef INET
bzero(&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
sin.sin_port = stcb->rport;
#endif
/* go through the addresses in the init-ack */
ph = (struct sctp_paramhdr *)
sctp_m_getptr(m, offset, sizeof(struct sctp_paramhdr),
@ -2833,9 +2816,11 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
a6p == NULL) {
return;
}
memcpy(&sin6.sin6_addr, a6p->addr,
sizeof(struct in6_addr));
sa = (struct sockaddr *)&sin6;
memset(&store, 0, sizeof(union sctp_sockstore));
store.sin6.sin6_family = AF_INET6;
store.sin6.sin6_len = sizeof(struct sockaddr_in6);
store.sin6.sin6_port = stcb->rport;
memcpy(&store.sin6.sin6_addr, a6p->addr, sizeof(struct in6_addr));
break;
}
#endif
@ -2852,8 +2837,11 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
a4p == NULL) {
return;
}
sin.sin_addr.s_addr = a4p->addr;
sa = (struct sockaddr *)&sin;
memset(&store, 0, sizeof(union sctp_sockstore));
store.sin.sin_family = AF_INET;
store.sin.sin_len = sizeof(struct sockaddr_in);
store.sin.sin_port = stcb->rport;
store.sin.sin_addr.s_addr = a4p->addr;
break;
}
#endif
@ -2867,7 +2855,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
} else {
vrf_id = SCTP_DEFAULT_VRFID;
}
sctp_ifa = sctp_find_ifa_by_addr(sa, vrf_id,
sctp_ifa = sctp_find_ifa_by_addr(&store.sa, vrf_id,
SCTP_ADDR_NOT_LOCKED);
if (sctp_ifa == NULL) {
/* address doesn't exist anymore */
@ -2878,7 +2866,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
SCTP_PCB_FLAGS_DO_ASCONF)) &&
stcb->asoc.asconf_supported) {
/* queue an ASCONF DEL_IP_ADDRESS */
status = sctp_asconf_queue_sa_delete(stcb, sa);
status = sctp_asconf_queue_sa_delete(stcb, &store.sa);
/*
* if queued ok, and in correct state, send
* out the ASCONF.

View File

@ -593,8 +593,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
store.sin6.sin6_family = cp->heartbeat.hb_info.addr_family;
store.sin6.sin6_len = cp->heartbeat.hb_info.addr_len;
store.sin6.sin6_port = stcb->rport;
memcpy(&store.sin6.sin6_addr, cp->heartbeat.hb_info.address,
sizeof(store.sin6.sin6_addr));
memcpy(&store.sin6.sin6_addr, cp->heartbeat.hb_info.address, sizeof(struct in6_addr));
} else {
return;
}
@ -2262,8 +2261,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
store.sin6.sin6_family = AF_INET6;
store.sin6.sin6_len = sizeof(struct sockaddr_in6);
store.sin6.sin6_scope_id = cookie->scope_id;
memcpy(&store.sin6.sin6_addr, cookie->laddress,
sizeof(store.sin6.sin6_addr));
memcpy(&store.sin6.sin6_addr, cookie->laddress, sizeof(struct in6_addr));
break;
#endif
default: