@@ -46,11 +46,13 @@ static void dccp_v4_hash(struct sock *sk)
46
46
inet_hash (& dccp_hashinfo , sk );
47
47
}
48
48
49
- static void dccp_v4_unhash (struct sock * sk )
49
+ void dccp_unhash (struct sock * sk )
50
50
{
51
51
inet_unhash (& dccp_hashinfo , sk );
52
52
}
53
53
54
+ EXPORT_SYMBOL_GPL (dccp_unhash );
55
+
54
56
/* called with local bh disabled */
55
57
static int __dccp_v4_check_established (struct sock * sk , const __u16 lport ,
56
58
struct inet_timewait_sock * * twp )
@@ -209,8 +211,7 @@ static int dccp_v4_hash_connect(struct sock *sk)
209
211
}
210
212
}
211
213
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 )
214
215
{
215
216
struct inet_sock * inet = inet_sk (sk );
216
217
struct dccp_sock * dp = dccp_sk (sk );
@@ -288,16 +289,6 @@ static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
288
289
usin -> sin_port );
289
290
dccp_update_gss (sk , dp -> dccps_iss );
290
291
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
-
301
292
inet -> id = dp -> dccps_iss ^ jiffies ;
302
293
303
294
err = dccp_connect (sk );
@@ -317,6 +308,8 @@ static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
317
308
goto out ;
318
309
}
319
310
311
+ EXPORT_SYMBOL_GPL (dccp_v4_connect );
312
+
320
313
/*
321
314
* This routine does path mtu discovery as defined in RFC1191.
322
315
*/
@@ -608,14 +601,16 @@ void dccp_v4_err(struct sk_buff *skb, u32 info)
608
601
}
609
602
610
603
/* 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 )
612
605
{
613
606
const struct inet_sock * inet = inet_sk (sk );
614
607
struct dccp_hdr * dh = dccp_hdr (skb );
615
608
616
609
dh -> dccph_checksum = dccp_v4_checksum (skb , inet -> saddr , inet -> daddr );
617
610
}
618
611
612
+ EXPORT_SYMBOL_GPL (dccp_v4_send_check );
613
+
619
614
int dccp_v4_send_reset (struct sock * sk , enum dccp_reset_codes code )
620
615
{
621
616
struct sk_buff * skb ;
@@ -651,16 +646,6 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk,
651
646
dccp_hdr (skb )-> dccph_sport );
652
647
}
653
648
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
-
664
649
int dccp_v4_conn_request (struct sock * sk , struct sk_buff * skb )
665
650
{
666
651
struct inet_request_sock * ireq ;
@@ -672,7 +657,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
672
657
const __u32 service = dccp_hdr_request (skb )-> dccph_req_service ;
673
658
struct dccp_skb_cb * dcb = DCCP_SKB_CB (skb );
674
659
__u8 reset_code = DCCP_RESET_CODE_TOO_BUSY ;
675
- struct dst_entry * dst = NULL ;
676
660
677
661
/* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */
678
662
if (((struct rtable * )skb -> dst )-> rt_flags &
@@ -713,7 +697,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
713
697
ireq = inet_rsk (req );
714
698
ireq -> loc_addr = daddr ;
715
699
ireq -> rmt_addr = saddr ;
716
- /* FIXME: Merge Aristeu's option parsing code when ready */
717
700
req -> rcv_wnd = 100 ; /* Fake, option parsing will get the
718
701
right value */
719
702
ireq -> opt = NULL ;
@@ -731,7 +714,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
731
714
dreq -> dreq_iss = dccp_v4_init_sequence (sk , skb );
732
715
dreq -> dreq_service = service ;
733
716
734
- if (dccp_v4_send_response (sk , req , dst ))
717
+ if (dccp_v4_send_response (sk , req , NULL ))
735
718
goto drop_and_free ;
736
719
737
720
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)
748
731
return -1 ;
749
732
}
750
733
734
+ EXPORT_SYMBOL_GPL (dccp_v4_conn_request );
735
+
751
736
/*
752
737
* The three way handshake has completed - we got a valid ACK or DATAACK -
753
738
* now create the new socket.
@@ -802,6 +787,8 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
802
787
return NULL ;
803
788
}
804
789
790
+ EXPORT_SYMBOL_GPL (dccp_v4_request_recv_sock );
791
+
805
792
static struct sock * dccp_v4_hnd_req (struct sock * sk , struct sk_buff * skb )
806
793
{
807
794
const struct dccp_hdr * dh = dccp_hdr (skb );
@@ -1021,7 +1008,9 @@ int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
1021
1008
return 0 ;
1022
1009
}
1023
1010
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 )
1025
1014
{
1026
1015
const struct dccp_hdr * dh ;
1027
1016
@@ -1075,17 +1064,11 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
1075
1064
return 1 ;
1076
1065
}
1077
1066
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
-
1086
1067
return 0 ;
1087
1068
}
1088
1069
1070
+ EXPORT_SYMBOL_GPL (dccp_invalid_packet );
1071
+
1089
1072
/* this is called when real data arrives */
1090
1073
int dccp_v4_rcv (struct sk_buff * skb )
1091
1074
{
@@ -1098,6 +1081,14 @@ int dccp_v4_rcv(struct sk_buff *skb)
1098
1081
if (dccp_invalid_packet (skb ))
1099
1082
goto discard_it ;
1100
1083
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
+
1101
1092
dh = dccp_hdr (skb );
1102
1093
1103
1094
DCCP_SKB_CB (skb )-> dccpd_seq = dccp_hdr_seq (skb );
@@ -1217,7 +1208,7 @@ struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
1217
1208
.sockaddr_len = sizeof (struct sockaddr_in ),
1218
1209
};
1219
1210
1220
- static int dccp_v4_init_sock (struct sock * sk )
1211
+ int dccp_v4_init_sock (struct sock * sk )
1221
1212
{
1222
1213
struct dccp_sock * dp = dccp_sk (sk );
1223
1214
static int dccp_ctl_socket_init = 1 ;
@@ -1270,7 +1261,9 @@ static int dccp_v4_init_sock(struct sock *sk)
1270
1261
return 0 ;
1271
1262
}
1272
1263
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 )
1274
1267
{
1275
1268
struct dccp_sock * dp = dccp_sk (sk );
1276
1269
@@ -1303,6 +1296,8 @@ static int dccp_v4_destroy_sock(struct sock *sk)
1303
1296
return 0 ;
1304
1297
}
1305
1298
1299
+ EXPORT_SYMBOL_GPL (dccp_v4_destroy_sock );
1300
+
1306
1301
static void dccp_v4_reqsk_destructor (struct request_sock * req )
1307
1302
{
1308
1303
kfree (inet_rsk (req )-> opt );
@@ -1331,7 +1326,7 @@ struct proto dccp_prot = {
1331
1326
.recvmsg = dccp_recvmsg ,
1332
1327
.backlog_rcv = dccp_v4_do_rcv ,
1333
1328
.hash = dccp_v4_hash ,
1334
- .unhash = dccp_v4_unhash ,
1329
+ .unhash = dccp_unhash ,
1335
1330
.accept = inet_csk_accept ,
1336
1331
.get_port = dccp_v4_get_port ,
1337
1332
.shutdown = dccp_shutdown ,
0 commit comments