aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r--net/dccp/proto.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index c6b4362bb1d7..bdf784c422b5 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -512,7 +512,17 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
512 struct dccp_sock *dp = dccp_sk(sk); 512 struct dccp_sock *dp = dccp_sk(sk);
513 int val, err = 0; 513 int val, err = 0;
514 514
515 if (optlen < sizeof(int)) 515 switch (optname) {
516 case DCCP_SOCKOPT_PACKET_SIZE:
517 DCCP_WARN("sockopt(PACKET_SIZE) is deprecated: fix your app\n");
518 return 0;
519 case DCCP_SOCKOPT_CHANGE_L:
520 case DCCP_SOCKOPT_CHANGE_R:
521 DCCP_WARN("sockopt(CHANGE_L/R) is deprecated: fix your app\n");
522 return 0;
523 }
524
525 if (optlen < (int)sizeof(int))
516 return -EINVAL; 526 return -EINVAL;
517 527
518 if (get_user(val, (int __user *)optval)) 528 if (get_user(val, (int __user *)optval))
@@ -523,15 +533,6 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
523 533
524 lock_sock(sk); 534 lock_sock(sk);
525 switch (optname) { 535 switch (optname) {
526 case DCCP_SOCKOPT_PACKET_SIZE:
527 DCCP_WARN("sockopt(PACKET_SIZE) is deprecated: fix your app\n");
528 err = 0;
529 break;
530 case DCCP_SOCKOPT_CHANGE_L:
531 case DCCP_SOCKOPT_CHANGE_R:
532 DCCP_WARN("sockopt(CHANGE_L/R) is deprecated: fix your app\n");
533 err = 0;
534 break;
535 case DCCP_SOCKOPT_SERVER_TIMEWAIT: 536 case DCCP_SOCKOPT_SERVER_TIMEWAIT:
536 if (dp->dccps_role != DCCP_ROLE_SERVER) 537 if (dp->dccps_role != DCCP_ROLE_SERVER)
537 err = -EOPNOTSUPP; 538 err = -EOPNOTSUPP;
@@ -548,8 +549,8 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname,
548 err = -ENOPROTOOPT; 549 err = -ENOPROTOOPT;
549 break; 550 break;
550 } 551 }
551
552 release_sock(sk); 552 release_sock(sk);
553
553 return err; 554 return err;
554} 555}
555 556