/[smeserver]/rpms/ppp/sme7/ppp-2.4.2-pcap.patch
ViewVC logotype

Annotation of /rpms/ppp/sme7/ppp-2.4.2-pcap.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Jun 12 17:08:30 2007 UTC (17 years ago) by slords
Branch: MAIN
CVS Tags: ppp-2_4_4-1_3_el4_sme, HEAD
Import on branch sme7 of package ppp-2.4.4-1.3.el4.sme.src.rpm

1 slords 1.1 --- ppp-2.4.2/pppd/options.c.pcap 2004-01-13 05:02:07.000000000 +0100
2     +++ ppp-2.4.2/pppd/options.c 2004-09-15 11:39:34.832772935 +0200
3     @@ -56,7 +56,6 @@
4     #endif
5     #ifdef PPP_FILTER
6     #include <pcap.h>
7     -#include <pcap-int.h> /* XXX: To get struct pcap */
8     #endif
9    
10     #include "pppd.h"
11     @@ -122,7 +121,6 @@
12     #ifdef PPP_FILTER
13     struct bpf_program pass_filter;/* Filter program for packets to pass */
14     struct bpf_program active_filter; /* Filter program for link-active pkts */
15     -pcap_t pc; /* Fake struct pcap so we can compile expr */
16     #endif
17    
18     char *current_option; /* the name of the option being parsed */
19     @@ -1439,12 +1437,18 @@
20     setpassfilter(argv)
21     char **argv;
22     {
23     - pc.linktype = DLT_PPP;
24     - pc.snapshot = PPP_HDRLEN;
25     + pcap_t* pc = pcap_open_dead (DLT_PPP, PPP_HDRLEN);
26     + if (!pc) {
27     + option_error("error in pass-filter expression: pcap_open_dead failed\n");
28     + return 0;
29     + }
30    
31     - if (pcap_compile(&pc, &pass_filter, *argv, 1, netmask) == 0)
32     + if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == 0) {
33     + pcap_close(pc);
34     return 1;
35     - option_error("error in pass-filter expression: %s\n", pcap_geterr(&pc));
36     + }
37     + option_error("error in pass-filter expression: %s\n", pcap_geterr(pc));
38     + pcap_close(pc);
39     return 0;
40     }
41    
42     @@ -1455,12 +1459,18 @@
43     setactivefilter(argv)
44     char **argv;
45     {
46     - pc.linktype = DLT_PPP;
47     - pc.snapshot = PPP_HDRLEN;
48     + pcap_t* pc = pcap_open_dead (DLT_PPP, PPP_HDRLEN);
49     + if (!pc) {
50     + option_error("error in pass-filter expression: pcap_open_dead failed\n");
51     + return 0;
52     + }
53    
54     - if (pcap_compile(&pc, &active_filter, *argv, 1, netmask) == 0)
55     + if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == 0) {
56     + pcap_close(pc);
57     return 1;
58     - option_error("error in active-filter expression: %s\n", pcap_geterr(&pc));
59     + }
60     + option_error("error in active-filter expression: %s\n", pcap_geterr(pc));
61     + pcap_close(pc);
62     return 0;
63     }
64     #endif

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed