@@ -737,7 +737,8 @@ rfc1048_print(netdissect_options *ndo,
737
737
{
738
738
/* this option should be 1 byte long */
739
739
if (len != 1 ) {
740
- ND_PRINT ("[ERROR: length != 1 byte]" );
740
+ ND_PRINT ("[length != 1 byte]" );
741
+ nd_print_invalid (ndo );
741
742
bp += len ;
742
743
len = 0 ;
743
744
break ;
@@ -787,7 +788,8 @@ rfc1048_print(netdissect_options *ndo,
787
788
case TAG_NETBIOS_NODE :
788
789
/* this option should be at least 1 byte long */
789
790
if (len < 1 ) {
790
- ND_PRINT ("[ERROR: length < 1 byte]" );
791
+ ND_PRINT ("[length < 1 byte]" );
792
+ nd_print_invalid (ndo );
791
793
break ;
792
794
}
793
795
tag = GET_U_1 (bp );
@@ -799,7 +801,8 @@ rfc1048_print(netdissect_options *ndo,
799
801
case TAG_OPT_OVERLOAD :
800
802
/* this option should be at least 1 byte long */
801
803
if (len < 1 ) {
802
- ND_PRINT ("[ERROR: length < 1 byte]" );
804
+ ND_PRINT ("[length < 1 byte]" );
805
+ nd_print_invalid (ndo );
803
806
break ;
804
807
}
805
808
tag = GET_U_1 (bp );
@@ -811,14 +814,16 @@ rfc1048_print(netdissect_options *ndo,
811
814
case TAG_CLIENT_FQDN :
812
815
/* this option should be at least 3 bytes long */
813
816
if (len < 3 ) {
814
- ND_PRINT ("[ERROR: length < 3 bytes]" );
817
+ ND_PRINT ("[length < 3 bytes]" );
818
+ nd_print_invalid (ndo );
815
819
bp += len ;
816
820
len = 0 ;
817
821
break ;
818
822
}
819
823
if (GET_U_1 (bp ) & 0xf0 ) {
820
- ND_PRINT ("[ERROR: MBZ nibble 0x%x != 0] " ,
824
+ ND_PRINT ("[MBZ nibble 0x%x != 0] " ,
821
825
(GET_U_1 (bp ) & 0xf0 ) >> 4 );
826
+ nd_print_invalid (ndo );
822
827
}
823
828
if (GET_U_1 (bp ) & 0x0f )
824
829
ND_PRINT ("[%s] " ,
@@ -841,7 +846,8 @@ rfc1048_print(netdissect_options *ndo,
841
846
842
847
/* this option should be at least 1 byte long */
843
848
if (len < 1 ) {
844
- ND_PRINT ("[ERROR: length < 1 byte]" );
849
+ ND_PRINT ("[length < 1 byte]" );
850
+ nd_print_invalid (ndo );
845
851
break ;
846
852
}
847
853
type = GET_U_1 (bp );
@@ -911,7 +917,8 @@ rfc1048_print(netdissect_options *ndo,
911
917
912
918
/* this option should be at least 5 bytes long */
913
919
if (len < 5 ) {
914
- ND_PRINT ("[ERROR: length < 5 bytes]" );
920
+ ND_PRINT ("[length < 5 bytes]" );
921
+ nd_print_invalid (ndo );
915
922
bp += len ;
916
923
len = 0 ;
917
924
break ;
@@ -924,15 +931,17 @@ rfc1048_print(netdissect_options *ndo,
924
931
len -- ;
925
932
/* mask_width <= 32 */
926
933
if (mask_width > 32 ) {
927
- ND_PRINT ("[ERROR: Mask width (%u) > 32]" , mask_width );
934
+ ND_PRINT ("[Mask width (%u) > 32]" , mask_width );
935
+ nd_print_invalid (ndo );
928
936
bp += len ;
929
937
len = 0 ;
930
938
break ;
931
939
}
932
940
significant_octets = (mask_width + 7 ) / 8 ;
933
941
/* significant octets + router(4) */
934
942
if (len < significant_octets + 4 ) {
935
- ND_PRINT ("[ERROR: Remaining length (%u) < %u bytes]" , len , significant_octets + 4 );
943
+ ND_PRINT ("[Remaining length (%u) < %u bytes]" , len , significant_octets + 4 );
944
+ nd_print_invalid (ndo );
936
945
bp += len ;
937
946
len = 0 ;
938
947
break ;
@@ -966,7 +975,8 @@ rfc1048_print(netdissect_options *ndo,
966
975
967
976
first = 1 ;
968
977
if (len < 2 ) {
969
- ND_PRINT ("[ERROR: length < 2 bytes]" );
978
+ ND_PRINT ("[length < 2 bytes]" );
979
+ nd_print_invalid (ndo );
970
980
bp += len ;
971
981
len = 0 ;
972
982
break ;
@@ -978,13 +988,16 @@ rfc1048_print(netdissect_options *ndo,
978
988
ND_PRINT ("\n\t " );
979
989
ND_PRINT ("instance#%u: " , suboptnumber );
980
990
if (suboptlen == 0 ) {
981
- ND_PRINT ("[ERROR: suboption length must be non-zero]" );
991
+ ND_PRINT ("[suboption length == 0]" );
992
+ nd_print_invalid (ndo );
982
993
bp += len ;
983
994
len = 0 ;
984
995
break ;
985
996
}
986
997
if (len < suboptlen ) {
987
- ND_PRINT ("[ERROR: invalid option]" );
998
+ ND_PRINT ("[length %u < suboption length %u" ,
999
+ len , suboptlen );
1000
+ nd_print_invalid (ndo );
988
1001
bp += len ;
989
1002
len = 0 ;
990
1003
break ;
@@ -1031,7 +1044,8 @@ rfc1048_print(netdissect_options *ndo,
1031
1044
bp += suboptlen2 ;
1032
1045
}
1033
1046
if (len != 0 ) {
1034
- ND_PRINT ("[ERROR: length < 2 bytes]" );
1047
+ ND_PRINT ("[length < 2 bytes]" );
1048
+ nd_print_invalid (ndo );
1035
1049
}
1036
1050
break ;
1037
1051
0 commit comments