gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25028 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r25028 - gnunet/src/transport
Date: Fri, 16 Nov 2012 18:37:30 +0100

Author: grothoff
Date: 2012-11-16 18:37:30 +0100 (Fri, 16 Nov 2012)
New Revision: 25028

Modified:
   gnunet/src/transport/gnunet-helper-transport-wlan.c
   gnunet/src/transport/gnunet-transport-wlan-sender.c
Log:
-fix

Modified: gnunet/src/transport/gnunet-helper-transport-wlan.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-11-16 17:32:37 UTC 
(rev 25027)
+++ gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-11-16 17:37:30 UTC 
(rev 25028)
@@ -1879,7 +1879,8 @@
     break;
   case ARPHRD_ETHER:
     etheader.dst = header->frame.addr1;
-    etheader.src = header->frame.addr2;
+    /* etheader.src = header->frame.addr2; --- untrusted input */
+    etheader.src = dev->pl_mac;
     etheader.type = htons (ETH_P_IP);
     memcpy (write_pout.buf, &etheader, sizeof (etheader));
     memcpy (&write_pout.buf[sizeof (etheader)], &header[1], sendsize - sizeof 
(struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame));

Modified: gnunet/src/transport/gnunet-transport-wlan-sender.c
===================================================================
--- gnunet/src/transport/gnunet-transport-wlan-sender.c 2012-11-16 17:32:37 UTC 
(rev 25027)
+++ gnunet/src/transport/gnunet-transport-wlan-sender.c 2012-11-16 17:37:30 UTC 
(rev 25028)
@@ -108,42 +108,42 @@
   time_t akt;
   int i;
   ssize_t ret;
+  pid_t pid;
+  int commpipe[2];              /* This holds the fd for the input & output of 
the pipe */
+  int macpipe[2];              /* This holds the fd for the input & output of 
the pipe */
 
   if (4 != argc)
   {
     fprintf (stderr,
              "This program must be started with the interface and the targets 
and source mac as argument.\n");
     fprintf (stderr,
-             "Usage: interface-name mac-target mac-source\n"
+             "Usage: interface-name mac-DST mac-SRC\n"
              "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
     return 1;
   }
   if (6 !=
-      SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
+      SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
               &temp[3], &temp[4], &temp[5]))
   {
     fprintf (stderr,
-             "Usage: interface-name mac-target mac-source\n"
+             "Usage: interface-name mac-DST mac-SRC\n"
              "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
     return 1;
   }
   for (i = 0; i < 6; i++)
     outmac.mac[i] = temp[i];
   if (6 !=
-      SSCANF (argv[2], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
+      SSCANF (argv[3], "%x-%x-%x-%x-%x-%x", &temp[0], &temp[1], &temp[2],
               &temp[3], &temp[4], &temp[5]))
   {
     fprintf (stderr,
-             "Usage: interface-name mac-target mac-source\n"
+             "Usage: interface-name mac-DST mac-SRC\n"
              "e.g. mon0 11-22-33-44-55-66 12-34-56-78-90-ab\n");
     return 1;
   }
   for (i = 0; i < 6; i++)
     inmac.mac[i] = temp[i];
 
-  pid_t pid;
-  int commpipe[2];              /* This holds the fd for the input & output of 
the pipe */
-  int macpipe[2];              /* This holds the fd for the input & output of 
the pipe */
 
   /* Setup communication pipeline first */
   if (pipe (commpipe))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]