- case 2: // asyncmap
- log_hex(2, "PPP LCP Packet", p, l);
- log(2, 0, 0, 0, "PPP LCP Packet type %d (%s len %d)\n", *p, ppp_lcp_types[(int)*p], ntohs( ((u16 *) p)[1]) );
+
+ case 2: // Async-Control-Character-Map
+ if (!ntohl(*(u32 *)(o + 2))) // all bits zero is OK
+ break;
+
+ if (response && response != ConfigNak) // rej already queued
+ break;
+
+ LOG(2, s, t, " Remote requesting asyncmap. Rejecting.\n");
+ if (!response)
+ {
+ q = makeppp(b, sizeof(b), NULL, 0, t, s, PPPLCP);
+ if (!q) break;
+ response = *q++ = ConfigNak;
+ }
+
+ if ((q - b + 11) > sizeof(b))
+ {
+ LOG(2, s, t, "LCP overflow for asyncmap ConfigNak.\n");
+ break;
+ }
+
+ *q++ = type;
+ *q++ = 6;
+ memset(q, 0, 4); // asyncmap 0
+ q += 4;