From owner-p4-projects@FreeBSD.ORG Thu Feb 15 11:55:59 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A4D3016A407; Thu, 15 Feb 2007 11:55:59 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7834216A400 for ; Thu, 15 Feb 2007 11:55:59 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 6956E13C441 for ; Thu, 15 Feb 2007 11:55:59 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1FBtxYN039767 for ; Thu, 15 Feb 2007 11:55:59 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1FBtwJi039763 for perforce@freebsd.org; Thu, 15 Feb 2007 11:55:58 GMT (envelope-from piso@freebsd.org) Date: Thu, 15 Feb 2007 11:55:58 GMT Message-Id: <200702151155.l1FBtwJi039763@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 114553 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2007 11:56:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=114553 Change 114553 by piso@piso_newluxor on 2007/02/15 11:54:57 Teach mbuf to alias_pptp. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#15 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#15 (text+ko) ==== @@ -307,8 +307,15 @@ u_int16_t ctl_type; /* control message type */ struct ip *pip; struct tcphdr *tc; + int size; - PULLUP_IPHDR(pip, ptr); + PULLUP_IPTCPHDR(pip, ptr); + if (pip == NULL) + return; + tc = (struct tcphdr *)ip_next(pip); + size = ((pip->ip_hl + tc->th_off) << 2) + + (sizeof(struct pptpMsgHead) + sizeof(struct pptpCallIds)); + PULLUP_SIZE(pip, ptr, size); if (pip == NULL) return; /* Verify valid PPTP control message */ @@ -349,10 +356,6 @@ cptr->cid1 = GetAliasPort(pptp_lnk); /* Compute TCP checksum for revised packet */ - PULLUP_TCPHDR(pip ,ptr); - if (pip == NULL) - return; - tc = (struct tcphdr *)ip_next(pip); accumulate -= cptr->cid1; ADJUST_CHECKSUM(accumulate, tc->th_sum); @@ -386,8 +389,15 @@ u_int16_t ctl_type; /* control message type */ struct ip *pip; struct tcphdr *tc; + int size; - PULLUP_IPHDR(pip ,ptr); + PULLUP_IPTCPHDR(pip, ptr); + if (pip == NULL) + return; + tc = (struct tcphdr *)ip_next(pip); + size = ((pip->ip_hl + tc->th_off) << 2) + + (sizeof(struct pptpMsgHead) + sizeof(struct pptpCallIds)); + PULLUP_SIZE(pip, ptr, size); if (pip == NULL) return; /* Verify valid PPTP control message */ @@ -428,10 +438,6 @@ *pcall_id = GetOriginalPort(pptp_lnk); /* Compute TCP checksum for modified packet */ - PULLUP_TCPHDR(pip, ptr); - if (pip == NULL) - return; - tc = (struct tcphdr *)ip_next(pip); accumulate -= *pcall_id; ADJUST_CHECKSUM(accumulate, tc->th_sum); @@ -492,8 +498,10 @@ struct alias_link *lnk; struct ip *pip; - // XXX broken PULLUP_IPHDR(pip, ptr); + PULLUP_SIZE(pip, ptr, (pip->ip_hl << 2) + sizeof(GreHdr)); + if (pip == NULL) + return (-1); gr = (GreHdr *) ip_next(pip); /* Check GRE header bits. */ @@ -519,8 +527,10 @@ struct alias_link *lnk; struct ip *pip; - // XXX broken PULLUP_IPHDR(pip, ptr); + PULLUP_SIZE(pip, ptr, (pip->ip_hl << 2) + sizeof(GreHdr)); + if (pip == NULL) + return (-1); gr = (GreHdr *) ip_next(pip); /* Check GRE header bits. */