resolve conflicts

This commit is contained in:
Darren Reed 2000-08-13 05:00:44 +00:00
parent 3002dee911
commit 561e006b67
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64591
4 changed files with 83 additions and 31 deletions

View File

@ -820,18 +820,6 @@ int out;
fin->fin_qfm = m;
fin->fin_qif = qif;
# endif
# ifdef USE_INET6
if (v == 6) {
ATOMIC_INCL(frstats[0].fr_ipv6[out]);
} else
# endif
if (!out && fr_chksrc && !fr_verifysrc(ip->ip_src, ifp)) {
ATOMIC_INCL(frstats[0].fr_badsrc);
# if !SOLARIS
m_freem(m);
# endif
return error;
}
#endif /* _KERNEL */
/*
@ -847,8 +835,29 @@ int out;
fin->fin_out = out;
fin->fin_mp = mp;
fr_makefrip(hlen, ip, fin);
pass = fr_pass;
#ifdef _KERNEL
# ifdef USE_INET6
if (v == 6) {
ATOMIC_INCL(frstats[0].fr_ipv6[out]);
} else
# endif
if (!out && fr_chksrc && !fr_verifysrc(ip->ip_src, ifp)) {
ATOMIC_INCL(frstats[0].fr_badsrc);
# ifdef IPFILTER_LOG
if (fr_chksrc == 2) {
fin->fin_group = -2;
pass = FR_INQUE|FR_NOMATCH|FR_LOGB;
(void) IPLLOG(pass, ip, fin, m);
}
# endif
# if !SOLARIS
m_freem(m);
# endif
return error;
}
#endif
pass = fr_pass;
if (fin->fin_fi.fi_fl & FI_SHORT) {
ATOMIC_INCL(frstats[out].fr_short);
}
@ -1367,7 +1376,7 @@ tcphdr_t *tcp;
* SUCH DAMAGE.
*
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
* $Id: fil.c,v 2.35.2.18 2000/07/19 13:13:40 darrenr Exp $
* $Id: fil.c,v 2.35.2.20 2000/08/13 04:15:43 darrenr Exp $
*/
/*
* Copy data from an mbuf chain starting "off" bytes from the beginning,
@ -1846,11 +1855,14 @@ size_t c;
int err;
#if SOLARIS
copyin(a, &ca, sizeof(ca));
if (copyin(a, &ca, sizeof(ca)))
return EFAULT;
#else
bcopy(a, &ca, sizeof(ca));
#endif
err = copyin(ca, b, c);
if (err)
err = EFAULT;
return err;
}
@ -1863,11 +1875,14 @@ size_t c;
int err;
#if SOLARIS
copyin(b, &ca, sizeof(ca));
if (copyin(b, &ca, sizeof(ca)))
return EFAULT;
#else
bcopy(b, &ca, sizeof(ca));
#endif
err = copyout(a, ca, c);
if (err)
err = EFAULT;
return err;
}

View File

@ -22,8 +22,6 @@
# endif
# else
# ifdef KLD_MODULE
# include <sys/osreldate.h>
# else
# include <osreldate.h>
# endif
# endif

View File

@ -49,7 +49,8 @@
#include "ipf.h"
#include "iplang.h"
#if !defined(__NetBSD__) && !defined(__FreeBSD__)
#if !defined(__NetBSD__) && (!defined(__FreeBSD_version) && \
__FreeBSD_version < 400020)
extern struct ether_addr *ether_aton __P((char *));
#endif

View File

@ -336,7 +336,7 @@ int len;
t += 2;
if (!((j + 1) & 0xf)) {
s -= 15;
sprintf((char *)t, " ");
sprintf((char *)t, " ");
t += 8;
for (k = 16; k; k--, s++)
*t++ = (isprint(*s) ? *s : '.');
@ -581,6 +581,7 @@ int blen;
{
tcphdr_t *tp;
struct icmp *ic;
struct icmp *icmp;
struct tm *tm;
char *t, *proto;
int i, v, lvl, res, len, off, plen, ipoff;
@ -742,19 +743,56 @@ int blen;
ic->icmp_type == ICMP_REDIRECT ||
ic->icmp_type == ICMP_TIMXCEED) {
ipc = &ic->icmp_ip;
tp = (tcphdr_t *)((char *)ipc + hl);
i = ntohs(ipc->ip_len);
ipoff = ntohs(ipc->ip_off);
proto = getproto(ipc->ip_p);
t += strlen(t);
(void) sprintf(t, " for %s,%s -",
HOSTNAME_V4(res, ipc->ip_src),
portname(res, proto, (u_int)tp->th_sport));
t += strlen(t);
(void) sprintf(t, " %s,%s PR %s len %hu %hu",
HOSTNAME_V4(res, ipc->ip_dst),
portname(res, proto, (u_int)tp->th_dport),
proto, ipc->ip_hl << 2, ipc->ip_len);
if (!(ipoff & IP_OFFMASK) &&
((ipc->ip_p == IPPROTO_TCP) ||
(ipc->ip_p == IPPROTO_UDP))) {
tp = (tcphdr_t *)((char *)ipc + hl);
t += strlen(t);
(void) sprintf(t, " for %s,%s -",
HOSTNAME_V4(res, ipc->ip_src),
portname(res, proto,
(u_int)tp->th_sport));
t += strlen(t);
(void) sprintf(t, " %s,%s PR %s len %hu %hu",
HOSTNAME_V4(res, ipc->ip_dst),
portname(res, proto,
(u_int)tp->th_dport),
proto, ipc->ip_hl << 2, i);
} else if (!(ipoff & IP_OFFMASK) &&
(ipc->ip_p == IPPROTO_ICMP)) {
icmp = (icmphdr_t *)((char *)ipc + hl);
t += strlen(t);
(void) sprintf(t, " for %s -",
HOSTNAME_V4(res, ipc->ip_src));
t += strlen(t);
(void) sprintf(t,
" %s PR icmp len %hu %hu icmp %d/%d",
HOSTNAME_V4(res, ipc->ip_dst),
ipc->ip_hl << 2, i,
icmp->icmp_type, icmp->icmp_code);
} else {
t += strlen(t);
(void) sprintf(t, " for %s -",
HOSTNAME_V4(res, ipc->ip_src));
t += strlen(t);
(void) sprintf(t, " %s PR %s len %hu (%hu)",
HOSTNAME_V4(res, ipc->ip_dst), proto,
ipc->ip_hl << 2, i);
t += strlen(t);
if (ipoff & IP_OFFMASK) {
(void) sprintf(t, " frag %s%s%hu@%hu",
ipoff & IP_MF ? "+" : "",
ipoff & IP_DF ? "-" : "",
i - (ipc->ip_hl<<2),
(ipoff & IP_OFFMASK) << 3);
}
}
}
} else {
(void) sprintf(t, "%s -> ", hostname(res, v, s));