Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78570
b: refs/heads/master
c: d6de309
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Jan 28, 2008
1 parent a9c233a commit be2da26
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42e30bf3463cd37d73839376662cb79b4d5c416c
refs/heads/master: d6de3097592b7ae7f8e233a4dafb088e2aa8170f
1 change: 1 addition & 0 deletions trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ union sctp_params {
struct sctp_random_param *random;
struct sctp_chunks_param *chunks;
struct sctp_hmac_algo_param *hmac_algo;
struct sctp_addip_param *addip;
};

/* RFC 2960. Section 3.3.5 Heartbeat.
Expand Down
27 changes: 27 additions & 0 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,11 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
case SCTP_PARAM_SUPPORTED_EXT:
break;

case SCTP_PARAM_SET_PRIMARY:
if (sctp_addip_enable)
break;
goto fallthrough;

case SCTP_PARAM_HOST_NAME_ADDRESS:
/* Tell the peer, we won't support this param. */
sctp_process_hn_param(asoc, param, chunk, err_chunk);
Expand Down Expand Up @@ -2286,6 +2291,8 @@ static int sctp_process_param(struct sctp_association *asoc,
sctp_scope_t scope;
time_t stale;
struct sctp_af *af;
union sctp_addr_param *addr_param;
struct sctp_transport *t;

/* We maintain all INIT parameters in network byte order all the
* time. This allows us to not worry about whether the parameters
Expand Down Expand Up @@ -2376,6 +2383,26 @@ static int sctp_process_param(struct sctp_association *asoc,
asoc->peer.adaptation_ind = param.aind->adaptation_ind;
break;

case SCTP_PARAM_SET_PRIMARY:
addr_param = param.v + sizeof(sctp_addip_param_t);

af = sctp_get_af_specific(param_type2af(param.p->type));
af->from_addr_param(&addr, addr_param,
htons(asoc->peer.port), 0);

/* if the address is invalid, we can't process it.
* XXX: see spec for what to do.
*/
if (!af->addr_valid(&addr, NULL, NULL))
break;

t = sctp_assoc_lookup_paddr(asoc, &addr);
if (!t)
break;

sctp_assoc_set_primary(asoc, t);
break;

case SCTP_PARAM_SUPPORTED_EXT:
sctp_process_ext_param(asoc, param);
break;
Expand Down

0 comments on commit be2da26

Please sign in to comment.