aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/gnunet-helper-transport-wlan.c3
-rw-r--r--src/transport/gnunet-transport-wlan-sender.c16
2 files changed, 10 insertions, 9 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c
index 1b599d1ce..f50cc2385 100644
--- a/src/transport/gnunet-helper-transport-wlan.c
+++ b/src/transport/gnunet-helper-transport-wlan.c
@@ -1879,7 +1879,8 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1879 break; 1879 break;
1880 case ARPHRD_ETHER: 1880 case ARPHRD_ETHER:
1881 etheader.dst = header->frame.addr1; 1881 etheader.dst = header->frame.addr1;
1882 etheader.src = header->frame.addr2; 1882 /* etheader.src = header->frame.addr2; --- untrusted input */
1883 etheader.src = dev->pl_mac;
1883 etheader.type = htons (ETH_P_IP); 1884 etheader.type = htons (ETH_P_IP);
1884 memcpy (write_pout.buf, &etheader, sizeof (etheader)); 1885 memcpy (write_pout.buf, &etheader, sizeof (etheader));
1885 memcpy (&write_pout.buf[sizeof (etheader)], &header[1], sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame)); 1886 memcpy (&write_pout.buf[sizeof (etheader)], &header[1], sendsize - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame));
diff --git a/src/transport/gnunet-transport-wlan-sender.c b/src/transport/gnunet-transport-wlan-sender.c
index 7592ff24f..05d1d1eef 100644
--- a/src/transport/gnunet-transport-wlan-sender.c
+++ b/src/transport/gnunet-transport-wlan-sender.c
@@ -108,42 +108,42 @@ main (int argc, char *argv[])
108 time_t akt; 108 time_t akt;
109 int i; 109 int i;
110 ssize_t ret; 110 ssize_t ret;
111 pid_t pid;
112 int commpipe[2]; /* This holds the fd for the input & output of the pipe */
113 int macpipe[2]; /* This holds the fd for the input & output of the pipe */
111 114
112 if (4 != argc) 115 if (4 != argc)
113 { 116 {
114 fprintf (stderr, 117 fprintf (stderr,
115 "This program must be started with the interface and the targets and source mac as argument.\n"); 118 "This program must be started with the interface and the targets and source mac as argument.\n");
116 fprintf (stderr, 119 fprintf (stderr,
117 "Usage: interface-name mac-target mac-source\n" 120 "Usage: interface-name mac-DST mac-SRC\n"
118 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n"); 121 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
119 return 1; 122 return 1;
120 } 123 }
121 if (6 != 124 if (6 !=
122 SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], 125 SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
123 &temp[3], &temp[4], &temp[5])) 126 &temp[3], &temp[4], &temp[5]))
124 { 127 {
125 fprintf (stderr, 128 fprintf (stderr,
126 "Usage: interface-name mac-target mac-source\n" 129 "Usage: interface-name mac-DST mac-SRC\n"
127 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n"); 130 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
128 return 1; 131 return 1;
129 } 132 }
130 for (i = 0; i < 6; i++) 133 for (i = 0; i < 6; i++)
131 outmac.mac[i] = temp[i]; 134 outmac.mac[i] = temp[i];
132 if (6 != 135 if (6 !=
133 SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2], 136 SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
134 &temp[3], &temp[4], &temp[5])) 137 &temp[3], &temp[4], &temp[5]))
135 { 138 {
136 fprintf (stderr, 139 fprintf (stderr,
137 "Usage: interface-name mac-target mac-source\n" 140 "Usage: interface-name mac-DST mac-SRC\n"
138 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n"); 141 "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
139 return 1; 142 return 1;
140 } 143 }
141 for (i = 0; i < 6; i++) 144 for (i = 0; i < 6; i++)
142 inmac.mac[i] = temp[i]; 145 inmac.mac[i] = temp[i];
143 146
144 pid_t pid;
145 int commpipe[2]; /* This holds the fd for the input & output of the pipe */
146 int macpipe[2]; /* This holds the fd for the input & output of the pipe */
147 147
148 /* Setup communication pipeline first */ 148 /* Setup communication pipeline first */
149 if (pipe (commpipe)) 149 if (pipe (commpipe))