Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_spppfr.c
Show All 38 Lines | |||||
#endif | #endif | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/sockio.h> | #include <sys/sockio.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#if defined(__FreeBSD__) | |||||
#include <sys/random.h> | |||||
#endif | |||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#if defined (__OpenBSD__) | #if defined (__OpenBSD__) | ||||
#include <sys/md5k.h> | #include <sys/md5k.h> | ||||
#else | #else | ||||
#include <sys/md5.h> | #include <sys/md5.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | bad: if (debug) { | ||||
printf ("-%02x", *h++); | printf ("-%02x", *h++); | ||||
printf ("\n"); | printf ("\n"); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
if (h[5] == FR_MSG_ENQUIRY) { | if (h[5] == FR_MSG_ENQUIRY) { | ||||
if (len == FR_ENQUIRY_SIZE && | if (len == FR_ENQUIRY_SIZE && | ||||
h[12] == (u_char) sp->pp_seq[IDX_LCP]) { | h[12] == (u_char) sp->pp_seq[IDX_LCP]) { | ||||
sp->pp_seq[IDX_LCP] = random(); | sp->pp_seq[IDX_LCP] = arc4random(); | ||||
printf (SPP_FMT "loopback detected\n", | printf (SPP_FMT "loopback detected\n", | ||||
SPP_ARGS(ifp)); | SPP_ARGS(ifp)); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
if (h[5] != FR_MSG_STATUS) { | if (h[5] != FR_MSG_STATUS) { | ||||
if (debug) | if (debug) | ||||
printf (SPP_FMT "Unknown signaling message: 0x%02x\n", | printf (SPP_FMT "Unknown signaling message: 0x%02x\n", | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |