summaryrefslogtreecommitdiffstats
path: root/asn1c_patches/01_fix_per_encoding_dieter.diff
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-01-03 00:00:47 +0100
committerHarald Welte <laforge@gnumonks.org>2010-01-07 10:22:24 +0100
commitd70bee4016a2562eb016f86d6936a8a5890019f6 (patch)
tree3ddf25a5e709352675f49a9e3d1f10d06af38e95 /asn1c_patches/01_fix_per_encoding_dieter.diff
parenta4f954f6c60484198d31c4823e24b0989c36a11f (diff)
rrlp-ephemeris: Add directory with asn1c patches
- One is just to improve the debug prints - The other fixes a problem in PER encoding found by Dieter Spaar. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'asn1c_patches/01_fix_per_encoding_dieter.diff')
-rw-r--r--asn1c_patches/01_fix_per_encoding_dieter.diff17
1 files changed, 17 insertions, 0 deletions
diff --git a/asn1c_patches/01_fix_per_encoding_dieter.diff b/asn1c_patches/01_fix_per_encoding_dieter.diff
new file mode 100644
index 0000000..a09c201
--- /dev/null
+++ b/asn1c_patches/01_fix_per_encoding_dieter.diff
@@ -0,0 +1,17 @@
+Index: skeletons/per_support.c
+===================================================================
+--- skeletons/per_support.c (revision 1407)
++++ skeletons/per_support.c (working copy)
+@@ -336,7 +336,12 @@
+ buf[3] = bits;
+ else {
+ ASN_DEBUG("->[PER out split %d]", obits);
++#if 1 // Dieter
++ po->nboff -= obits; // undo incrementation from a few lines above
++ per_put_few_bits(po, bits >> (obits - 24), 24); // shift according to the rest of the bits
++#else
+ per_put_few_bits(po, bits >> 8, 24);
++#endif
+ per_put_few_bits(po, bits, obits - 24);
+ ASN_DEBUG("<-[PER out split %d]", obits);
+ }