Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41803
b: refs/heads/master
c: 09ef7fe
h: refs/heads/master
i:
  41801: 5f680a7
  41799: 8f5d22d
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 737c57e commit 52d5eb0
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30330ee00ce077de9d459c17125573ff618bd7a9
refs/heads/master: 09ef7fecea40c5e4c0dfe35bed3f0ed8da554cf5
8 changes: 4 additions & 4 deletions trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ struct sctp_chunk {
unsigned long sent_at;

/* What is the origin IP address for this chunk? */
union sctp_addr source;
union sctp_addr source_h;
/* Destination address for this chunk. */
union sctp_addr dest;

Expand Down Expand Up @@ -756,7 +756,7 @@ const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
/* This is a structure for holding either an IPv6 or an IPv4 address. */
struct sctp_sockaddr_entry {
struct list_head list;
union sctp_addr a;
union sctp_addr a_h;
__u8 use_as_src;
};

Expand Down Expand Up @@ -842,7 +842,7 @@ struct sctp_transport {
int dead;

/* This is the peer's IP address and port. */
union sctp_addr ipaddr;
union sctp_addr ipaddr_h;

/* These are the functions we call to handle LLP stuff. */
struct sctp_af *af_specific;
Expand Down Expand Up @@ -900,7 +900,7 @@ struct sctp_transport {
/* Destination */
struct dst_entry *dst;
/* Source address. */
union sctp_addr saddr;
union sctp_addr saddr_h;

/* When was the last time(in jiffies) that a data packet was sent on
* this transport? This is used to adjust the cwnd when the transport
Expand Down
30 changes: 15 additions & 15 deletions trunk/net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
asoc->peer.primary_path = transport;

/* Set a default msg_name for events. */
memcpy(&asoc->peer.primary_addr, &transport->ipaddr,
memcpy(&asoc->peer.primary_addr, &transport->ipaddr_h,
sizeof(union sctp_addr));

/* If the primary path is changing, assume that the
Expand Down Expand Up @@ -487,8 +487,8 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,
SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_rm_peer:association %p addr: ",
" port: %d\n",
asoc,
(&peer->ipaddr),
peer->ipaddr.v4.sin_port);
(&peer->ipaddr_h),
peer->ipaddr_h.v4.sin_port);

/* If we are to remove the current retran_path, update it
* to the next peer before removing this peer from the list.
Expand Down Expand Up @@ -669,7 +669,7 @@ void sctp_assoc_del_peer(struct sctp_association *asoc,

list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
transport = list_entry(pos, struct sctp_transport, transports);
if (sctp_cmp_addr_exact(addr, &transport->ipaddr)) {
if (sctp_cmp_addr_exact(addr, &transport->ipaddr_h)) {
/* Do book keeping for removing the peer and free it. */
sctp_assoc_rm_peer(asoc, transport);
break;
Expand All @@ -689,7 +689,7 @@ struct sctp_transport *sctp_assoc_lookup_paddr(

list_for_each(pos, &asoc->peer.transport_addr_list) {
t = list_entry(pos, struct sctp_transport, transports);
if (sctp_cmp_addr_exact(address, &t->ipaddr))
if (sctp_cmp_addr_exact(address, &t->ipaddr_h))
return t;
}

Expand Down Expand Up @@ -733,7 +733,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
* user.
*/
memset(&addr, 0, sizeof(struct sockaddr_storage));
flip_to_n((union sctp_addr *)&addr, &transport->ipaddr);
flip_to_n((union sctp_addr *)&addr, &transport->ipaddr_h);
event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
0, spc_state, error, GFP_ATOMIC);
if (event)
Expand Down Expand Up @@ -1043,8 +1043,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
/* Remove any peer addresses not present in the new association. */
list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
trans = list_entry(pos, struct sctp_transport, transports);
if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr))
sctp_assoc_del_peer(asoc, &trans->ipaddr);
if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr_h))
sctp_assoc_del_peer(asoc, &trans->ipaddr_h);
}

/* If the case is A (association restart), use
Expand All @@ -1067,8 +1067,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
list_for_each(pos, &new->peer.transport_addr_list) {
trans = list_entry(pos, struct sctp_transport,
transports);
if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr))
sctp_assoc_add_peer(asoc, &trans->ipaddr,
if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr_h))
sctp_assoc_add_peer(asoc, &trans->ipaddr_h,
GFP_ATOMIC, trans->state);
}

Expand Down Expand Up @@ -1136,8 +1136,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
" %p addr: ",
" port: %d\n",
asoc,
(&t->ipaddr),
t->ipaddr.v4.sin_port);
(&t->ipaddr_h),
t->ipaddr_h.v4.sin_port);
}

/* Choose the transport for sending a INIT packet. */
Expand All @@ -1161,8 +1161,8 @@ struct sctp_transport *sctp_assoc_choose_init_transport(
" %p addr: ",
" port: %d\n",
asoc,
(&t->ipaddr),
t->ipaddr.v4.sin_port);
(&t->ipaddr_h),
t->ipaddr_h.v4.sin_port);

