FreeBSD Bugzilla – Attachment 258 Details for
Bug 1219
IPFW kernel code enhancements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.71 KB, created by
Alex Nash
on 1996-05-19 23:30:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alex Nash
Created:
1996-05-19 23:30:03 UTC
Size:
2.71 KB
patch
obsolete
>*** 22,29 **** > #include <sys/malloc.h> > #include <sys/mbuf.h> > #include <sys/queue.h> >- #if 0 /* XXX -current, but not -stable */ > #include <sys/kernel.h> > #include <sys/sysctl.h> > #endif > #include <net/if.h> >--- 22,30 ---- > #include <sys/malloc.h> > #include <sys/mbuf.h> > #include <sys/queue.h> > #include <sys/kernel.h> >+ #include <sys/time.h> >+ #if 0 /* XXX -current, but not -stable */ > #include <sys/sysctl.h> > #endif > #include <net/if.h> >*************** >*** 124,129 **** >--- 125,149 ---- > return 1; > } > >+ static int >+ icmptype_match(icmp, f) >+ struct icmp * icmp; >+ struct ip_fw * f; >+ { >+ int type; >+ >+ if (!(f->fw_flg & IP_FW_F_ICMPBIT)) >+ return(1); >+ >+ type = icmp->icmp_type; >+ >+ /* check for matching type in the bitmap */ >+ if (f->fw_icmptypes[type / (sizeof(unsigned) * 8)] & >+ (1U << (type % (8 * sizeof(unsigned))))) >+ return(1); >+ >+ return(0); /* no match */ >+ } > > static int > ipopts_match(ip, f) >*************** >*** 211,217 **** > printf(":%d", ntohs(udp->uh_dport)); > break; > case IPPROTO_ICMP: >! printf("ICMP:%u ", icmp->icmp_type); > print_ip(ip->ip_src); > printf(" "); > print_ip(ip->ip_dst); >--- 231,237 ---- > printf(":%d", ntohs(udp->uh_dport)); > break; > case IPPROTO_ICMP: >! printf("ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code); > print_ip(ip->ip_src); > printf(" "); > print_ip(ip->ip_dst); >*************** >*** 383,390 **** > continue; > > /* ICMP, done */ >! if (prt == IP_FW_F_ICMP) > goto got_match; > > /* Fragments can't match past this point */ > if (ip->ip_off & IP_OFFMASK) >--- 403,414 ---- > continue; > > /* ICMP, done */ >! if (prt == IP_FW_F_ICMP) { >! if (!icmptype_match(icmp, f)) >! continue; >! > goto got_match; >+ } > > /* Fragments can't match past this point */ > if (ip->ip_off & IP_OFFMASK) >*************** >*** 407,412 **** >--- 431,437 ---- > got_match: > f->fw_pcnt++; > f->fw_bcnt+=ip->ip_len; >+ f->timestamp = time.tv_sec; > if (f->fw_flg & IP_FW_F_PRN) { > if (f->fw_flg & IP_FW_F_ACCEPT) > ipfw_report("Accept", f->fw_number, ip, f->fw_pcnt); >*************** >*** 554,561 **** >--- 579,591 ---- > s = splnet(); > for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next) > if (!frwl || frwl->fw_number == fcp->rule->fw_number) >+ { > fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0; >+ fcp->rule->timestamp = 0; >+ } > splx(s); >+ >+ return(0); > } > > static struct ip_fw * >*************** >*** 596,607 **** > frwl->fw_nsp, frwl->fw_ndp)); > return (NULL); > } >- #if 0 >- if ((frwl->fw_flg & IP_FW_F_KIND) == IP_FW_F_ICMP) { >- dprintf(("ip_fw_ctl: request for unsupported ICMP frwling\n")); >- return (NULL); >- } >- #endif > return frwl; > } > >--- 626,631 ----
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1219
:
257
| 258