fsm.c (134789) | fsm.c (134833) |
---|---|
1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/usr.sbin/ppp/fsm.c 134789 2004-09-05 01:46:52Z brian $ | 28 * $FreeBSD: head/usr.sbin/ppp/fsm.c 134833 2004-09-06 00:07:58Z marcel $ |
29 */ 30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34#include <netinet/ip.h> 35#include <sys/socket.h> 36#include <sys/un.h> --- 1013 unchanged lines hidden (view full) --- 1050 len = m_length(bp); 1051 if (len < sizeof(struct fsmheader)) { 1052 m_freem(bp); 1053 return; 1054 } 1055 bp = mbuf_Read(bp, &lh, sizeof lh); 1056 1057 if (ntohs(lh.length) > len) { | 29 */ 30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34#include <netinet/ip.h> 35#include <sys/socket.h> 36#include <sys/un.h> --- 1013 unchanged lines hidden (view full) --- 1050 len = m_length(bp); 1051 if (len < sizeof(struct fsmheader)) { 1052 m_freem(bp); 1053 return; 1054 } 1055 bp = mbuf_Read(bp, &lh, sizeof lh); 1056 1057 if (ntohs(lh.length) > len) { |
1058 log_Printf(LogWARN, "%s: Oops: Got %u bytes but %d byte payload " | 1058 log_Printf(LogWARN, "%s: Oops: Got %zu bytes but %d byte payload " |
1059 "- dropped\n", fp->link->name, len, (int)ntohs(lh.length)); 1060 m_freem(bp); 1061 return; 1062 } 1063 1064 if (lh.code < fp->min_code || lh.code > fp->max_code || 1065 lh.code > sizeof FsmCodes / sizeof *FsmCodes) { 1066 /* --- 147 unchanged lines hidden --- | 1059 "- dropped\n", fp->link->name, len, (int)ntohs(lh.length)); 1060 m_freem(bp); 1061 return; 1062 } 1063 1064 if (lh.code < fp->min_code || lh.code > fp->max_code || 1065 lh.code > sizeof FsmCodes / sizeof *FsmCodes) { 1066 /* --- 147 unchanged lines hidden --- |