提交 b3f5b3b6 编写于 作者: A Al Viro 提交者: David S. Miller

[SCTP]: Trivial ->ipaddr_h -> ->ipaddr conversions.

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 74af924a
...@@ -487,8 +487,8 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc, ...@@ -487,8 +487,8 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,
SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_rm_peer:association %p addr: ", SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_rm_peer:association %p addr: ",
" port: %d\n", " port: %d\n",
asoc, asoc,
(&peer->ipaddr_h), (&peer->ipaddr),
peer->ipaddr_h.v4.sin_port); ntohs(peer->ipaddr.v4.sin_port));
/* If we are to remove the current retran_path, update it /* If we are to remove the current retran_path, update it
* to the next peer before removing this peer from the list. * to the next peer before removing this peer from the list.
...@@ -1136,8 +1136,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) ...@@ -1136,8 +1136,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
" %p addr: ", " %p addr: ",
" port: %d\n", " port: %d\n",
asoc, asoc,
(&t->ipaddr_h), (&t->ipaddr),
t->ipaddr_h.v4.sin_port); ntohs(t->ipaddr.v4.sin_port));
} }
/* Choose the transport for sending a INIT packet. */ /* Choose the transport for sending a INIT packet. */
...@@ -1161,8 +1161,8 @@ struct sctp_transport *sctp_assoc_choose_init_transport( ...@@ -1161,8 +1161,8 @@ struct sctp_transport *sctp_assoc_choose_init_transport(
" %p addr: ", " %p addr: ",
" port: %d\n", " port: %d\n",
asoc, asoc,
(&t->ipaddr_h), (&t->ipaddr),
t->ipaddr_h.v4.sin_port); ntohs(t->ipaddr.v4.sin_port));
return t; return t;
} }
...@@ -1307,7 +1307,7 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, ...@@ -1307,7 +1307,7 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc,
/* Use scoping rules to determine the subset of addresses from /* Use scoping rules to determine the subset of addresses from
* the endpoint. * the endpoint.
*/ */
scope = sctp_scope(&asoc->peer.active_path->ipaddr_h); scope = sctp_scope(&asoc->peer.active_path->ipaddr);
flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0; flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
if (asoc->peer.ipv4_address) if (asoc->peer.ipv4_address)
flags |= SCTP_ADDR4_PEERSUPP; flags |= SCTP_ADDR4_PEERSUPP;
......
...@@ -161,7 +161,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, ...@@ -161,7 +161,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
/* Fill in the dest address from the route entry passed with the skb /* Fill in the dest address from the route entry passed with the skb
* and the source address from the transport. * and the source address from the transport.
*/ */
ipv6_addr_copy(&fl.fl6_dst, &transport->ipaddr_h.v6.sin6_addr); ipv6_addr_copy(&fl.fl6_dst, &transport->ipaddr.v6.sin6_addr);
ipv6_addr_copy(&fl.fl6_src, &transport->saddr.v6.sin6_addr); ipv6_addr_copy(&fl.fl6_src, &transport->saddr.v6.sin6_addr);
fl.fl6_flowlabel = np->flow_label; fl.fl6_flowlabel = np->flow_label;
......
...@@ -441,8 +441,8 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, ...@@ -441,8 +441,8 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p", SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
" transport IP: port:%d failed.\n", " transport IP: port:%d failed.\n",
asoc, asoc,
(&transport->ipaddr_h), (&transport->ipaddr),
transport->ipaddr_h.v4.sin_port); ntohs(transport->ipaddr.v4.sin_port));
sctp_assoc_control_transport(asoc, transport, sctp_assoc_control_transport(asoc, transport,
SCTP_TRANSPORT_DOWN, SCTP_TRANSPORT_DOWN,
SCTP_FAILED_THRESHOLD); SCTP_FAILED_THRESHOLD);
......
...@@ -3752,10 +3752,9 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len, ...@@ -3752,10 +3752,9 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len,
to = (void __user *)getaddrs.addrs; to = (void __user *)getaddrs.addrs;
list_for_each(pos, &asoc->peer.transport_addr_list) { list_for_each(pos, &asoc->peer.transport_addr_list) {
from = list_entry(pos, struct sctp_transport, transports); from = list_entry(pos, struct sctp_transport, transports);
memcpy(&temp, &from->ipaddr_h, sizeof(temp)); memcpy(&temp, &from->ipaddr, sizeof(temp));
sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len;
temp.v4.sin_port = htons(temp.v4.sin_port);
if (copy_to_user(to, &temp, addrlen)) if (copy_to_user(to, &temp, addrlen))
return -EFAULT; return -EFAULT;
to += addrlen ; to += addrlen ;
...@@ -3801,12 +3800,11 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, ...@@ -3801,12 +3800,11 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
list_for_each(pos, &asoc->peer.transport_addr_list) { list_for_each(pos, &asoc->peer.transport_addr_list) {
from = list_entry(pos, struct sctp_transport, transports); from = list_entry(pos, struct sctp_transport, transports);
memcpy(&temp, &from->ipaddr_h, sizeof(temp)); memcpy(&temp, &from->ipaddr, sizeof(temp));
sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len;
if(space_left < addrlen) if(space_left < addrlen)
return -ENOMEM; return -ENOMEM;
temp.v4.sin_port = htons(temp.v4.sin_port);
if (copy_to_user(to, &temp, addrlen)) if (copy_to_user(to, &temp, addrlen))
return -EFAULT; return -EFAULT;
to += addrlen; to += addrlen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册