@@ -877,22 +877,22 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
877877 case LLC_OPT_ACK_TMR_EXP :
878878 if (opt > LLC_OPT_MAX_ACK_TMR_EXP )
879879 goto out ;
880- llc -> ack_timer .expire = opt ;
880+ llc -> ack_timer .expire = opt * HZ ;
881881 break ;
882882 case LLC_OPT_P_TMR_EXP :
883883 if (opt > LLC_OPT_MAX_P_TMR_EXP )
884884 goto out ;
885- llc -> pf_cycle_timer .expire = opt ;
885+ llc -> pf_cycle_timer .expire = opt * HZ ;
886886 break ;
887887 case LLC_OPT_REJ_TMR_EXP :
888888 if (opt > LLC_OPT_MAX_REJ_TMR_EXP )
889889 goto out ;
890- llc -> rej_sent_timer .expire = opt ;
890+ llc -> rej_sent_timer .expire = opt * HZ ;
891891 break ;
892892 case LLC_OPT_BUSY_TMR_EXP :
893893 if (opt > LLC_OPT_MAX_BUSY_TMR_EXP )
894894 goto out ;
895- llc -> busy_state_timer .expire = opt ;
895+ llc -> busy_state_timer .expire = opt * HZ ;
896896 break ;
897897 case LLC_OPT_TX_WIN :
898898 if (opt > LLC_OPT_MAX_WIN )
@@ -942,17 +942,17 @@ static int llc_ui_getsockopt(struct socket *sock, int level, int optname,
942942 goto out ;
943943 switch (optname ) {
944944 case LLC_OPT_RETRY :
945- val = llc -> n2 ; break ;
945+ val = llc -> n2 ; break ;
946946 case LLC_OPT_SIZE :
947- val = llc -> n1 ; break ;
947+ val = llc -> n1 ; break ;
948948 case LLC_OPT_ACK_TMR_EXP :
949- val = llc -> ack_timer .expire ; break ;
949+ val = llc -> ack_timer .expire / HZ ; break ;
950950 case LLC_OPT_P_TMR_EXP :
951- val = llc -> pf_cycle_timer .expire ; break ;
951+ val = llc -> pf_cycle_timer .expire / HZ ; break ;
952952 case LLC_OPT_REJ_TMR_EXP :
953- val = llc -> rej_sent_timer .expire ; break ;
953+ val = llc -> rej_sent_timer .expire / HZ ; break ;
954954 case LLC_OPT_BUSY_TMR_EXP :
955- val = llc -> busy_state_timer .expire ; break ;
955+ val = llc -> busy_state_timer .expire / HZ ; break ;
956956 case LLC_OPT_TX_WIN :
957957 val = llc -> k ; break ;
958958 case LLC_OPT_RX_WIN :
@@ -999,6 +999,13 @@ static struct proto_ops llc_ui_ops = {
999999extern void llc_sap_handler (struct llc_sap * sap , struct sk_buff * skb );
10001000extern void llc_conn_handler (struct llc_sap * sap , struct sk_buff * skb );
10011001
1002+ static char llc_proc_err_msg [] __initdata =
1003+ KERN_CRIT "LLC: Unable to register the proc_fs entries\n" ;
1004+ static char llc_sysctl_err_msg [] __initdata =
1005+ KERN_CRIT "LLC: Unable to register the sysctl entries\n" ;
1006+ static char llc_sock_err_msg [] __initdata =
1007+ KERN_CRIT "LLC: Unable to register the network family\n" ;
1008+
10021009static int __init llc2_init (void )
10031010{
10041011 int rc = proto_register (& llc_proto , 0 );
@@ -1010,13 +1017,28 @@ static int __init llc2_init(void)
10101017 llc_station_init ();
10111018 llc_ui_sap_last_autoport = LLC_SAP_DYN_START ;
10121019 rc = llc_proc_init ();
1013- if (rc != 0 )
1020+ if (rc != 0 ) {
1021+ printk (llc_proc_err_msg );
10141022 goto out_unregister_llc_proto ;
1015- sock_register (& llc_ui_family_ops );
1023+ }
1024+ rc = llc_sysctl_init ();
1025+ if (rc ) {
1026+ printk (llc_sysctl_err_msg );
1027+ goto out_proc ;
1028+ }
1029+ rc = sock_register (& llc_ui_family_ops );
1030+ if (rc ) {
1031+ printk (llc_sock_err_msg );
1032+ goto out_sysctl ;
1033+ }
10161034 llc_add_pack (LLC_DEST_SAP , llc_sap_handler );
10171035 llc_add_pack (LLC_DEST_CONN , llc_conn_handler );
10181036out :
10191037 return rc ;
1038+ out_sysctl :
1039+ llc_sysctl_exit ();
1040+ out_proc :
1041+ llc_proc_exit ();
10201042out_unregister_llc_proto :
10211043 proto_unregister (& llc_proto );
10221044 goto out ;
@@ -1029,6 +1051,7 @@ static void __exit llc2_exit(void)
10291051 llc_remove_pack (LLC_DEST_CONN );
10301052 sock_unregister (PF_LLC );
10311053 llc_proc_exit ();
1054+ llc_sysctl_exit ();
10321055 proto_unregister (& llc_proto );
10331056}
10341057
0 commit comments