Commit e6539e2b authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

ppp: use PPP_TRANS instead of the magic number 0x20

Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent d3ab6fde
...@@ -523,7 +523,7 @@ static void ppp_async_process(unsigned long arg) ...@@ -523,7 +523,7 @@ static void ppp_async_process(unsigned long arg)
#define PUT_BYTE(ap, buf, c, islcp) do { \ #define PUT_BYTE(ap, buf, c, islcp) do { \
if ((islcp && c < 0x20) || (ap->xaccm[c >> 5] & (1 << (c & 0x1f)))) {\ if ((islcp && c < 0x20) || (ap->xaccm[c >> 5] & (1 << (c & 0x1f)))) {\
*buf++ = PPP_ESCAPE; \ *buf++ = PPP_ESCAPE; \
*buf++ = c ^ 0x20; \ *buf++ = c ^ PPP_TRANS; \
} else \ } else \
*buf++ = c; \ *buf++ = c; \
} while (0) } while (0)
...@@ -896,7 +896,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf, ...@@ -896,7 +896,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
sp = skb_put(skb, n); sp = skb_put(skb, n);
memcpy(sp, buf, n); memcpy(sp, buf, n);
if (ap->state & SC_ESCAPE) { if (ap->state & SC_ESCAPE) {
sp[0] ^= 0x20; sp[0] ^= PPP_TRANS;
ap->state &= ~SC_ESCAPE; ap->state &= ~SC_ESCAPE;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment