summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
index a57645b..d385df4 100644
--- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
+++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
@@ -61,65 +61,65 @@ int card_into_monitormode (pcap_t **orighandle, const char *device, int cardtype
61 skfd = socket(AF_INET, SOCK_STREAM, 0); 61 skfd = socket(AF_INET, SOCK_STREAM, 0);
62 struct iwreq wrq; 62 struct iwreq wrq;
63 wrq.u.mode = IW_MODE_MONITOR; 63 wrq.u.mode = IW_MODE_MONITOR;
64 64
65 if(iw_set_ext(skfd,(char *) device,SIOCSIWMODE,&wrq)<0) 65 if(iw_set_ext(skfd,(char *) device,SIOCSIWMODE,&wrq)<0)
66 { 66 {
67 wl_logerr("Could not set hostap card %s to raw mode, check cardtype", device); 67 wl_logerr("Could not set hostap card %s to raw mode, check cardtype", device);
68 return 0; 68 return 0;
69 } 69 }
70 else 70 else
71 { 71 {
72 wl_loginfo("Successfully set hostap card %s into raw mode",device); 72 wl_loginfo("Successfully set hostap card %s into raw mode",device);
73 return 1; 73 return 1;
74 } 74 }
75 return 1; 75 return 1;
76#else 76#else
77 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring 77 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
78 int fd; 78 int fd;
79 //Wireless tools structure for the iocalls 79 //Wireless tools structure for the iocalls
80 struct iwreq ireq; 80 struct iwreq ireq;
81 int *ptr; 81 int *ptr;
82 /* Socket needed to use the iocall to */ 82 /* Socket needed to use the iocall to */
83 fd = socket(AF_INET, SOCK_STREAM, 0); 83 fd = socket(AF_INET, SOCK_STREAM, 0);
84 84
85 if ( fd == -1 ) { 85 if ( fd == -1 ) {
86 return -1; 86 return -1;
87 } 87 }
88 88
89 ptr = (int *) ireq.u.name; 89 ptr = (int *) ireq.u.name;
90 // This is the monitor mode for 802.11 non-prism header 90 // This is the monitor mode for 802.11 non-prism header
91 ptr[0] = 2; 91 ptr[0] = 2;
92 strcpy(ireq.ifr_ifrn.ifrn_name, device); 92 strcpy(ireq.ifr_ifrn.ifrn_name, device);
93 if (ioctl( fd, SIOCIWFIRSTPRIV + 4, &ireq)==0) 93 if (ioctl( fd, SIOCDEVPRIVATE, &ireq)==0)
94 { 94 {
95 /* All was fine... */ 95 /* All was fine... */
96 close(fd); 96 close(fd);
97 wl_loginfo("Set hostap card %s into monitormode",device); 97 wl_loginfo("Set hostap card %s into monitormode",device);
98 return 1; 98 return 1;
99 } 99 }
100 else 100 else
101 { 101 {
102 /* iocall does not work */ 102 /* iocall does not work */
103 close(fd); 103 close(fd);
104 wl_logerr("Could not set hostap card %s into monitormode, check cardtype",device); 104 wl_logerr("Could not set hostap card %s into monitormode, check cardtype",device);
105 return 0; 105 return 0;
106 } 106 }
107#endif 107#endif
108 } 108 }
109 else if (cardtype == CARD_TYPE_ORINOCCO ) 109 else if (cardtype == CARD_TYPE_ORINOCCO )
110 { 110 {
111 if (!card_set_channel (device, 1, CARD_TYPE_ORINOCCO)) 111 if (!card_set_channel (device, 1, CARD_TYPE_ORINOCCO))
112 { 112 {
113 wl_logerr("Could not set %s in raw mode, check cardtype", device); 113 wl_logerr("Could not set %s in raw mode, check cardtype", device);
114 return 0; 114 return 0;
115 } 115 }
116 else 116 else
117 { 117 {
118 wl_loginfo("Successfully set %s into raw mode",device); 118 wl_loginfo("Successfully set %s into raw mode",device);
119 } 119 }
120 } 120 }
121 121
122 /* Setting the promiscous and up flag to the interface */ 122 /* Setting the promiscous and up flag to the interface */
123 if (!card_check_rfmon_datalink(device)) 123 if (!card_check_rfmon_datalink(device))
124 { 124 {
125 wl_logerr("Cannot set interface to rfmon mode"); 125 wl_logerr("Cannot set interface to rfmon mode");