summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/nat_cmd.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-05-23 14:55:08 +0000
committerbrian <brian@FreeBSD.org>2000-05-23 14:55:08 +0000
commit9316f17a65e517f9e657bf6ca43e970898ee12a8 (patch)
treeadc9384fb2a951ff48a789c6a55648ee5bd7fde8 /usr.sbin/ppp/nat_cmd.c
parentc9e7aa307a3ca913110912d5da480a35f6b4df63 (diff)
downloadFreeBSD-src-9316f17a65e517f9e657bf6ca43e970898ee12a8.zip
FreeBSD-src-9316f17a65e517f9e657bf6ca43e970898ee12a8.tar.gz
Always pass packets through libalias when NAT is enabled.
Submitted by: luoqi Forgotten by: me
Diffstat (limited to 'usr.sbin/ppp/nat_cmd.c')
-rw-r--r--usr.sbin/ppp/nat_cmd.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c
index 062b7a0..1d58825 100644
--- a/usr.sbin/ppp/nat_cmd.c
+++ b/usr.sbin/ppp/nat_cmd.c
@@ -391,7 +391,6 @@ nat_LayerPull(struct bundle *bundle, struct link *l, struct mbuf *bp,
u_short *proto)
{
static int gfrags;
- struct ip *pip, *piip;
int ret, len, nfrags;
struct mbuf **last;
char *fptr;
@@ -401,20 +400,11 @@ nat_LayerPull(struct bundle *bundle, struct link *l, struct mbuf *bp,
log_Printf(LogDEBUG, "nat_LayerPull: PROTO_IP -> PROTO_IP\n");
m_settype(bp, MB_NATIN);
- bp = m_pullup(bp);
- pip = (struct ip *)MBUF_CTOP(bp);
- piip = (struct ip *)((char *)pip + (pip->ip_hl << 2));
-
- if (pip->ip_p == IPPROTO_IGMP ||
- (pip->ip_p == IPPROTO_IPIP && IN_CLASSD(ntohl(piip->ip_dst.s_addr))))
- return bp;
-
/* Ensure there's a bit of extra buffer for the NAT code... */
bp = m_pullup(m_append(bp, NULL, NAT_EXTRABUF));
ret = PacketAliasIn(MBUF_CTOP(bp), bp->m_len);
- pip = (struct ip *)MBUF_CTOP(bp);
- bp->m_len = ntohs(pip->ip_len);
+ bp->m_len = ntohs(((struct ip *)MBUF_CTOP(bp))->ip_len);
if (bp->m_len > MAX_MRU) {
log_Printf(LogWARN, "nat_LayerPull: Problem with IP header length (%lu)\n",
(unsigned long)bp->m_len);
@@ -457,10 +447,8 @@ nat_LayerPull(struct bundle *bundle, struct link *l, struct mbuf *bp,
case PKT_ALIAS_IGNORED:
if (log_IsKept(LogTCPIP)) {
log_Printf(LogTCPIP, "NAT engine ignored data:\n");
- PacketCheck(bundle, (char *)pip, ntohs(pip->ip_len), NULL);
+ PacketCheck(bundle, MBUF_CTOP(bp), bp->m_len, NULL);
}
- m_freem(bp);
- bp = NULL;
break;
default:
OpenPOWER on IntegriCloud