fix potential rootfs owner/group mismatch (tgz root only, patch from #4562)
[openwrt.git] / package / ppp / patches / 105-debian_pppoatm_cleanup.patch
1 Index: ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c
2 ===================================================================
3 --- ppp-2.4.3.orig/pppd/plugins/pppoatm/pppoatm.c 2007-06-04 13:22:08.348586104 +0200
4 +++ ppp-2.4.3/pppd/plugins/pppoatm/pppoatm.c 2007-06-04 13:22:10.825209600 +0200
5 @@ -70,18 +70,20 @@
6 {
7 struct sockaddr_atmpvc addr;
8 extern struct stat devstat;
9 +
10 if (device_got_set)
11 return 0;
12 - //info("PPPoATM setdevname_pppoatm: '%s'", cp);
13 +
14 memset(&addr, 0, sizeof addr);
15 if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
16 T2A_PVC | T2A_NAME) < 0) {
17 - if(doit)
18 - info("atm does not recognize: %s", cp);
19 + if (doit)
20 + info("cannot parse the ATM address: %s", cp);
21 return 0;
22 - }
23 - if (!doit) return 1;
24 - //if (!dev_set_ok()) return -1;
25 + }
26 + if (!doit)
27 + return 1;
28 +
29 memcpy(&pvcaddr, &addr, sizeof pvcaddr);
30 strlcpy(devnam, cp, sizeof devnam);
31 devstat.st_mode = S_IFSOCK;
32 @@ -93,7 +95,6 @@
33 lcp_allowoptions[0].neg_asyncmap = 0;
34 lcp_wantoptions[0].neg_pcompression = 0;
35 }
36 - info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
37 device_got_set = 1;
38 return 1;
39 }
40 @@ -108,6 +109,7 @@
41 static void set_line_discipline_pppoatm(int fd)
42 {
43 struct atm_backend_ppp be;
44 +
45 be.backend_num = ATM_BACKEND_PPP;
46 if (!llc_encaps)
47 be.encaps = PPPOATM_ENCAPS_VC;
48 @@ -115,6 +117,7 @@
49 be.encaps = PPPOATM_ENCAPS_LLC;
50 else
51 be.encaps = PPPOATM_ENCAPS_AUTODETECT;
52 +
53 if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
54 fatal("ioctl(ATM_SETBACKEND): %m");
55 }
56 @@ -175,16 +178,19 @@
57 {
58 int sock;
59 struct ifreq ifr;
60 +
61 if (mtu > pppoatm_max_mtu)
62 error("Couldn't increase MTU to %d", mtu);
63 +
64 sock = socket(AF_INET, SOCK_DGRAM, 0);
65 if (sock < 0)
66 fatal("Couldn't create IP socket: %m");
67 +
68 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
69 ifr.ifr_mtu = mtu;
70 if (ioctl(sock, SIOCSIFMTU, (caddr_t) &ifr) < 0)
71 fatal("ioctl(SIOCSIFMTU): %m");
72 - (void) close (sock);
73 + close(sock);
74 }
75
76 static void recv_config_pppoa(int mru,
77 @@ -198,7 +204,7 @@
78
79 void plugin_init(void)
80 {
81 -#if defined(__linux__)
82 +#ifdef linux
83 extern int new_style_driver; /* From sys-linux.c */
84 if (!ppp_available() && !new_style_driver)
85 fatal("Kernel doesn't support ppp_generic - "
86 @@ -206,9 +212,9 @@
87 #else
88 fatal("No PPPoATM support on this OS");
89 #endif
90 - info("PPPoATM plugin_init");
91 add_options(pppoa_options);
92 }
93 +
94 struct channel pppoa_channel = {
95 options: pppoa_options,
96 process_extra_options: NULL,
This page took 0.061512 seconds and 5 git commands to generate.