@@ -46,11 +46,13 @@ static void dccp_v4_hash(struct sock *sk)
4646 inet_hash (& dccp_hashinfo , sk );
4747}
4848
49- static void dccp_v4_unhash (struct sock * sk )
49+ void dccp_unhash (struct sock * sk )
5050{
5151 inet_unhash (& dccp_hashinfo , sk );
5252}
5353
54+ EXPORT_SYMBOL_GPL (dccp_unhash );
55+
5456/* called with local bh disabled */
5557static int __dccp_v4_check_established (struct sock * sk , const __u16 lport ,
5658 struct inet_timewait_sock * * twp )
@@ -209,8 +211,7 @@ static int dccp_v4_hash_connect(struct sock *sk)
209211 }
210212}
211213
212- static int dccp_v4_connect (struct sock * sk , struct sockaddr * uaddr ,
213- int addr_len )
214+ int dccp_v4_connect (struct sock * sk , struct sockaddr * uaddr , int addr_len )
214215{
215216 struct inet_sock * inet = inet_sk (sk );
216217 struct dccp_sock * dp = dccp_sk (sk );
@@ -288,16 +289,6 @@ static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
288289 usin -> sin_port );
289290 dccp_update_gss (sk , dp -> dccps_iss );
290291
291- /*
292- * SWL and AWL are initially adjusted so that they are not less than
293- * the initial Sequence Numbers received and sent, respectively:
294- * SWL := max(GSR + 1 - floor(W/4), ISR),
295- * AWL := max(GSS - W' + 1, ISS).
296- * These adjustments MUST be applied only at the beginning of the
297- * connection.
298- */
299- dccp_set_seqno (& dp -> dccps_awl , max48 (dp -> dccps_awl , dp -> dccps_iss ));
300-
301292 inet -> id = dp -> dccps_iss ^ jiffies ;
302293
303294 err = dccp_connect (sk );
@@ -317,6 +308,8 @@ static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
317308 goto out ;
318309}
319310
311+ EXPORT_SYMBOL_GPL (dccp_v4_connect );
312+
320313/*
321314 * This routine does path mtu discovery as defined in RFC1191.
322315 */
@@ -608,14 +601,16 @@ void dccp_v4_err(struct sk_buff *skb, u32 info)
608601}
609602
610603/* This routine computes an IPv4 DCCP checksum. */
611- static void dccp_v4_send_check (struct sock * sk , int len , struct sk_buff * skb )
604+ void dccp_v4_send_check (struct sock * sk , int len , struct sk_buff * skb )
612605{
613606 const struct inet_sock * inet = inet_sk (sk );
614607 struct dccp_hdr * dh = dccp_hdr (skb );
615608
616609 dh -> dccph_checksum = dccp_v4_checksum (skb , inet -> saddr , inet -> daddr );
617610}
618611
612+ EXPORT_SYMBOL_GPL (dccp_v4_send_check );
613+
619614int dccp_v4_send_reset (struct sock * sk , enum dccp_reset_codes code )
620615{
621616 struct sk_buff * skb ;
@@ -651,16 +646,6 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk,
651646 dccp_hdr (skb )-> dccph_sport );
652647}
653648
654- static inline int dccp_bad_service_code (const struct sock * sk ,
655- const __u32 service )
656- {
657- const struct dccp_sock * dp = dccp_sk (sk );
658-
659- if (dp -> dccps_service == service )
660- return 0 ;
661- return !dccp_list_has_service (dp -> dccps_service_list , service );
662- }
663-
664649int dccp_v4_conn_request (struct sock * sk , struct sk_buff * skb )
665650{
666651 struct inet_request_sock * ireq ;
@@ -672,7 +657,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
672657 const __u32 service = dccp_hdr_request (skb )-> dccph_req_service ;
673658 struct dccp_skb_cb * dcb = DCCP_SKB_CB (skb );
674659 __u8 reset_code = DCCP_RESET_CODE_TOO_BUSY ;
675- struct dst_entry * dst = NULL ;
676660
677661 /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */
678662 if (((struct rtable * )skb -> dst )-> rt_flags &
@@ -713,7 +697,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
713697 ireq = inet_rsk (req );
714698 ireq -> loc_addr = daddr ;
715699 ireq -> rmt_addr = saddr ;
716- /* FIXME: Merge Aristeu's option parsing code when ready */
717700 req -> rcv_wnd = 100 ; /* Fake, option parsing will get the
718701 right value */
719702 ireq -> opt = NULL ;
@@ -731,7 +714,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
731714 dreq -> dreq_iss = dccp_v4_init_sequence (sk , skb );
732715 dreq -> dreq_service = service ;
733716
734- if (dccp_v4_send_response (sk , req , dst ))
717+ if (dccp_v4_send_response (sk , req , NULL ))
735718 goto drop_and_free ;
736719
737720 inet_csk_reqsk_queue_hash_add (sk , req , DCCP_TIMEOUT_INIT );
@@ -748,6 +731,8 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
748731 return -1 ;
749732}
750733
734+ EXPORT_SYMBOL_GPL (dccp_v4_conn_request );
735+
751736/*
752737 * The three way handshake has completed - we got a valid ACK or DATAACK -
753738 * now create the new socket.
@@ -802,6 +787,8 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
802787 return NULL ;
803788}
804789
790+ EXPORT_SYMBOL_GPL (dccp_v4_request_recv_sock );
791+
805792static struct sock * dccp_v4_hnd_req (struct sock * sk , struct sk_buff * skb )
806793{
807794 const struct dccp_hdr * dh = dccp_hdr (skb );
@@ -1021,7 +1008,9 @@ int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
10211008 return 0 ;
10221009}
10231010
1024- static inline int dccp_invalid_packet (struct sk_buff * skb )
1011+ EXPORT_SYMBOL_GPL (dccp_v4_do_rcv );
1012+
1013+ int dccp_invalid_packet (struct sk_buff * skb )
10251014{
10261015 const struct dccp_hdr * dh ;
10271016
@@ -1075,17 +1064,11 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
10751064 return 1 ;
10761065 }
10771066
1078- /* If the header checksum is incorrect, drop packet and return */
1079- if (dccp_v4_verify_checksum (skb , skb -> nh .iph -> saddr ,
1080- skb -> nh .iph -> daddr ) < 0 ) {
1081- LIMIT_NETDEBUG (KERN_WARNING "DCCP: header checksum is "
1082- "incorrect\n" );
1083- return 1 ;
1084- }
1085-
10861067 return 0 ;
10871068}
10881069
1070+ EXPORT_SYMBOL_GPL (dccp_invalid_packet );
1071+
10891072/* this is called when real data arrives */
10901073int dccp_v4_rcv (struct sk_buff * skb )
10911074{
@@ -1098,6 +1081,14 @@ int dccp_v4_rcv(struct sk_buff *skb)
10981081 if (dccp_invalid_packet (skb ))
10991082 goto discard_it ;
11001083
1084+ /* If the header checksum is incorrect, drop packet and return */
1085+ if (dccp_v4_verify_checksum (skb , skb -> nh .iph -> saddr ,
1086+ skb -> nh .iph -> daddr ) < 0 ) {
1087+ LIMIT_NETDEBUG (KERN_WARNING "%s: incorrect header checksum\n" ,
1088+ __FUNCTION__ );
1089+ goto discard_it ;
1090+ }
1091+
11011092 dh = dccp_hdr (skb );
11021093
11031094 DCCP_SKB_CB (skb )-> dccpd_seq = dccp_hdr_seq (skb );
@@ -1217,7 +1208,7 @@ struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
12171208 .sockaddr_len = sizeof (struct sockaddr_in ),
12181209};
12191210
1220- static int dccp_v4_init_sock (struct sock * sk )
1211+ int dccp_v4_init_sock (struct sock * sk )
12211212{
12221213 struct dccp_sock * dp = dccp_sk (sk );
12231214 static int dccp_ctl_socket_init = 1 ;
@@ -1270,7 +1261,9 @@ static int dccp_v4_init_sock(struct sock *sk)
12701261 return 0 ;
12711262}
12721263
1273- static int dccp_v4_destroy_sock (struct sock * sk )
1264+ EXPORT_SYMBOL_GPL (dccp_v4_init_sock );
1265+
1266+ int dccp_v4_destroy_sock (struct sock * sk )
12741267{
12751268 struct dccp_sock * dp = dccp_sk (sk );
12761269
@@ -1303,6 +1296,8 @@ static int dccp_v4_destroy_sock(struct sock *sk)
13031296 return 0 ;
13041297}
13051298
1299+ EXPORT_SYMBOL_GPL (dccp_v4_destroy_sock );
1300+
13061301static void dccp_v4_reqsk_destructor (struct request_sock * req )
13071302{
13081303 kfree (inet_rsk (req )-> opt );
@@ -1331,7 +1326,7 @@ struct proto dccp_prot = {
13311326 .recvmsg = dccp_recvmsg ,
13321327 .backlog_rcv = dccp_v4_do_rcv ,
13331328 .hash = dccp_v4_hash ,
1334- .unhash = dccp_v4_unhash ,
1329+ .unhash = dccp_unhash ,
13351330 .accept = inet_csk_accept ,
13361331 .get_port = dccp_v4_get_port ,
13371332 .shutdown = dccp_shutdown ,
0 commit comments