aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-10 13:29:14 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:22:04 -0500
commitd83ca5accb256de1b44835cd222bfdc3207bd7dc (patch)
treec7be8b1f61d4403fe15bd279ecf9d52619134592 /net/dccp/ipv6.c
parentcf557926f6955b4c3fa55e81fdb3675e752e8eed (diff)
[DCCP]: Update code comments for Step 2/3
Sorts out the comments for processing steps 2,3 in section 8.5 of RFC 4340. All comments have been updated against this document, and the reference to step 2 has been made consistent throughout the files. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 19a4f763099d..201801e1532d 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -487,10 +487,10 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
487 /* 487 /*
488 * Step 3: Process LISTEN state 488 * Step 3: Process LISTEN state
489 * 489 *
490 * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookie 490 * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookie
491 * 491 *
492 * In fact we defer setting S.GSR, S.SWL, S.SWH to 492 * In fact we defer setting S.GSR, S.SWL, S.SWH to
493 * dccp_create_openreq_child. 493 * dccp_create_openreq_child.
494 */ 494 */
495 dreq = dccp_rsk(req); 495 dreq = dccp_rsk(req);
496 dreq->dreq_isr = dcb->dccpd_seq; 496 dreq->dreq_isr = dcb->dccpd_seq;
@@ -760,6 +760,30 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
760 return 0; 760 return 0;
761 } 761 }
762 762
763 /*
764 * Step 3: Process LISTEN state
765 * If S.state == LISTEN,
766 * If P.type == Request or P contains a valid Init Cookie option,
767 * (* Must scan the packet's options to check for Init
768 * Cookies. Only Init Cookies are processed here,
769 * however; other options are processed in Step 8. This
770 * scan need only be performed if the endpoint uses Init
771 * Cookies *)
772 * (* Generate a new socket and switch to that socket *)
773 * Set S := new socket for this port pair
774 * S.state = RESPOND
775 * Choose S.ISS (initial seqno) or set from Init Cookies
776 * Initialize S.GAR := S.ISS
777 * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookies
778 * Continue with S.state == RESPOND
779 * (* A Response packet will be generated in Step 11 *)
780 * Otherwise,
781 * Generate Reset(No Connection) unless P.type == Reset
782 * Drop packet and return
783 *
784 * NOTE: the check for the packet types is done in
785 * dccp_rcv_state_process
786 */
763 if (sk->sk_state == DCCP_LISTEN) { 787 if (sk->sk_state == DCCP_LISTEN) {
764 struct sock *nsk = dccp_v6_hnd_req(sk, skb); 788 struct sock *nsk = dccp_v6_hnd_req(sk, skb);
765 789
@@ -826,8 +850,6 @@ static int dccp_v6_rcv(struct sk_buff **pskb)
826 /* 850 /*
827 * Step 2: 851 * Step 2:
828 * If no socket ... 852 * If no socket ...
829 * Generate Reset(No Connection) unless P.type == Reset
830 * Drop packet and return
831 */ 853 */
832 if (sk == NULL) { 854 if (sk == NULL) {
833 dccp_pr_debug("failed to look up flow ID in table and " 855 dccp_pr_debug("failed to look up flow ID in table and "
@@ -857,6 +879,7 @@ no_dccp_socket:
857 goto discard_it; 879 goto discard_it;
858 /* 880 /*
859 * Step 2: 881 * Step 2:
882 * If no socket ...
860 * Generate Reset(No Connection) unless P.type == Reset 883 * Generate Reset(No Connection) unless P.type == Reset
861 * Drop packet and return 884 * Drop packet and return
862 */ 885 */