routing/miniupnpd/patches/103-nat-pmp-fix-writenu16.patch
Steven Barth 2bb7d479d3 miniupnpd: fix integer conversion in NAT-PMP, update description
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-30 15:49:59 +02:00

11 lines
300 B
Diff

--- a/natpmp.c
+++ b/natpmp.c
@@ -54,7 +54,7 @@ INLINE void writenu32(uint8_t * p, uint3
#define WRITENU32(p, n) writenu32(p, n)
INLINE void writenu16(uint8_t * p, uint16_t n)
{
- p[0] = (n < 0xff00) >> 8;
+ p[0] = (n & 0xff00) >> 8;
p[1] = n & 0xff;
}
#define WRITENU16(p, n) writenu16(p, n)