summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/ip_fil.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ipfilter/ip_fil.c')
-rw-r--r--contrib/ipfilter/ip_fil.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c
index 2aeeaf8..5238356 100644
--- a/contrib/ipfilter/ip_fil.c
+++ b/contrib/ipfilter/ip_fil.c
@@ -120,7 +120,7 @@ extern int ip_optcopy __P((struct ip *, struct ip *));
#if !defined(lint)
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_fil.c,v 2.42.2.55 2002/03/26 15:54:39 darrenr Exp $";
+static const char rcsid[] = "@(#)$Id: ip_fil.c,v 2.42.2.58 2002/06/06 10:47:27 darrenr Exp $";
#endif
@@ -643,6 +643,9 @@ int mode;
unit = dev;
#endif
+ if (fr_running == 0 && (cmd != SIOCFRENB || unit != IPL_LOGIPF))
+ return ENODEV;
+
SPL_NET(s);
if (unit == IPL_LOGNAT) {
@@ -887,7 +890,8 @@ caddr_t data;
* Check that the group number does exist and that if a head group
* has been specified, doesn't exist.
*/
- if ((req != SIOCZRLST) && fp->fr_grhead &&
+ if ((req != SIOCZRLST) && ((req == SIOCINAFR) || (req == SIOCINIFR) ||
+ (req == SIOCADAFR) || (req == SIOCADIFR)) && fp->fr_grhead &&
fr_findgroup((u_int)fp->fr_grhead, fp->fr_flags, unit, set, NULL))
return EEXIST;
if ((req != SIOCZRLST) && fp->fr_group &&
@@ -1221,13 +1225,18 @@ fr_info_t *fin;
struct mbuf **mp;
{
struct mbuf *m = *mp;
- char *dpsave;
- int error;
+ int error, hlen;
+ fr_info_t frn;
ip_t *ip;
- dpsave = fin->fin_dp;
+ bzero((char *)&frn, sizeof(frn));
+ frn.fin_ifp = fin->fin_ifp;
+ frn.fin_v = fin->fin_v;
+ frn.fin_out = fin->fin_out;
+ frn.fin_mp = fin->fin_mp;
ip = mtod(m, ip_t *);
+ hlen = sizeof(*ip);
ip->ip_v = fin->fin_v;
if (ip->ip_v == 4) {
@@ -1242,21 +1251,24 @@ struct mbuf **mp;
ip->ip_ttl = ip_defttl;
# endif
ip->ip_sum = 0;
- fin->fin_dp = (char *)(ip + 1);
+ frn.fin_dp = (char *)(ip + 1);
}
# ifdef USE_INET6
else if (ip->ip_v == 6) {
ip6_t *ip6 = (ip6_t *)ip;
+ hlen = sizeof(*ip6);
ip6->ip6_hlim = 127;
- fin->fin_dp = (char *)(ip6 + 1);
+ frn.fin_dp = (char *)(ip6 + 1);
}
# endif
# ifdef IPSEC
m->m_pkthdr.rcvif = NULL;
# endif
- error = ipfr_fastroute(m, mp, fin, NULL);
- fin->fin_dp = dpsave;
+
+ fr_makefrip(hlen, ip, &frn);
+
+ error = ipfr_fastroute(m, mp, &frn, NULL);
return error;
}
@@ -1563,6 +1575,9 @@ frdest_t *fdp;
/*
* Route packet.
*/
+#ifdef __sgi
+ ROUTE_RDLOCK();
+#endif
bzero((caddr_t)ro, sizeof (*ro));
dst = (struct sockaddr_in *)&ro->ro_dst;
dst->sin_family = AF_INET;
@@ -1599,6 +1614,11 @@ frdest_t *fdp;
# else
rtalloc(ro);
# endif
+
+#ifdef __sgi
+ ROUTE_UNLOCK();
+#endif
+
if (!ifp) {
if (!fr || !(fr->fr_flags & FR_FASTROUTE)) {
error = -2;
@@ -2098,7 +2118,7 @@ int code;
fr_info_t *fin;
int dst;
{
- verbose("- ICMP UNREACHABLE RST sent\n");
+ verbose("- ICMP UNREACHABLE sent\n");
return 0;
}
OpenPOWER on IntegriCloud