return t;
}
Expand Down Expand Up @@ -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
* the endpoint.
*/
scope = sctp_scope(&asoc->peer.active_path->ipaddr);
scope = sctp_scope(&asoc->peer.active_path->ipaddr_h);
flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
if (asoc->peer.ipv4_address)
flags |= SCTP_ADDR4_PEERSUPP;
Expand Down
22 changes: 11 additions & 11 deletions trunk/net/sctp/bind_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
/* Extract the addresses which are relevant for this scope. */
list_for_each(pos, &src->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
error = sctp_copy_one_addr(dest, &addr->a, scope,
error = sctp_copy_one_addr(dest, &addr->a_h, scope,
gfp, flags);
if (error < 0)
goto out;
Expand All @@ -91,7 +91,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
list_for_each(pos, &src->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry,
list);
error = sctp_copy_one_addr(dest, &addr->a,
error = sctp_copy_one_addr(dest, &addr->a_h,
SCTP_SCOPE_LINK, gfp,
flags);
if (error < 0)
Expand Down Expand Up @@ -155,13 +155,13 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
if (!addr)
return -ENOMEM;

memcpy(&addr->a, new, sizeof(*new));
memcpy(&addr->a_h, new, sizeof(*new));

/* Fix up the port if it has not yet been set.
* Both v4 and v6 have the port at the same offset.
*/
if (!addr->a.v4.sin_port)
addr->a.v4.sin_port = bp->port;
if (!addr->a_h.v4.sin_port)
addr->a_h.v4.sin_port = bp->port;

addr->use_as_src = use_as_src;

Expand All @@ -182,7 +182,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)

list_for_each_safe(pos, temp, &bp->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
if (sctp_cmp_addr_exact(&addr->a_h, del_addr)) {
/* Found the exact match. */
list_del(pos);
kfree(addr);
Expand Down Expand Up @@ -237,8 +237,8 @@ union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,

list_for_each(pos, &bp->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
af = sctp_get_af_specific(addr->a.v4.sin_family);
len = af->to_addr_param(&addr->a, &rawaddr);
af = sctp_get_af_specific(addr->a_h.v4.sin_family);
len = af->to_addr_param(&addr->a_h, &rawaddr);
memcpy(addrparms.v, &rawaddr, len);
addrparms.v += len;
addrparms_len += len;
Expand Down Expand Up @@ -305,7 +305,7 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,

list_for_each(pos, &bp->address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
if (opt->pf->cmp_addr(&laddr->a, addr, opt))
if (opt->pf->cmp_addr(&laddr->a_h, addr, opt))
return 1;
}

Expand Down Expand Up @@ -339,13 +339,13 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
return NULL;
flip_to_h(&tmp, addr);

if (opt->pf->cmp_addr(&laddr->a, &tmp, opt))
if (opt->pf->cmp_addr(&laddr->a_h, &tmp, opt))
break;

addr_buf += af->sockaddr_len;
}
if (i == addrcnt)
return &laddr->a;
return &laddr->a_h;
}

return NULL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sctp/endpointola.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
bp = &ep->base.bind_addr;
list_for_each(pos, &bp->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
if (sctp_has_association(&addr->a, paddr)) {
if (sctp_has_association(&addr->a_h, paddr)) {
sctp_read_unlock(&ep->base.addr_lock);
return 1;
}
Expand Down
24 changes: 12 additions & 12 deletions trunk/net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ 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
* and the source address from the transport.
*/
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_dst, &transport->ipaddr_h.v6.sin6_addr);
ipv6_addr_copy(&fl.fl6_src, &transport->saddr_h.v6.sin6_addr);

fl.fl6_flowlabel = np->flow_label;
IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
if (ipv6_addr_type(&fl.fl6_src) & IPV6_ADDR_LINKLOCAL)
fl.oif = transport->saddr.v6.sin6_scope_id;
fl.oif = transport->saddr_h.v6.sin6_scope_id;
else
fl.oif = sk->sk_bound_dev_if;
fl.fl_ip_sport = inet_sk(sk)->sport;
fl.fl_ip_dport = transport->ipaddr.v6.sin6_port;
fl.fl_ip_dport = transport->ipaddr_h.v6.sin6_port;

if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
Expand Down Expand Up @@ -290,11 +290,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
list_for_each(pos, &bp->address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
if ((laddr->use_as_src) &&
(laddr->a.sa.sa_family == AF_INET6) &&
(scope <= sctp_scope(&laddr->a))) {
bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
(laddr->a_h.sa.sa_family == AF_INET6) &&
(scope <= sctp_scope(&laddr->a_h))) {
bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a_h);
if (!baddr || (matchlen < bmatchlen)) {
baddr = &laddr->a;
baddr = &laddr->a_h;
matchlen = bmatchlen;
}
}
Expand Down Expand Up @@ -332,10 +332,10 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
/* Add the address to the local list. */
addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
if (addr) {
addr->a.v6.sin6_family = AF_INET6;
addr->a.v6.sin6_port = 0;
addr->a.v6.sin6_addr = ifp->addr;
addr->a.v6.sin6_scope_id = dev->ifindex;
addr->a_h.v6.sin6_family = AF_INET6;
addr->a_h.v6.sin6_port = 0;
addr->a_h.v6.sin6_addr = ifp->addr;
addr->a_h.v6.sin6_scope_id = dev->ifindex;
INIT_LIST_HEAD(&addr->list);
list_add_tail(&addr->list, addrlist);
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/sctp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
asoc = sctp_assoc(epb);
peer = asoc->peer.primary_path;
primary = &peer->saddr;
primary = &peer->saddr_h;
}

list_for_each(pos, &epb->bind_addr.address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
addr = (union sctp_addr *)&laddr->a;
addr = (union sctp_addr *)&laddr->a_h;
af = sctp_get_af_specific(addr->sa.sa_family);
if (primary && af->cmp_addr(addr, primary)) {
seq_printf(seq, "*");
Expand All @@ -180,7 +180,7 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
primary = &(assoc->peer.primary_addr);
list_for_each(pos, &assoc->peer.transport_addr_list) {
transport = list_entry(pos, struct sctp_transport, transports);
addr = (union sctp_addr *)&transport->ipaddr;
addr = (union sctp_addr *)&transport->ipaddr_h;
af = sctp_get_af_specific(addr->sa.sa_family);
if (af->cmp_addr(addr, primary)) {
seq_printf(seq, "*");
Expand Down
20 changes: 10 additions & 10 deletions trunk/net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
/* Add the address to the local list. */
addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
if (addr) {
addr->a.v4.sin_family = AF_INET;
addr->a.v4.sin_port = 0;
addr->a.v4.sin_addr.s_addr = ifa->ifa_local;
addr->a_h.v4.sin_family = AF_INET;
addr->a_h.v4.sin_port = 0;
addr->a_h.v4.sin_addr.s_addr = ifa->ifa_local;
list_add_tail(&addr->list, addrlist);
}
}
Expand Down Expand Up @@ -223,17 +223,17 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
sctp_spin_lock_irqsave(&sctp_local_addr_lock, flags);
list_for_each(pos, &sctp_local_addr_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
if (sctp_in_scope(&addr->a, scope)) {
if (sctp_in_scope(&addr->a_h, scope)) {
/* Now that the address is in scope, check to see if
* the address type is really supported by the local
* sock as well as the remote peer.
*/
if ((((AF_INET == addr->a.sa.sa_family) &&
if ((((AF_INET == addr->a_h.sa.sa_family) &&
(copy_flags & SCTP_ADDR4_PEERSUPP))) ||
(((AF_INET6 == addr->a.sa.sa_family) &&
(((AF_INET6 == addr->a_h.sa.sa_family) &&
(copy_flags & SCTP_ADDR6_ALLOWED) &&
(copy_flags & SCTP_ADDR6_PEERSUPP)))) {
error = sctp_add_bind_addr(bp, &addr->a, 1,
error = sctp_add_bind_addr(bp, &addr->a_h, 1,
GFP_ATOMIC);
if (error)
goto end_copy;
Expand Down Expand Up @@ -482,7 +482,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
if (!laddr->use_as_src)
continue;
sctp_v4_dst_saddr(&dst_saddr, dst, bp->port);
if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a_h))
goto out_unlock;
}
sctp_read_unlock(addr_lock);
Expand All @@ -502,8 +502,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);

if ((laddr->use_as_src) &&
(AF_INET == laddr->a.sa.sa_family)) {
fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
(AF_INET == laddr->a_h.sa.sa_family)) {
fl.fl4_src = laddr->a_h.v4.sin_addr.s_addr;
if (!ip_route_output_key(&rt, &fl)) {
dst = &rt->u.dst;
goto out_unlock;
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
void sctp_init_addrs(struct sctp_chunk *chunk, union sctp_addr *src,
union sctp_addr *dest)
{
memcpy(&chunk->source, src, sizeof(union sctp_addr));
memcpy(&chunk->source_h, src, sizeof(union sctp_addr));
memcpy(&chunk->dest, dest, sizeof(union sctp_addr));
}

Expand All @@ -1040,10 +1040,10 @@ const union sctp_addr *sctp_source(const struct sctp_chunk *chunk)
{
/* If we have a known transport, use that. */
if (chunk->transport) {
return &chunk->transport->ipaddr;
return &chunk->transport->ipaddr_h;
} else {
/* Otherwise, extract it from the IP header. */
return &chunk->source;
return &chunk->source_h;
}
}

Expand Down Expand Up @@ -2594,7 +2594,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
sctp_write_lock(&asoc->base.addr_lock);
list_for_each(pos, &bp->address_list) {
saddr = list_entry(pos, struct sctp_sockaddr_entry, list);
if (sctp_cmp_addr_exact(&saddr->a, &addr))
if (sctp_cmp_addr_exact(&saddr->a_h, &addr))
saddr->use_as_src = 1;
}
sctp_write_unlock(&asoc->base.addr_lock);
Expand Down
Loading

0 comments on commit 52d5eb0

Please sign in to comment.