// L2TPNS PPP Stuff
-char const *cvs_id_ppp = "$Id: ppp.c,v 1.36 2004-11-30 01:10:44 bodea Exp $";
+char const *cvs_id_ppp = "$Id: ppp.c,v 1.38 2004-11-30 19:34:57 bodea Exp $";
#include <stdio.h>
#include <string.h>
*q++ = 6;
memset(q, 0, 4); // asyncmap 0
q += 4;
- *((u16 *) (response + 2)) = q - response; // LCP header length
+ *((u16 *) (response + 2)) = htons(q - response); // LCP header length
break;
case 3: // Authentication-Protocol
memcpy(q, o, length);
*(u16 *)(q += 2) = htons(PPPPAP); // NAK -> Use PAP instead
q += length;
- *((u16 *) (response + 2)) = q - response;
+ *((u16 *) (response + 2)) = htons(q - response);
}
break;
memcpy(q, o, length);
q += length;
- *((u16 *) (response + 2)) = q - response; // LCP header length
+ *((u16 *) (response + 2)) = htons(q - response); // LCP header length
}
x -= length;
o += length;
{
*(u32 *) (i + 2) = htonl(session[s].dns1);
*p = ConfigNak;
- LOG(5, s, t, " DNS1 = %s\n", fmtaddr(session[s].dns1, 0));
+ LOG(5, s, t, " DNS1 = %s\n",
+ fmtaddr(htonl(session[s].dns1), 0));
}
}
if ((i = findppp(p, 0x83))) // Secondary DNS address (TBA, is it)
{
*(u32 *) (i + 2) = htonl(session[s].dns2);
*p = ConfigNak;
- LOG(5, s, t, " DNS2 = %s\n", fmtaddr(session[s].dns2, 0));
+ LOG(5, s, t, " DNS2 = %s\n",
+ fmtaddr(htonl(session[s].dns2), 0));
}
}
i = findppp(p, 3); // IP address